context-mem
CLAUDE.md19 starsChanged 8 months agoMITView on GitHub
The source of truth for direction, positioning, pricing, fundraising, roadmap is: π docs/superpowers/plans/2026-04-17-1b-company-architecture.md Read it before answering any strategic question. Update the Decision Log (Β§9) whenever a strategic call is made. Plans navigation: docs/superpowers/plans/INDEX.md. Current phase: v3.4.0 "LLM Wiki Preview" shipped (2026-04-18). Next: v4.0.0 "Cognition" (target 2026-05-22) β full synthesis pages, Obsidian plugin, 8 IDE integrations, Context Protocol v1 RFC, and the post-migration benchmark re-run to backfill docs/benchmarks/synonym-migration-2026-04.md. This ensures nothing is lost between sessions. Temporal Resolver (src/plugins/search/temporal-resolver.ts): - Parsesβ¦
In this repositoryOne other file it gives its agents.
- context-optimizationSkill
The file
We split this CLAUDE.md into the rules it gives an agent
10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.
β0
Common Β· estimate
Many files like this have a rule of this kind.
β7
Distinctive Β· estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Read it before answering any strategic question.
- Very specific: line 14
When working on this project, use mcp__context-mem__observe to store:
- Distinctive: line 15
Every benchmark result (scores, per-category breakdown)
- Distinctive: line 16
Every decision about search strategy changes
- Distinctive: line 17
Every file modification with before/after scores
- Distinctive: line 18
Every failed experiment (what was tried, why it failed)
- Distinctive: line 23
ALWAYS commit before any git checkout, revert, or stash operation
- Distinctive: line 24
Never overwrite uncommitted working files
- Distinctive: line 25
When experimenting, commit each iteration separately
- Very specific: line 79
All improvements must go into src/plugins/search/, not just benchmarks/lib/kernel-adapter.js.
β βCommonβ is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. βVery specificβ is our guess from the words: it names a file, a command, a setting or the project itself.
Files
context-mem Project Instructions
Strategic Context (read first)
The source of truth for direction, positioning, pricing, fundraising, roadmap is:
π docs/superpowers/plans/2026-04-17-1b-company-architecture.md
Read it before answering any strategic question. Update the Decision Log (Β§9) whenever a strategic call is made. Plans navigation: docs/superpowers/plans/INDEX.md.
Current phase: v3.4.0 "LLM Wiki Preview" shipped (2026-04-18). Next: v4.0.0 "Cognition" (target 2026-05-22) β full synthesis pages, Obsidian plugin, 8 IDE integrations, Context Protocol v1 RFC, and the post-migration benchmark re-run to backfill docs/benchmarks/synonym-migration-2026-04.md.
Auto-Observe Rule
When working on this project, use mcp__context-mem__observe to store:
- Every benchmark result (scores, per-category breakdown)
- Every decision about search strategy changes
- Every file modification with before/after scores
- Every failed experiment (what was tried, why it failed)
This ensures nothing is lost between sessions.
Git Safety
- ALWAYS commit before any git checkout, revert, or stash operation
- Never overwrite uncommitted working files
- When experimenting, commit each iteration separately
Benchmark Commands
npm run bench # quick mode
npm run bench:full # full benchmarks
node benchmarks/longmemeval.js /tmp/longmemeval-data/longmemeval_s_cleaned.json
node benchmarks/locomo.js /tmp/locomo/data/locomo10.json
node benchmarks/convomem.js --category all --limit 50
node benchmarks/membench.js /tmp/membench-data/MemData/FirstAgent --limit 500
node benchmarks/beam.js /tmp/beam/chats/100K
node benchmarks/lmeb.js /tmp/lmeb/eval_dataCore Search Architecture (v3.2)
BM25 (src/plugins/search/bm25.ts) runs 8 strategies:
- AND-mode (weight 2.0) β high precision
- Phrase matching (1.9) β consecutive keyword pairs
- Entity-focused (1.8) β proper nouns, dates
- Sanitized FTS5 (1.5) β default tokenization
- Relaxed AND (1.2) β entity + top keywords
- OR-mode with synonym expansion (1.0) β broad recall
- Individual keywords (0.5) β long-tail catch 7b. Individual synonym search (0.2) β semantic gap bridge (e.g., "siblings" β "brother")
- Temporal resolution (1.6) β relative dates β absolute keywords
Temporal Resolver (src/plugins/search/temporal-resolver.ts):
- Parses "N days ago", "last Saturday", "last week", "a couple of days ago"
- Returns absolute date range with confidence level
- Pure deterministic, zero LLM cost
LLM Judge (src/plugins/search/llm-judge.ts):
- Optional Claude Haiku-based semantic reranker
- Scores top-N candidates 0-10, blends 50/50 with retrieval score
- Activates when ai_curation.enabled = true
- Achieves 100% R@5 on LongMemEval (500/500)
Vector (src/plugins/search/vector.ts):
- nomic-embed-text-v1.5 (768-dim) via @huggingface/transformers
- Memory-efficient: BM25 top-30 β embed β rerank
- Runs in parallel with BM25 (not cascade)
Fusion (src/plugins/search/fusion.ts):
- Hybrid parallel merge β BM25 + vector run independently, results fused
- Intent-adaptive weights (bm25: 0.45, trigram: 0.15, levenshtein: 0.05, vector: 0.35)
- IDF-weighted content reranker (keyword density + bigrams)
- Score normalization: BM25/trigram scores mapped to 0β1 range
- Weight clamping: Math.max(0, ...) prevents negative weights
Benchmarks (v3.2):
- LME 100% R@5 (BM25+Haiku) | 97.8% (pure local)
- LoCoMo 98.1% | MemBench 98.0% | ConvoMem 97.7%
Fix Core, Not Adapter
All improvements must go into src/plugins/search/, not just benchmarks/lib/kernel-adapter.js. The adapter imports from core modules β never duplicate logic.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

