Local stats and memory for AI coding assistants

See what your AI assistants really cost, and let them remember

agent-brain runs on your machine. It records sessions, tokens and cost across your coding assistants, and gives them project memory they can search and save. Nothing leaves your machine unless you link a project and consent.

v0.5.12 What's new Updating

macOS and Linux

curl -fsSL https://agentbrain.wecansync.com/install.sh | sh

Windows PowerShell

irm https://agentbrain.wecansync.com/install.ps1 | iex
  • No Go needed. Runs on Linux, macOS and Windows, on amd64 or arm64.
  • Stats are free, local, offline, and need no account.

What it does

Usage you can see, and memory your assistants keep

agent-brain is a local collector and memory store for your AI coding assistants. It works offline and keeps its database on your machine.

Stats

Run agent-brain stats to see token usage and cost by day, project and model. Add --sessions for a per-session breakdown. Free, local and offline.

Memory

Assistants get memory_search and memory_save tools over MCP, plus project memory injected at session start. Entries are typed as decisions, conventions, task state or facts. Free, local, no account: turn it on with agent-brain memory enable.

Privacy

Everything is stored in a local SQLite database you own. Nothing leaves your machine unless you link a project and grant consent. The wire format has no fields for local paths, git remotes, project names, hostnames or message text, and a guard test enforces this.

Supported assistants

One install covers them all

agent-brain install detects the assistants on your machine and integrates each one. Existing settings are kept, and a timestamped backup is written first. To integrate only some, pass --assistant once per assistant.

  • Claude Code
  • Cursor
  • GitHub Copilot CLI
  • Gemini CLI
  • OpenCode
  • Codex CLI
Codex CLI

Codex needs its hooks trusted once. Open codex, run /hooks, and trust the agent-brain entries. Until you do, Codex records nothing and reports no error. agent-brain status shows the same reminder.

Quick start

Three steps

No Go toolchain is needed. The installer downloads a prebuilt binary, checks its SHA-256 checksum, and then offers to set up your assistants.

Install

Run the one-liner for your platform from the top of this page. Pin a version with AGENT_BRAIN_VERSION, or skip assistant setup with AGENT_BRAIN_NO_INTEGRATE=1.

Verify

Run agent-brain status. You get one line per assistant showing whether it is detected and integrated, plus the database location and the last captured event.

See your stats

Use any assistant as usual, then run agent-brain stats. Every session is captured automatically and attributed to its project, with no extra setup.

Free vs Pro

What is free, and what needs an account

The local tool, including personal memory, is free and needs no account. The cloud dashboard and team memory are optional.

Free

Local collection, stats and memory

  • Session capture for every supported assistant
  • agent-brain stats and agent-brain status
  • Personal memory: memory_search, memory_save and session-start memory, after agent-brain memory enable
  • Local, offline, no account
Pro

The optional cloud: dashboard and team memory

  • Team memory, shared through membership of a paying team's project
  • The cloud dashboard: agent-brain login, then agent-brain link <project-key>, then consent

FAQ

Questions

Does agent-brain read my code or my prompts?

No, and the protection is built into the code, not left to policy. What can sync, and only after you opt in, is numbers: timestamps, durations, token counts, model IDs and activity counts. The wire format has no fields for prompts, code, file contents, paths or repository names.

Do I need an account?

No. Collection, agent-brain stats, agent-brain status and personal memory are local and need no account. Team memory needs membership of a paying team's project, and the cloud dashboard is optional.

Does it slow my assistant down?

The capture path writes to a local SQLite database and has no network capability, so recording never waits on a server. Cloud sync runs in a separate background service.

How is memory captured?

agent-brain asks the assistant to save memory after 10 tool calls of work since the last save, with a mid-task checkpoint every 25 tool calls, and before the context is compacted. Run agent-brain memory capture to see the settings.

Can I stop it, or remove it?

Yes. agent-brain uninstall removes the assistant integrations and keeps your local data unless you pass --purge-data. Then delete the binary. See the uninstall steps.

Which license does it use?

The repository is under the MIT License. See the LICENSE file.

More questions are answered in the docs.

What's new

Latest release

v0.5.12 October 27, 2026

Clean up after one session without turning memory off.

  • agent-brain memory show ID shows which session saved an entry.
  • agent-brain memory list --session ID lists everything that session saved, and agent-brain memory delete --session ID removes it after showing you each entry.
  • The delete also brings back older entries the session had replaced, and every entry can be restored.

Version history

