Claude Code
Claude Code is Sigil’s primary integration. Four hooks run inside every session — no manual sigil remember calls needed. Memory is captured automatically and injected back into every new prompt before Claude sees it.
What you get
Section titled “What you get”- Zero-config capture — the
Stophook classifies your messages and saves preferences, decisions, constraints, and claims automatically. - Pre-prompt injection — relevant memory is retrieved and injected before Claude reads your prompt, so it already knows your context.
- Hot-context snapshot — your 20 most important facts are always loaded via
@~/.sigil/CLAUDE.md. Zero latency, no search needed. - Observation capture — the
PostToolUsehook records observations from file edits and shell commands, with SHA-256 dedup to prevent noise. - Session summaries —
SessionEndpromotes the most important facts and summarizes the session into a pod.
sigil init handles everything:
sigil initIt merges four hook entries into ~/.claude/settings.json and adds @~/.sigil/CLAUDE.md to your global ~/.claude/CLAUDE.md. Existing config is preserved — Sigil never overwrites what’s already there.
Verify:
sigil doctorHow the four hooks work
Section titled “How the four hooks work”UserPromptSubmit
Section titled “UserPromptSubmit”Runs before Claude sees your message. Performs a hybrid search (pgvector + BM25) against all stored memory, retrieves the top-K relevant facts, and injects them as additionalContext.
Claude reads your context before reading your prompt. You don’t paste anything.
PostToolUse
Section titled “PostToolUse”Runs after every Edit, Write, and Bash tool call. Captures the observation as a potential fact candidate. SHA-256 dedup against a 5-minute window prevents the same observation from flooding memory.
Runs after your message is sent (while Claude is thinking). Classifies your message into one of:
- preference — “I prefer tabs over spaces”
- decision — “We decided to use Postgres LISTEN/NOTIFY”
- constraint — “We must stay under 50ms latency”
- claim — “The auth service is owned by the platform team”
Then extracts atomic facts and entities, runs AUDM (Add / Update / Delete / Merge) logic against existing memory to prevent duplicates.
SessionEnd
Section titled “SessionEnd”Runs when the session closes. Summarizes the session into a claude_session pod and promotes high-importance facts.
Hook config location
Section titled “Hook config location”~/.claude/settings.json — hook entries (merged, not overwritten)~/.claude/CLAUDE.md — @import to ~/.sigil/CLAUDE.md~/.sigil/CLAUDE.md — hot-context snapshot (20 facts)~/.sigil/.hook-errors.log — append-only error logTroubleshooting
Section titled “Troubleshooting”sigil doctor # checks hook registration + error budgetIf a hook shows unregistered, re-run sigil init. If sigil doctor reports hook errors, read ~/.sigil/.hook-errors.log. Hooks fail silently by design — a broken memory layer never blocks a working prompt.
Performance tuning
Section titled “Performance tuning”To reduce per-prompt latency, use the hot-context snapshot without live search:
- Remove only the
UserPromptSubmithook entry from~/.claude/settings.json. - Keep
Stop,PostToolUse, andSessionEnd— these run asynchronously and don’t add to prompt latency. - The top-20 hot-context facts in
~/.sigil/CLAUDE.mdare still injected via the@importline.
You lose dynamic search but retain pre-loaded context. Best for low-latency workflows where you trust the hot-context to cover most queries.