claude-mem
Captures what your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions so work carries over. Works with Claude Code and several other coding agents.
A memory layer that lets AI agents read and write an agent-owned second brain in an Obsidian vault. It works through MCP servers, lifecycle hooks and a command-line tool, and includes skills for recording preferences and setting up semantic search.
Claude Code
> /plugin marketplace add itechmeat/open-second-brain> /plugin install open-second-brain@open-second-brain
Codex
$ npx skills add itechmeat/open-second-brain -a codex
Cursor
$ npx skills add itechmeat/open-second-brain -a cursor
Gemini CLI
$ npx skills add itechmeat/open-second-brain -a gemini-cli
GitHub Copilot
$ copilot plugin marketplace add itechmeat/open-second-brain$ copilot plugin install open-second-brain@open-second-brain
OpenCode
$ npx skills add itechmeat/open-second-brain -a opencode
Windsurf
$ npx skills add itechmeat/open-second-brain -a windsurf
Open Second Brain is a program that runs on your machine and connects to the AI coding agents you use: Claude Code, Codex, Grok and others. It keeps the corrections, decisions and notes your agents save, turns corrections that repeat into rules, and lets later sessions, in the same agent or a different one, use those rules.
You correct an agent, and the next session makes the same mistake. You switch agents, and the new one knows nothing the old one learned. With Open Second Brain connected, an agent can save a correction through its tools, and every connected agent can read the rules that come out of saved corrections. Every record names the agent that wrote it. Once a day a background pass, called dream, makes a rule of a correction that keeps coming back. A rule stays while agents record that they applied it; it is retired when that record goes stale, when agents report it outdated, or when you reject it.
An example. You tell your agents a few times not to use internal abbreviations, and they save it each time:
Correction, saved three times: Expand internal abbreviations in user-facing copy.
After dream and recorded use: Confirmed rule: Expand internal abbreviations in user-facing copy.
On hosts with a session-start hook, such as Claude Code and Codex, each new session receives the confirmed rules; on other hosts the agent asks for them through a tool.
The rules are also written as plain Markdown pages into your vault's brain-view/ folder (or the folder view_target names): about-me.md with the confirmed rules, a page per week of history, decisions and topics.
Rewrite a rule on about-me.md and your wording becomes the rule; delete its line and the rule is retired. Your edit is stored the next time the pages are rendered, and it wins over anything an agent or a model recorded.
Paste this into the agent you want to connect:
Set up Open Second Brain for this agent. Follow the "Agent setup" procedure in
https://raw.githubusercontent.com/itechmeat/open-second-brain/main/llms.txt
If Bun or the open-second-brain package is missing, tell me the command and
install it after I agree. Ask me only the questions the procedure lists. Run
o2b setup without --apply, show me the plan, then stop and wait for my explicit
approval. Apply only the plan I approved, run the verification commands the
procedure names, report every step that did not pass, and tell me how to undo it.
With Bun 1.1 or later, install the package, then print the setup plan for your host (--no-vault instead of --vault if you do not use Obsidian):
bun add -g open-second-brain
o2b setup --target <host> --vault /path/to/vault --agent-name "<agent-name>" --timezone UTC
The second command writes nothing; add --apply to carry out the plan it printed. Every host, the remaining steps, verification and uninstall: install.md.
o2b command line, two MCP servers your agent host starts, lifecycle hooks on hosts that have them, and once a day a detached dream worker on the one machine that owns dream (install, dream). Dream starts by itself from an agent session, through a session-start hook or the MCP server; Pi, Aider and OpenClaw have neither, so on a machine with only those, run o2b dream run. Automatic dream is on by default; o2b brain settings set dream.auto false turns it off..open-second-brain-store/ folder, so the vault's own sync carries it to your other machines when that sync carries hidden folders (Obsidian Sync does not: then move the store to a folder another tool syncs, in the order brain store gives, before store_root is set), and note tools and search skip it. A 1.x brain kept in the vault's Brain/ folder is moved into the store on upgrade, and the Brain/ folder leaves the vault by itself once every machine has updated (updating); a store that 2.0.0 left outside the vault moves in when you run o2b store move-into-vault on that machine with its agent sessions closed, and an @osb marker you write in a note is annotated once it is captured (how it works).o2b uninstall --target <host> --apply removes what setup wrote for a host, and bun remove -g open-second-brain removes the package; your vault, notes and brain store are kept (uninstall).apb runs the agents; Open Second Brain gives those agents memory, so what the agents of one run recorded is there for the agents of the next. Each works without the other. Agentic Playbooks (apb) is a separate project.
The documentation index groups the documents by what you want to do: get started, connect an agent, understand how it works, operate, upgrade, contribute.
Upgrading from 1.x: docs/updating.md.
CHANGELOG · Security policy · Source on GitHub · MIT License
Captures what your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions so work carries over. Works with Claude Code and several other coding agents.
Gives Claude Code long-term memory through Hindsight. It recalls relevant past context before answering, retains durable facts as the agent learns them, and reflects over stored memory.
Local-first memory for Claude Code. It stores conversations verbatim in a private palace you can search before answering about past work, people, projects, or decisions, with optional shared-brain hub setup.
Gives Claude Code a private memory that stays on your machine. It stores past conversations word for word, so you can ask what was decided, what happened before, or who was involved and get the original context back. It can also hand tasks to other agents.
A memory layer that lets AI agents read and write an agent-owned second brain in an Obsidian vault. It works through MCP servers, lifecycle hooks and a command-line tool, and includes skills for recording preferences and setting up semantic search. Install it with the command on its page. It includes brain-memory, codegraph-partner, decision-model-setup. Its skills do not fire on their own yet. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it