{"id":48952638,"url":"https://github.com/ngvoicu/opencode-claude-code-memory","last_synced_at":"2026-04-19T23:01:08.082Z","repository":{"id":351157066,"uuid":"1209783962","full_name":"ngvoicu/opencode-claude-code-memory","owner":"ngvoicu","description":"OpenCode plugin for Claude Code memory that shares local Claude Code memory with OpenCode and syncs updates back to the same files.","archived":false,"fork":false,"pushed_at":"2026-04-17T04:58:34.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-18T22:02:07.422Z","etag":null,"topics":["claude-code","claude-code-memory","claude-memory","developer-tools","opencode","opencode-plugin","persistent-memory","terminal-ai"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngvoicu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-13T19:23:57.000Z","updated_at":"2026-04-17T04:58:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"175fcdf6-77a0-4897-97d5-4520b6908c61","html_url":"https://github.com/ngvoicu/opencode-claude-code-memory","commit_stats":null,"previous_names":["ngvoicu/opencode-claude-code-memory"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ngvoicu/opencode-claude-code-memory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngvoicu%2Fopencode-claude-code-memory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngvoicu%2Fopencode-claude-code-memory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngvoicu%2Fopencode-claude-code-memory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngvoicu%2Fopencode-claude-code-memory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngvoicu","download_url":"https://codeload.github.com/ngvoicu/opencode-claude-code-memory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngvoicu%2Fopencode-claude-code-memory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32025784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","claude-code-memory","claude-memory","developer-tools","opencode","opencode-plugin","persistent-memory","terminal-ai"],"created_at":"2026-04-17T21:33:42.734Z","updated_at":"2026-04-19T23:01:08.058Z","avatar_url":"https://github.com/ngvoicu.png","language":"JavaScript","readme":"# OpenCode Claude Code Memory Plugin\n\nShare Claude Code memory with OpenCode.\n\n`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.\n\nIt lets OpenCode:\n\n- load Claude Code memory at the start of a session\n- search and read memory files through a `claude_memory` tool\n- write updates back into the same Claude memory directory\n- keep memory hints available during OpenCode compaction\n\nThis 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.\n\nIf you have searched for any of these, you are in the right place:\n\n- OpenCode Claude memory plugin\n- Claude Code memory in OpenCode\n- shared memory between Claude Code and OpenCode\n- OpenCode persistent memory with Claude Code\n\n## Why This Exists\n\nClaude Code already stores memory in a local per-project directory under `~/.claude/projects/.../memory`.\n\nOpenCode has a strong plugin API, but it does not natively read Claude Code memory. This plugin fills that gap with a local-only workflow:\n\n- no external database\n- no hosted memory service\n- no extra sync layer\n\nIf 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.\n\n## Features\n\n- One-time session memory injection for better efficiency than re-injecting memory on every prompt\n- Shared memory files between Claude Code and OpenCode\n- Claude-compatible canonical git-root and worktree resolution\n- Recursive topic-file loading, reading, and search\n- `claude_memory` tool with `list`, `read`, `search`, `add`, and `update`\n- Idle-session review that can save new learnings back into Claude memory\n- Turn-level memory suppression when you tell OpenCode to ignore memory\n- Toast notifications for memory load, review, and updates\n- Compaction context support so memory remains visible after long-session summarization\n- Safer file handling that keeps tool-driven writes inside the Claude memory directory\n\n## How It Works\n\n1. The plugin maps the current project or worktree to Claude Code's memory directory layout under `~/.claude/projects`.\n2. On the first message of a session, it injects memory context into OpenCode.\n3. The agent can later use the `claude_memory` tool to inspect or update memory files.\n4. If you say to ignore memory for a turn, the plugin suppresses its injected memory context for that request.\n5. If enabled, the plugin can ask OpenCode to review an idle session and write useful learnings back to Claude memory.\n\n## Installation\n\nTo install from npm, add the package name to OpenCode config.\n\nOpenCode installs npm plugins automatically at startup, so you do not need to run `npm install` yourself.\n\nIn `~/.config/opencode/opencode.json`:\n\n```json\n{\n  \"plugin\": [\n    \"opencode-claude-code-memory\"\n  ]\n}\n```\n\nRestart OpenCode after editing the config. On startup, OpenCode will install `opencode-claude-code-memory` automatically.\n\n### With Options\nIf you want to customize it:\n\n```json\n{\n  \"plugin\": [\n    [\n      \"opencode-claude-code-memory\",\n      {\n        \"injectMode\": \"once\",\n        \"initialLoadMode\": \"full\",\n        \"compactionMode\": \"index\",\n        \"autoReview\": true\n      }\n    ]\n  ]\n}\n```\n\n### Local Repo Instead Of npm\n\nIf you prefer a local checkout:\n\n```bash\ngit clone https://github.com/ngvoicu/opencode-claude-code-memory.git ~/Projects/ngvoicu/opencode-claude-code-memory\n```\n\nThen use:\n\n```json\n{\n  \"plugin\": [\n    [\n      \"file:///Users/your-user/Projects/ngvoicu/opencode-claude-code-memory\",\n      {\n        \"showLoadToast\": true,\n        \"showReviewToast\": true,\n        \"showUpdateToast\": true\n      }\n    ]\n  ]\n}\n```\n\n## Configuration\n\nAll plugin options are optional.\n\n| Option | Type | Default | Description |\n|---|---|---:|---|\n| `memoryRoot` | `string` | `~/.claude/projects` | Base Claude Code memory directory |\n| `injectMode` | `\"once\" \\| \"always\"` | `\"once\"` | Inject memory once per session or on every message |\n| `initialLoadMode` | `\"full\" \\| \"index\"` | `\"full\"` | Load full Claude memory or only `MEMORY.md` + topic list |\n| `compactionMode` | `\"none\" \\| \"index\" \\| \"full\"` | `\"index\"` | Extra memory context during OpenCode compaction |\n| `autoReview` | `boolean` | `true` | Review idle sessions and write useful learnings back to Claude memory |\n| `minMessagesForExtraction` | `number` | `4` | Minimum session message count before auto-review can run |\n| `minNewMessagesForReview` | `number` | `4` | Minimum new messages since the previous review |\n| `maxIndexLines` | `number` | `200` | Max lines from `MEMORY.md` in trimmed contexts |\n| `maxIndexBytes` | `number` | `25600` | Max bytes from `MEMORY.md` in trimmed contexts |\n| `showLoadToast` | `boolean` | `true` | Show a toast when memory is injected |\n| `showReviewToast` | `boolean` | `true` | Show a toast when auto-review starts |\n| `showUpdateToast` | `boolean` | `true` | Show a toast when memory files are updated |\n| `memoryUpdateToastDebounceMs` | `number` | `1500` | Debounce repeated update toasts |\n| `debug` | `boolean` | `false` | Log plugin errors to stderr |\n\n### Temporarily Ignore Memory\n\nIf you want a fresh-context answer for one turn, say something like:\n\n- `ignore memory for this`\n- `do not use memory`\n- `answer without memory`\n\nYou can also set `OPENCODE_MEMORY_IGNORE=1` to suppress injected memory context.\n\n### Recommended Local Config\n\nIf you want OpenCode to behave as close as possible to Claude Code memory while staying efficient:\n\n```json\n{\n  \"plugin\": [\n    [\n      \"file:///Users/your-user/Projects/ngvoicu/opencode-claude-code-memory\",\n      {\n        \"injectMode\": \"once\",\n        \"initialLoadMode\": \"full\",\n        \"compactionMode\": \"index\"\n      }\n    ]\n  ]\n}\n```\n\n## Tool Reference\n\nThe plugin exposes a `claude_memory` tool.\n\n### `list`\n\nLists the current memory directory, `MEMORY.md`, and topic files.\n\n### `read`\n\n- `read` with no file returns `MEMORY.md` plus all topic files\n- `read` with `file` returns the requested memory file\n\n### `search`\n\nKeyword search across `MEMORY.md` and topic files.\n\n### `add`\n\nAppends content to `MEMORY.md`.\n\n### `update`\n\nReplaces or creates a memory file inside the Claude memory directory.\n\n## SEO / Discoverability\n\nThis repository is intentionally optimized for people searching for:\n\n- OpenCode Claude memory plugin\n- Claude Code memory in OpenCode\n- OpenCode persistent memory with Claude Code\n- shared memory between Claude Code and OpenCode\n- Claude Code memory bridge for OpenCode\n- local persistent memory for OpenCode\n\nThe README, package metadata, and GitHub topics are all written around those use cases.\n\n## Security Notes\n\n- This plugin only works with local Claude memory files.\n- It does not send memory to a hosted service on its own.\n- `claude_memory update` is restricted to paths inside the resolved Claude memory directory.\n- Automatic session review is enabled by default and can be turned off with `autoReview: false`.\n\n## Comparison: `opencode-supermemory`\n\n[`opencode-supermemory`](https://github.com/supermemoryai/opencode-supermemory) is a different approach:\n\n- it uses Supermemory as an external memory service\n- it supports cross-project user memory and semantic retrieval\n- it is not tied to Claude Code's local memory file format\n\n`opencode-claude-code-memory` is intentionally narrower:\n\n- local-file based\n- Claude Code compatible\n- no extra memory backend required\n\nIf you specifically want OpenCode to reuse Claude Code's existing memory files, this plugin is the closer fit.\n\n## Development\n\n```bash\ncd ~/Projects/ngvoicu/opencode-claude-code-memory\nnpm install\nnpm run verify\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngvoicu%2Fopencode-claude-code-memory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngvoicu%2Fopencode-claude-code-memory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngvoicu%2Fopencode-claude-code-memory/lists"}