Agent Session Hooks
Hooks let Archcore run commands automatically when an agent starts a session. This provides the agent with context about your .archcore/ directory before the conversation begins.
How Hooks Work
Section titled “How Hooks Work”- Agent starts a session (e.g., you open Claude Code)
- Agent triggers its
SessionStartevent - The hook runs
archcore hooks <agent-id> session-start - Archcore outputs context about available documents
- Agent receives this context alongside the conversation
Installation
Section titled “Installation”Automatic
Section titled “Automatic”archcore initHooks are installed automatically during archcore init for all detected agents that support them.
Manual
Section titled “Manual”archcore hooks installOr for a specific agent:
archcore hooks install --agent claude-codeSupported Agents
Section titled “Supported Agents”| Agent | Hook Location |
|---|---|
| Claude Code | .claude/settings.json |
| Cursor | Cursor hooks config |
| Gemini CLI | Gemini CLI config |
| GitHub Copilot | VS Code/Copilot config |
Hook Configuration
Section titled “Hook Configuration”For Claude Code, the hook is added to .claude/settings.json:
{ "hooks": { "SessionStart": [ { "matcher": "", "hooks": [ { "type": "command", "command": "archcore hooks claude-code session-start" } ] } ] }}Agent-Specific Commands
Section titled “Agent-Specific Commands”Each agent has its own hook subcommand:
archcore hooks claude-code session-startarchcore hooks cursor <event>archcore hooks gemini-cli <event>archcore hooks copilot <event>These commands are called by the agent — you don’t need to run them manually.