Every Claude Code session starts from zero.

Yesterday Claude spent twenty minutes finding out why the billing tests fail on CI. Today it starts over. Last week you
told it the team moved from npm to pnpm. It does not know.

The usual fix is to keep adding notes to CLAUDE.md. That works for a while, then two things go wrong:

  1. You pay for every note in every session. CLAUDE.md is loaded in full at the start of each session, whether the note matters today or not.
  2. Notes go stale, silently. A file moves, a script is renamed, the package manager changes. The note stays, and Claude follows it.

Memory that is recalled, not preloaded

threadctx gives Claude Code a memory per repository. Instead of loading everything up front,
Claude saves a note when it learns something non-obvious (memory_write) and asks for the relevant notes before
similar work (memory_query). Notes cost nothing until they are needed.

Memory that is checked before use

A memory is an instruction your agent will follow later, so threadctx checks every note against the repository as it
is now, each time it is recalled:

The note says threadctx answers
"Retries live in src/billing/retry.ts" (file has moved) may be stale: the file no longer exists
"Run npm install first" (lockfile is pnpm) conflicts with the repository
"Use the key sk_live_…" refused when written, withheld when read
A workaround from four months ago flagged for review; expired notes are hidden

It checks what a repository can prove: files, scripts, commands, package manager, runtime versions and secrets.
Claims about outside systems cannot be verified, and the answer says so.

One command

npx threadctx setup 

That installs the Claude Code plugin. Open a new session and the first reply starts with one line:

threadctx · context B (81/100) · 2,140 tokens/session, 600 duplicated → /context-check · 3 memories in use 

Your grade, what your instruction files cost every session (and how much of that is duplicated), and how many memories
are healthy. Then you just work.

  • /memory-review shows what Claude remembers and fixes what went stale.
  • /context-check grades your CLAUDE.md, AGENTS.md, Cursor and Copilot instructions.
  • Team notes go to .threadctx/memory.json, shared through git and reviewed in pull requests. npx threadctx memory check --team fails CI when they drift from the code.

Everything runs on your machine: no account, nothing uploaded, Apache-2.0. Cursor, Copilot and Gemini CLI can use the
same memory through MCP (npx -y threadctx mcp).

Why this matters more than it looks

Research on repository context files found that generic, bloated context raises cost without raising task success
(arXiv 2602.11988), and a lean AGENTS.md cut median runtime by 28.64%
(arXiv 2601.20404). Memory should make context smaller and more accurate, not
bigger. That is the whole idea: remember what matters, recall it only when it is relevant, and drop what is no longer
true.

Try it on a repository you work in today:

npx threadctx setup 

More: https://threadctx.dev/guides/claude-code-memory?ref=devto