memcrumbs

Open source · Apache-2.0 · Python 3.11+

Project memory for coding agents

memcrumbs is an open-source command-line tool that gives coding agents such as Claude Code a project memory: a small markdown wiki the agent reads before your code, and a local index that answers questions in a few hundred tokens. It uses only Python's standard library, and the network only to update itself. Two commands and five minutes give your agent a header of your rules that it reads first, every session.

pip install memcrumbs
no model callslocal onlyno background serviceWindows · macOS · Linux
sample project · bench/kiln
# the header every session starts with (excerpt)
Rules (ask before acting against these)
- Deploying anything to web-srv needs explicit owner approval each time
- Never delete rows from any production SQLite database
- Never restart KilnScheduler while a kiln is firing

$ memcrumbs find "how do I roll back a bad deploy" -n 2
[run ] Roll back booking app — wiki/runbooks/rollback-booking.md:1 · v8d
       …booking [release] in under two minutes by repointing…
[run ] Deploy booking app — wiki/runbooks/deploy-booking.md:1 · v8d
read: memcrumbs page rollback-booking

$ memcrumbs about repo/ops/EmberOps.psm1
EmberOps.psm1 — cited by 1 decision (ACCEPTED), 2 incidents, 1 runbook

What is memcrumbs?

memcrumbs is a command-line tool that keeps a project's working knowledge (standing rules, gotchas, runbooks, decisions, incidents and a dated journal) in short markdown pages, and indexes those pages, your docs and your code symbols in a local SQLite full-text index. A coding agent reads a header of rules once per session, then looks things up with memcrumbs find instead of grepping and reading whole files.

It sits between an agent's own scratch notes (Claude Code's auto-memory and CLAUDE.md) and a full documentation site, and it borrows from practices teams already use: architecture decision records, runbooks and post-incident reviews.

Start with three things. They work from the first session, before you write a single wiki page.

Rules first, every session

A header of your standing rules, the project map and the top gotchas is printed when a session starts, under a hard cap of 1,000 tokens by default.

memcrumbs status

Answers, not file dumps

From the first session, a lookup searches your docs and code symbols and returns a few ranked hits with path:line. The agent then opens one section or one function instead of a whole file.

find · page · outline · sym --body

What the wiki says about a file

Before an edit, the agent sees the decisions, incidents and gotchas that cite the file, with their verdicts. It has more to say as you record them.

memcrumbs about deploy.ps1

When you need more. Everything else is optional, and each part works on its own.

It knows when it may be wrong

Every hit carries its age and status, and says when the code a page cites changed after the page was last checked.

v12d · STALE · SRC-CHANGED 3d

You approve, in the session

Rules and gotchas the agent drafts wait for you. Type /memcrumbs-review: the agent shows each line, and Claude Code's permission prompt asks you before the approval runs.

/memcrumbs-review

One current value per fact

Versions, ports and hosts live in one table, optionally read from the source file. check flags pages that still state an old value.

memcrumbs fact booking_version

Offers, never surprises

It suggests merges, missing pages, pages for questions the wiki could not answer and permission prompts for gotchas. Each applies only on your yes and undoes byte for byte.

suggest · suggest undo ID

Skills from work you repeat

Task flows and pipelines you run again and again, such as test, scan, commit, push, become skill offers. The header only shows a count; you decide when to look.

suggest --kind skill

Updates that check themselves

One command upgrades, re-indexes and refreshes the wiring, then checks that memcrumbs still starts. If pip broke it, the version you had is put back.

memcrumbs update

How a session goes

After memcrumbs init, every Claude Code session in the repo follows these five steps. The output below is real, from the invented sample project in the repository.

  1. The session starts with the header

    A SessionStart hook prints the rules, the map, the top gotchas and recent journal lines. The agent reads them before it reads any code.

    memcrumbs · Emberline Ceramics (bench) — 43 pages · index 449 docs
    Project knowledge: memcrumbs find "<words>" · …; an exact name: grep for it
  2. The agent asks the wiki

    Plain questions work: question words are dropped, a thesaurus bridges vocabulary and identifiers match by their parts.

    $ memcrumbs find "how do I roll back a bad deploy"
    [run ] Roll back booking app — …rollback-booking.md:1 · v8d
  3. It opens only what it needs

    One section of a page, or one function by its line range. Every cut output names the command that goes deeper.

    $ memcrumbs page rollback-booking
    $ memcrumbs sym start_firing --body
  4. It writes down what happened

    Decisions keep the options considered and the evidence. Incidents are keyed on the symptom the next person will see.

    $ memcrumbs decision "Move bookings to Postgres" \
        --status rejected --why "too much to run for our size"
  5. You approve what it wrote

    A rule the agent adds waits outside the header until you approve it, in the same session. Claude Code asks you before the approval runs.

    > /memcrumbs-review
    [24109529bc] rules.md: - Ask the owner before moving a booked firing to another kiln
    $ memcrumbs review --approve 24109529bc
    # Claude Code asks you first; you say yes
    reviewed 1 item(s)

Trust labels on every hit

An agent should know how far to trust what it reads. Each hit says so in a few characters.

