The hook contract
kanade does not patch Claude Code or wrap its binary. It observes via the hook contract — a tiny shell script that Claude Code already runs at every event boundary.
The contract
Section titled “The contract”When you install kanade, it appends entries to ~/.claude/settings.json under
the hooks key. Each entry runs a small shell command at one of Claude Code’s
six hook events:
SessionStart— a newclaudesession begins.UserPromptSubmit— you press Enter on a prompt.PreToolUse— Claude is about to call a tool.PostToolUse— the tool call completed.Notification— Claude surfaced a notification (e.g. waiting for input).SessionEnd— the session terminates.
For each event, the kanade hook script does one thing: appends a JSON line to a spool file. It never makes a network call. It is fast (~1 ms), synchronous, and crash-safe.
The spool file
Section titled “The spool file”The spool path is %LOCALAPPDATA%\kanade\data\hook.spool.jsonl. It’s append-only
and reset to empty after the daemon successfully ingests it into SQLite.
The daemon tails this file in a background task. If the daemon is down, the spool just accumulates — the next time kanade launches, the daemon catches up and the chronicle backfills.
What kanade does NOT do via the hook
Section titled “What kanade does NOT do via the hook”- It does not invoke
claudeitself. Your own shell +claudeCLI is doing the work; kanade is reading the events. - It does not intercept tool calls.
PreToolUseis a read; it cannot block or modify the call. - It does not phone home. The hook writes to a local file. Full stop.
Editing your settings.json
Section titled “Editing your settings.json”If you have an existing ~/.claude/settings.json, the kanade installer
merges its hook entries with whatever’s already there. Your other settings
are untouched. The merge is atomic — settings.json is written to a temp file
and renamed.
If you want to see what kanade installed, the entries are easy to spot — they
all reference kanade-hook in the command.
Removing the hook
Section titled “Removing the hook”Settings → Uninstall hook from the system tray removes only the kanade
entries from ~/.claude/settings.json and leaves the rest of the file alone.
The uninstaller does the same automatically if you remove the app.