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.
Local stats and memory for AI coding assistants
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
$ agent-brain stats # sessions, time and tokens per project $ agent-brain stats --sessions # per-session breakdown $ agent-brain status # integration health and collection activity
What it does
agent-brain is a local collector and memory store for your AI coding assistants. It works offline and keeps its database on your machine.
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.
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.
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
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.
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
No Go toolchain is needed. The installer downloads a prebuilt binary, checks its SHA-256 checksum, and then offers to set up your assistants.
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.
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.
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
The local tool, including personal memory, is free and needs no account. The cloud dashboard and team memory are optional.
agent-brain stats and agent-brain statusmemory_search, memory_save and session-start memory, after agent-brain memory enableagent-brain login, then agent-brain link <project-key>, then consentFAQ
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.
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.
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.
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.
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.
The repository is under the MIT License. See the LICENSE file.
More questions are answered in the docs.
What's new
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.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.agent-brain memory export --format json writes a file, and agent-brain memory import adds it to the same project on the other side.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.agent-brain memory enable turns memory on with no account or plan: one consent step, and memories stay on your machine.agent-brain status shows memory as off or active, without contacting the server.cd into a subfolder gave it a new handle that the memory tools then rejected.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.memory_token or refresh_token.agent-brain install to rewrite them; agent-brain status flags the old form.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.agent-brain memory list and the memory_list tool show the newest 50 memories and say how to get the next page.--limit N and --offset N to page; --limit 0 lists everything.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.agent-brain config link-offer on brings it back.agent-brain memory capture shows and changes this; --every 1 restores the old behaviour.