session-init.cjs Sets up the workspace context when Claude Code starts, so later hooks know the project, config, and environment. Engineer Kit + Marketing Kit Default OFF Source still ships, but new installs do not register generated context hooks by default. Adds context Injects useful context for the main agent or subagents. Details
- Triggers
- SessionStart (startup/resume/clear/compact)
- Simple example
- You open Claude Code inside a repo. This hook detects the project, config, package manager, and branch so later hooks know the workspace.
- How to turn it off
-
It is already off in new installs. If a project manually restored the hook command, set this flag to false or remove the settings entry.
json · .claude/.ck.json{ "hooks": { "session-init": false } } - If this hook errors
- Unexpected crashes fail open. The flow continues, but Claude may lose that extra context or cached awareness.
- How this hook works
- Initialize session with project detection, config loading, and environment setup. Fires on startup, resume, clear, and compact.