Session Hooks
Automatic architecture context at conversation start
Session hooks inject Noodlbox context at the start of a conversation, before any reasoning begins. Your AI agent knows about the codebase structure from the first message.
How It Works
When you start a new conversation in an indexed repository:
- The hook detects the repository is indexed
- Injects context about available tools and resources
- Your agent immediately knows how to explore the codebase
The hook only fires on fresh sessions, not when resuming or clearing.
What Gets Injected
When the hook detects an indexed repository, your agent receives:
- Available tools - semantic search, impact detection, graph queries
- Available resources - architecture map, database schema
- Knowledge graph schema - node types, relationships, and properties
- Usage tips - read the map first to understand structure
Knowledge Graph Schema
The hook calls noodl schema and injects the full database schema, wrapped in <noodlbox-schema> tags. This gives your agent immediate understanding of:
- Node types -
CODE_SYMBOL,FILE,COMMUNITY,PROCESS - Relationships -
CALLS,CONTAINED_BY,MEMBER_OF,STEP_IN_PROCESS - Properties - Available fields on each node type
With this schema, your agent can write accurate Cypher queries without needing to discover the structure first.
Setup
Session hooks are automatically configured when you install the Noodlbox plugin:
claude plugin install noodlbox@noodlboxUses the SessionStart hook to inject context when a conversation begins.
Cursor achieves session context through .cursorrules and MCP resources:
noodl configureThe .cursorrules file provides base Noodlbox awareness, and agents can read MCP resources like map://{repository} and db://schema/{repository} on demand.
When It Fires
| Event | Hook Fires? | Why |
|---|---|---|
| New conversation | Yes | Fresh session needs context |
| Resume | No | Context already in conversation |
| Clear | No | User intentionally clearing |
See Also
- Search Hooks - Automatic context on every search
- MCP Tools - Direct tool access