MemtraceDOCS

memtrace claude

Write a Memtrace routing directive into a project CLAUDE.md so Claude Code reaches for Memtrace before Grep in that repository, and remove it again cleanly.

Usage#

memtrace claude <install|uninstall> [directory]

Writes a managed block into the project's own CLAUDE.md, telling Claude Code to use Memtrace for code discovery before Grep / Glob / Read, and to check blast radius and recorded decisions before editing existing code. Defaults to the current directory.

Install into this repository
memtrace claude install
Remove it again
memtrace claude uninstall

The file is created if it does not exist. Running install again refreshes the block in place rather than appending a second one, so it is safe in a provisioning script.

Why a project file#

Claude Code loads CLAUDE.md unconditionally at the start of every session in that directory. A directive there survives context compaction and does not depend on a skill being matched or re-invoked — which is the difference between “use Memtrace first” holding for a whole session and holding until the guidance scrolls out of context.

Because it is a file in the repository, it can be committed, so a team shares one routing rule instead of each person configuring their own machine.

Project scope vs machine scope#

memtrace installmemtrace claude install
ScopeThis machine, every projectOne repository
Writes~/.claude/MEMTRACE.md, a breadcrumb in ~/.claude/CLAUDE.md, hooks in ~/.claude/settings.json./CLAUDE.md
Creates the file if absentNo — breadcrumb only if it existsYes
CommittableNoYes
Removed bymemtrace uninstallmemtrace claude uninstall

They are complementary. The machine-level install also registers Claude Code hooks; this command only writes the project directive and touches nothing global.

What it does to your file#

The block is delimited by HTML comment markers and Memtrace owns exactly the bytes between them, plus one trailing newline. Everything you wrote stays byte-identical, and uninstall is an exact inverse of install: removing the block returns the file to what it was before. If the file held nothing but the block, uninstall deletes it.

NOTE

The one normalisation: a file that does not end in a newline gains one, so the block starts on its own line. That newline then belongs to your content and survives removal.

A file containing a start marker with no matching end marker is refused rather than guessed at — repair or delete the partial block and retry.

This is deliberately a command you run, not something memtrace install does on your behalf, so nothing writes into a repository without being asked.