Skip to content

Claude Code

Auto-wired

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.

  • Zero-config capture — the Stop hook 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 PostToolUse hook records observations from file edits and shell commands, with SHA-256 dedup to prevent noise.
  • Session summariesSessionEnd promotes the most important facts and summarizes the session into a pod.

sigil init handles everything:

Terminal window
sigil init

It 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:

Terminal window
sigil doctor

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.

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.

Runs when the session closes. Summarizes the session into a claude_session pod and promotes high-importance facts.

~/.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 log
Terminal window
sigil doctor # checks hook registration + error budget

If 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.

To reduce per-prompt latency, use the hot-context snapshot without live search:

  1. Remove only the UserPromptSubmit hook entry from ~/.claude/settings.json.
  2. Keep Stop, PostToolUse, and SessionEnd — these run asynchronously and don’t add to prompt latency.
  3. The top-20 hot-context facts in ~/.sigil/CLAUDE.md are still injected via the @import line.

You lose dynamic search but retain pre-loaded context. Best for low-latency workflows where you trust the hot-context to cover most queries.