v0.5.11October 22, 2026Memory works from the first session, and you can browse it in Obsidian.
  • A new memory store starts in the current format, so session capture and summaries work straight away. agent-brain memory enable upgrades an existing one, after copying it to a backup file.
  • agent-brain memory export --format obsidian --out FOLDER writes your memories as linked notes. Open the folder in Obsidian to see them as a graph.
  • Updates and upgrades restart the background sync service, so it no longer keeps running the old version.
v0.5.10October 21, 2026Take a project's memories to another machine, or share them with a colleague.
  • agent-brain memory export --format json writes a file, and agent-brain memory import adds it to the same project on the other side.
  • The import shows what it will add and asks first. Entries already there are skipped, so importing twice adds nothing.
  • The file holds no sessions, transcripts or local paths. Imported entries start unverified and never retire an entry already on the machine.
v0.5.9October 21, 2026A security update.
  • Built with Go 1.26.10, which no longer trusts some compromised intermediate certificates (GO-2026-6809). agent-brain checks certificates when it updates itself and when it talks to the cloud server.
v0.5.8October 21, 2026Memory costs fewer tokens and stays current.
  • "Nothing to save" is one call, and the periodic memory request waits longer each time there was nothing to save.
  • An entry the assistant replaced is no longer injected next to its replacement, and task notes stop being injected after 30 days unless critical.
  • The injected memory is shorter: whole entries only, without routine labels.
  • agent-brain memory export writes your memories as Markdown.
  • memory_save accepts a memory_source_reference result as evidence, and every tool says whether it only reads.
v0.5.7October 20, 2026Personal memory is free.
  • agent-brain memory enable turns memory on with no account or plan: one consent step, and memories stay on your machine.
  • Team memory, sharing and the cloud dashboard still need a signed-in account.
  • agent-brain status shows memory as off or active, without contacting the server.
v0.5.6October 16, 2026Memory capture keeps working when the assistant changes folders.
  • A Claude Code session keeps one memory handle when its shell changes folder. Before, each cd into a subfolder gave it a new handle that the memory tools then rejected.
  • The end-of-reply memory request is not repeated while an earlier one is still unanswered, so an assistant that cannot act on it is no longer blocked at every reply.
  • memory_capture_defer can acknowledge a request that was never begun, and memory_capture_status returns a result Claude Code accepts.
  • usage_stats counts all of a session's tokens, including sessions an earlier version split by folder.
  • Saved memories hide credential keys with a prefix, such as memory_token or refresh_token.
v0.5.5October 15, 2026agent-brain works on Windows.
  • Claude Code hooks now run on Windows. They failed before, so no usage, sessions or memories were recorded. Run agent-brain install to rewrite them; agent-brain status flags the old form.
  • The store no longer fails to open with "database is locked" when several hooks start at once.
  • Saving settings on Windows retries briefly when another program has the file open, instead of failing with "Access is denied".
v0.5.4October 15, 2026Updates can come from a release site.
  • A build can update from a release site instead of the cloud server, using AGENT_BRAIN_UPDATE_URL. Downloads are still checked against the release checksum, and only https:// sites are used.
  • agent-brain update now says which site it checks.
v0.5.3October 15, 2026A clearer answer for empty filtered memory lists.
  • Listing memories with a priority or kind filter on a project with no memories now says there are none, instead of "no memories on this page".
v0.5.2October 15, 2026Memory lists are shown 50 at a time.
  • agent-brain memory list and the memory_list tool show the newest 50 memories and say how to get the next page.
  • Use --limit N and --offset N to page; --limit 0 lists everything.
v0.5.1October 15, 2026Token usage for Claude Code mods, and no cloud question at session start.
  • A new read-only usage_stats tool reports this machine's token usage for one session, today and this week. It works without memory and reads only local data.
  • The question about linking a project to agent-brain cloud is off by default. agent-brain config link-offer on brings it back.
v0.5.0October 14, 2026Memory V2: more reliable capture and better recall.
  • Memory capture is tracked per session, so saves are not duplicated and recover after a crash or retry. Existing memories are unchanged.
  • Search ranks memories by relevance and current decisions, and you can roll back to the earlier behaviour.
  • Opt-in upgrade: back up first, update every hook, MCP and daemon build, and restart your assistants. Do not go back to a pre-V2 build afterwards.
v0.4.0October 14, 2026First release of the open-source agent-brain CLI, with prebuilt binaries.
  • One-line installers for macOS, Linux and Windows PowerShell that need no Go toolchain and verify the download against its checksum.
  • The end-of-reply memory request now fires after 10 tool calls of work instead of after almost every reply. agent-brain memory capture shows and changes this; --every 1 restores the old behaviour.
  • Claude Code subagents no longer receive the mid-task memory checkpoint. The project is now under the MIT License.