Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
OpenCode plugin for Claude Code memory that shares local Claude Code memory with OpenCode and syncs updates back to the same files.
Jump to setup instructionsFetched from the repository for this visit.
Share Claude Code memory with OpenCode.
opencode-claude-code-memory is an OpenCode plugin for Claude Code memory. It loads local Claude Code memory into OpenCode sessions, lets OpenCode read and update the same files, and keeps that shared memory available across longer OpenCode conversations.
It lets OpenCode:
claude_memory toolThis plugin is useful if you already rely on Claude Code auto-memory and want OpenCode to work with the same project memory instead of building a separate memory store.
If you have searched for any of these, you are in the right place:
Claude Code already stores memory in a local per-project directory under ~/.claude/projects/.../memory.
OpenCode has a strong plugin API, but it does not natively read Claude Code memory. This plugin fills that gap with a local-only workflow:
If the Claude memory directory is missing for a project, the plugin stays quiet until there is memory to load, but the tool and review flows can still create the shared memory directory when needed.
claude_memory tool with list, read, search, add, and update~/.claude/projects.claude_memory tool to inspect or update memory files.To install from npm, add the package name to OpenCode config.
OpenCode installs npm plugins automatically at startup, so you do not need to run npm install yourself.
In ~/.config/opencode/opencode.json:
{
"plugin": [
"opencode-claude-code-memory"
]
}
Restart OpenCode after editing the config. On startup, OpenCode will install opencode-claude-code-memory automatically.
If you want to customize it:
{
"plugin": [
[
"opencode-claude-code-memory",
{
"injectMode": "once",
"initialLoadMode": "full",
"compactionMode": "index",
"autoReview": true
}
]
]
}
If you prefer a local checkout:
git clone https://github.com/ngvoicu/opencode-claude-code-memory.git ~/Projects/ngvoicu/opencode-claude-code-memory
Then use:
{
"plugin": [
[
"file:///Users/your-user/Projects/ngvoicu/opencode-claude-code-memory",
{
"showLoadToast": true,
"showReviewToast": true,
"showUpdateToast": true
}
]
]
}
All plugin options are optional.
| Option | Type | Default | Description |
|---|---|---|---|
memoryRoot | string | ~/.claude/projects | Base Claude Code memory directory |
injectMode | "once" | "always" | "once" | Inject memory once per session or on every message |
initialLoadMode | "full" | "index" | "full" | Load full Claude memory or only MEMORY.md + topic list |
compactionMode | "none" | "index" | "full" | "index" | Extra memory context during OpenCode compaction |
autoReview | boolean | true | Review idle sessions and write useful learnings back to Claude memory |
minMessagesForExtraction | number | 4 | Minimum session message count before auto-review can run |
minNewMessagesForReview | number | 4 | Minimum new messages since the previous review |
maxIndexLines | number | 200 | Max lines from MEMORY.md in trimmed contexts |
maxIndexBytes | number | 25600 | Max bytes from MEMORY.md in trimmed contexts |
showLoadToast | boolean | true | Show a toast when memory is injected |
showReviewToast | boolean | true | Show a toast when auto-review starts |
showUpdateToast | boolean | true | Show a toast when memory files are updated |
memoryUpdateToastDebounceMs | number | 1500 | Debounce repeated update toasts |
debug | boolean | false | Log plugin errors to stderr |
If you want a fresh-context answer for one turn, say something like:
ignore memory for thisdo not use memoryanswer without memoryYou can also set OPENCODE_MEMORY_IGNORE=1 to suppress injected memory context.
If you want OpenCode to behave as close as possible to Claude Code memory while staying efficient:
{
"plugin": [
[
"file:///Users/your-user/Projects/ngvoicu/opencode-claude-code-memory",
{
"injectMode": "once",
"initialLoadMode": "full",
"compactionMode": "index"
}
]
]
}
The plugin exposes a claude_memory tool.
listLists the current memory directory, MEMORY.md, and topic files.
readread with no file returns MEMORY.md plus all topic filesread with file returns the requested memory filesearchKeyword search across MEMORY.md and topic files.
addAppends content to MEMORY.md.
updateReplaces or creates a memory file inside the Claude memory directory.
This repository is intentionally optimized for people searching for:
The README, package metadata, and GitHub topics are all written around those use cases.
claude_memory update is restricted to paths inside the resolved Claude memory directory.autoReview: false.opencode-supermemoryopencode-supermemory is a different approach:
opencode-claude-code-memory is intentionally narrower:
If you specifically want OpenCode to reuse Claude Code's existing memory files, this plugin is the closer fit.
cd ~/Projects/ngvoicu/opencode-claude-code-memory
npm install
npm run verify
MIT
GitHub checked 183h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.