๐ง CTX
Cross-session memory for Claude Code โ BM25 + hybrid semantic retrieval, <1ms latency, zero LLM calls.
G1 recalls past engineering decisions from your git history and previous sessions. Pick a question, click Run โ see what Claude says with and without CTX.
G2 finds the exact file and line number before Claude's first tool call. Searches docs, codebase, and hooks simultaneously โ in under 1ms.
Results from empirical evaluation across G1 (decision recall) and G2 (retrieval) surfaces.
with CTX
with CTX
per prompt
(cited turns)
| Metric | With CTX | Without CTX | Unit | Notes |
|---|---|---|---|---|
| G1 Decision Recall | 1.000 | 0.219 | Recall@7 | MiniMax M2.5 downstream eval |
| G2 Docs Retrieval | 1.000 | 0.800 | H@5 (Hybrid) | 20-query goldset, 87 docs |
| G2 Code Retrieval | 0.958 | 0.946 | R@5 | vs Nemotron-Cascade-2 |
| Hallucination Rate | 0.000 | 0.170 | rate โ | 0% with CTX vs 17% without |
| Hook Latency | < 1 ms | โ | per prompt | Pure BM25 โ no LLM, no embedding |
| Utility Rate | 50% | โ | tool-use turns | Context actually cited by Claude |
G1 downstream eval: MiniMax M2.5, synthetic 32-query benchmark. G2 docs: 20-query goldset over 87 docs. G2 code: COIR RepoBench-style held-out eval.
Linux + WSL2 โ one command
pip install ctx-retriever && ctx-install
# verify
ctx-install status
What ctx-install does
- Copies 4 hook files to
~/.claude/hooks/ - Takes a timestamped backup of
~/.claude/settings.json - Merges CTX hook registrations โ never overwrites your existing hooks
- Atomically writes the new settings.json
- Smoke-tests by firing
bm25-memory.pyonce and confirming output
Restart Claude Code after install. Hooks fire on every prompt automatically.
Platform note: v1.0 supports Linux native and WSL2 only. Windows-native (Git Bash/MSYS2) support is in progress โ blocked on upstream Claude Code issue #34457.
Links