How crag works.

crag is a small program on your machine. It gives every coding agent you use the same memory.

Setup is one command.

Run the install command. crag finds the agents on your machine, like Claude Code, Codex, Cursor and Gemini CLI, and connects each one. There is nothing to configure.

It keeps what happened.

While you work, crag keeps what each session did. Your messages, the agent’s replies, the commands it ran and the files it opened. All of it goes into one file on your machine, word for word.
09:41you“the retries are hammering Stripe. back off from 30 s, and push the launch to Dec 9”
09:42openedsrc/billing/webhooks.ts
09:44rangit commit -m "retry webhooks with backoff"
09:44agent“Done. Retries back off from 30 s. I saved the launch change.”

The agent writes down decisions.

When something is decided, the agent saves a short note, like “Launch moved to Dec 9”. Each note has a topic. A newer note on the same topic becomes the current one, and the old one stays visible with its date. The agent can also link the note to the decisions it rests on, so the next agent can follow those links.
save
headline Launch moved to Dec 9
subject launch.datethe topic
story Support can’t staff a Friday launch, so it moves to Dec 9.
refs replaces #790, builds on #774links the agent records

It hands back what matters.

In supported agents, crag adds the few notes that matter before the agent reads your next message, and the notes about a file come with it when the agent opens that file. Each note brings its links, so the agent sees what it replaced and what it rests on. This takes about a third of a second. Other agents search the memory when they need it.
<crag-memory checked="2026-12-05 09:14">
#812 billing, 2026-12-04: Launch moved to Dec 9
“Support can’t staff a Friday launch, so it moves to Dec 9.”
replaces #790 (2026-12-01), which said: “Launch on Dec 4”the old value, with its date
builds on #774 (2026-11-28), which says: “Support is off on Fridays”a decision it rests on
git since saved: src/billing/webhooks.ts changed in 2 commitsthe code moved on
</crag-memory>

Questions

Where does my data go?
The memory database is stored locally, as one file. The notes crag hands an agent go into that agent’s conversation, like anything you type. By default, crag also sends counts of how it is running: hook speed, errors, notes delivered. Never prompts, notes or code. Turn it off with crag telemetry off.
Does it slow my agent down?
By about a third of a second per message. Remembering makes no AI calls, so it costs nothing.
How do I remove it?
Run crag uninstall. It disconnects every agent and keeps your memory file, in case you come back.

Try it on your next session.

The program
~/.crag/bin

Checked against its published SHA-256 and added to your PATH.

The memory
~/.crag/engine.db

One SQLite file. The memory database is stored locally.

Your agents
each agent’s user config

crag adds its hooks and its MCP server to every agent it finds.

A background service
127.0.0.1:8786

Starts when you log in. No administrator rights needed.

Improvement data
counts only

By default, crag sends counts of how it runs: hook speed, errors, notes delivered. Never prompts, notes or code. Turn it off with crag telemetry off.

Undo
crag uninstall

Removes the hooks and the service. Your memory file stays.

Read install.sh and install.ps1 before you run them. See what each agent gets.