cap'n hook
cap'n hook (capn-hook) is a lightweight, local-first memory tool for coding agents. The problem it solves is simple: agents forget everything when a session ends, so they re-explore the same codebase mysteries every time. capn lets an agent save the files that answer a question the moment it figures them out, then recall them with a single command next session — skipping the rediscovery. The clever part is cache-busting: each saved answer is fingerprinted with the sha256 of its backing files, and the moment a file changes or disappears, that memory is automatically deleted. You never get a stale answer. It installs as a SessionStart hook for Claude Code and Codex (no wrapper, no middleware), stores human-readable Markdown entries in a local, gitignored .capn/ directory, and works agent-agnostically via its CLI. In a benchmark across 60 real developer questions on 5 production codebases, agents using capn recalled answers with 77% fewer tokens than cold exploration at equal correctness.
✅ Pros / Advantages
- • Saves agents from re-exploring known code
- • Auto cache-bust on file change — no stale answers
- • Zero wrapper: just a SessionStart hook
- • Local-first, gitignored, agent-agnostic CLI
- • 77% token savings in benchmark
❌ Cons / Limitations
- • First run downloads a 300MB–2GB embedding model
- • Memory is local-only, not shared across machines
- • Relies on the model following its hint
- • Official hooks only for Claude Code & Codex
- • Benchmark scope is limited (5 repos)
💰 Pricing Plans
Free (Open Source, MIT)
Pricing details are gathered from public sources and are subject to change. Please visit the official website for real-time rates.
Last updated: July 2026 · 9bests editorial review
✅ Who should use cap'n hook
- • Saves agents from re-exploring known code
- • Auto cache-bust on file change — no stale answers
- • Zero wrapper: just a SessionStart hook
- • Local-first, gitignored, agent-agnostic CLI
- • 77% token savings in benchmark
⚠️ Who should look elsewhere
- • First run downloads a 300MB–2GB embedding model
- • Memory is local-only, not shared across machines
- • Relies on the model following its hint
- • Official hooks only for Claude Code & Codex
- • Benchmark scope is limited (5 repos)
🎯 Common use cases
Autocompleting and refactoring code
Multi-file AI edits
Debugging and test generation
⚖️ cap'n hook vs Cursor
| cap'n hook | Cursor | |
|---|---|---|
| Rating | 4.2/5 | 4.8/5 |
| Pricing | Free (Open Source, MIT) | Free / $20/mo |
| Key strength | Saves agents from re-exploring known code | Best AI code editor |
See the full head-to-head in our cap'n hook vs Cursor comparison.
❓ Frequently asked questions
Is cap'n hook free?
+
cap'n hook offers a free tier (Free (Open Source, MIT)). Paid plans unlock higher limits and advanced features.
What is cap'n hook best for?
+
cap'n hook is best for Saves agents from re-exploring known code and Auto cache-bust on file change — no stale answers. cap'n hook (capn-hook) is a lightweight, local-first memory tool for coding agents. The problem it solves is simple: agents forget everything when a session ends, so they re-explore the same codebase mysteries every time. capn lets an agent save the files that answer a question the moment it figures them out, then recall them with a single command next session — skipping the rediscovery. The clever part is cache-busting: each saved answer is fingerprinted with the sha256 of its backing files, and the moment a file changes or disappears, that memory is automatically deleted. You never get a stale answer. It installs as a SessionStart hook for Claude Code and Codex (no wrapper, no middleware), stores human-readable Markdown entries in a local, gitignored .capn/ directory, and works agent-agnostically via its CLI. In a benchmark across 60 real developer questions on 5 production codebases, agents using capn recalled answers with 77% fewer tokens than cold exploration at equal correctness.
How does cap'n hook compare to Cursor?
+
cap'n hook (4.2/5) and Cursor (4.8/5) serve overlapping needs. cap'n hook stands out for Saves agents from re-exploring known code, while Cursor is stronger at Best AI code editor. Choose based on your priority.
🔄 Top Alternatives to cap'n hook
Related ToolsCursor
AI-first code editor built on VS Code
GitHub Copilot
AI pair programmer by GitHub/OpenAI
Windsurf (Codeium)
Free AI code completion and chat assistant
Replit Agent
AI-powered cloud IDE that builds full apps