agentleFS
JubaKitiashviliJubaKitiashvili/context-mem/CLAUDE.md

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…

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
  1. Very specific:

    Read it before answering any strategic question.

    line 9
  2. Very specific:

    When working on this project, use mcp__context-mem__observe to store:

    line 14
  3. Distinctive:

    Every benchmark result (scores, per-category breakdown)

    line 15
  4. Distinctive:

    Every decision about search strategy changes

    line 16
  5. Distinctive:

    Every file modification with before/after scores

    line 17
  6. Distinctive:

    Every failed experiment (what was tried, why it failed)

    line 18
  7. Distinctive:

    ALWAYS commit before any git checkout, revert, or stash operation

    line 23
  8. Distinctive:

    Never overwrite uncommitted working files

    line 24
  9. Distinctive:

    When experimenting, commit each iteration separately

    line 25
  10. Very specific:

    All improvements must go into src/plugins/search/, not just benchmarks/lib/kernel-adapter.js.

    line 79

β‰ˆ β€œ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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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_data

Core Search Architecture (v3.2)

BM25 (src/plugins/search/bm25.ts) runs 8 strategies:

  1. AND-mode (weight 2.0) β€” high precision
  2. Phrase matching (1.9) β€” consecutive keyword pairs
  3. Entity-focused (1.8) β€” proper nouns, dates
  4. Sanitized FTS5 (1.5) β€” default tokenization
  5. Relaxed AND (1.2) β€” entity + top keywords
  6. OR-mode with synonym expansion (1.0) β€” broad recall
  7. Individual keywords (0.5) β€” long-tail catch 7b. Individual synonym search (0.2) β€” semantic gap bridge (e.g., "siblings" β†’ "brother")
  8. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.