v12d
The page was last verified 12 days ago.
STALE
Older than the project's freshness limit (45 days by default).
SRC-CHANGED 3d
A file the page cites changed 3 days ago, after the page was verified.
SUPERSEDED→page
Replaced by a newer page, and ranked below current ones.
REJECTED
A decision that was tried or considered and turned down. Kept, so nobody tries it again.
UNREVIEWED
Written by an agent and not yet checked by a person.

Measured, with the method

Numbers from the repository's own benchmarks. You can run every one of them yourself.

ResultWhat it measuresHow
0.75Share of questions answered in the top 3 on a public repository, before any wiki page is written encode/httpx at b5addb64: 32 held-out questions written by a separate agent, run once with scripts/day0.py (code questions: 0.90)
≈ 380Tokens per lookup answer on that repository Mean per find answer over the same 32 questions, estimated as characters ÷ 4
0.95Share of questions whose answer is in the top 3 hits (recall@3) 40 held-out questions, written by a separate agent that never saw the search engine, on the invented sample project
≈ 450Tokens per lookup answer Mean over 100 questions on the sample project, estimated as characters ÷ 4
5–10 sFull index of a 10,000-file repository scripts/perf.py --files 10000: 5 s on Linux CI, about 10 s on a Windows desktop
25–100 msOne find on that repository Median, in-process, across the same machines
3 × 3Operating systems × Python versions tested CI on Linux, macOS and Windows with Python 3.11, 3.12 and 3.13

httpx is a real public repository; its questions, results and the way to rerun them are in bench/httpx. The sample project is invented, so your numbers will differ. memcrumbs bench measures recall on your own questions; the setup guide shows how to write them.

Safe by default

  • Secrets stay out. Everything indexed, printed or written passes a redaction filter that fails closed. Values you block are stored only as a hash.
  • Credential files are never indexed. .env files, keys and credential files are excluded by default.
  • It writes only where it should. The project's wiki, its index folder and the files wire names. Any other write is refused.
  • A secret in the wiki shows up by itself. A daily check names the page in the session header, never the value.
  • Everything undoes. wire --remove and suggest undo restore files byte for byte.
  • Agents ask before risky commands. A gotcha like "never force-push" can become a permission prompt, on your yes.
  • Scan before you publish. memcrumbs scan checks a folder, an sdist or a wheel for secret-like values.
  • You approve, not the agent. Its rules and gotchas wait for you, and inside Claude Code the approval runs only through Claude Code's permission prompt.

Quick start

Two commands from install to a wired repository. init names the project after the repo, drafts the map from it, indexes the code and the repo's markdown, asks once before it wires Claude Code, and runs a health check. Later, memcrumbs update keeps it current. The setup guide covers each step by hand.

$ pip install memcrumbs
$ cd /code/myapp && memcrumbs init
# CLAUDE.md block, session header hook, two skills, approval prompts; undo with init --remove

Questions

What is memcrumbs?

memcrumbs is an open-source command-line tool that gives coding agents a project memory: a markdown wiki of rules, gotchas, runbooks, decisions and incidents, plus a local SQLite full-text index of the wiki, your docs and your code symbols. It is written in Python and uses only the standard library.

Does it send my code or notes anywhere?

No. memcrumbs makes no model calls and runs no background service. Its only network use is asking PyPI for the newest release, when you run memcrumbs update or, if you turn it on, once a day. Your wiki is plain markdown in a folder you choose, and the index is a local SQLite file.

Which coding agents does it work with?

Claude Code gets a CLAUDE.md block, a session-start hook, two skills and permission rules from memcrumbs init. Other agents can read an AGENTS.md block (wire --target agents), and any agent that can run shell commands can use the commands directly.

How do I approve what the agent writes?

Rules and gotchas an agent writes reach the session header only after you approve them. In Claude Code, type /memcrumbs-review: the agent shows each line in full, and Claude Code's own permission prompt asks you before the approval runs. In your own terminal, memcrumbs review --approve asks you to type a code.

Can it turn work I repeat into skills?

Yes, if you turn on transcripts (memcrumbs init asks). memcrumbs reads Claude Code's transcripts locally and finds task flows and pipelines you repeat: the same steps in the same order in 3 tasks on 2 days, or in 6 tasks. The session header shows a count; the agent lists the offers when you ask, and a skill is written only on your yes, without your commands' text.

How is it different from Claude Code's auto-memory?

Auto-memory is notes an agent keeps for itself. memcrumbs keeps a curated wiki with age and status on every answer, searched on demand instead of loaded in full. It can also offer to replace auto-memory notes the wiki already holds with a pointer to the page.

How useful is it on a repository with no wiki yet?

From the first session, find searches the repository's own docs and code symbols. On httpx, before any wiki page was written, the answer was in the top 3 for 75% of 32 questions written blind (90% of the code questions), at about 380 tokens per answer. Rules, gotchas and decisions you add make it better from there.

Does it use embeddings or a vector database?

No. Search is SQLite FTS5 with BM25 ranking, a small thesaurus, your own synonyms and identifier splitting. On the sample project's held-out questions, 95% of answers are in the top 3 hits.

Is it free?

Yes. memcrumbs is open source under the Apache-2.0 license.