Registry Mirror
Skip to content

Latest commit

 

History

533 Commits

Folders and files

Repository files navigation

OpenCode Codex Memory

Latest npm version npm downloads GitHub stars

Persistent memory for OpenCode. Your agent learns from past sessions — your conventions, your projects, the decisions you made — and brings useful context into new conversations automatically.

No Codex subscription or OpenAI account required. This plugin ports the memory system from OpenAI's Codex and uses the models you already have in OpenCode. Memory is stored locally as Markdown files and a small SQLite database. Background learning makes additional calls through your configured model providers; there is no separate memory service or MCP server.

Install

The plugin works with its default settings; no extra memory configuration is needed.

1. Add the plugin for your OpenCode version

Run opencode --version if you are unsure which version you use. If your 2.x executable is named opencode2, use that name in the commands below. Add the entry to your existing global ~/.config/opencode/opencode.jsonc or opencode.json (under $XDG_CONFIG_HOME/opencode if set). Keep your other settings and plugins.

OpenCode 2.x (2.4.4 or newer)

This release uses host session metadata, VCS branch hints, and provider service-tier options, so OpenCode 2.4.4 is the minimum supported host.

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": [{ "package": "opencode-codex-memory@0.14.0" }],
}

OpenCode 1.x (1.18 or newer)

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-codex-memory@0.14.0"]
}

The examples pin a specific npm release. On current OpenCode 2, use opencode-codex-memory@latest instead if you want automatic plugin updates.

2. Check that memory is available

On OpenCode 2, saving the config reloads it. On OpenCode 1.x, restart the process that runs OpenCode, including the server if you connect through an IDE. See apply and verify changes if the plugin doesn't appear.

Start a conversation and ask “Check my memory status.” The agent can run memory_inspect to show progress and any warnings. /memory-inspect opens your memory library in the OpenCode 2 terminal UI and in OpenCode Desktop 2.4.2 or later. Find a saved note or revisit a conversation recap. Memory V1 includes a handbook and learned skills; Memory V2 keeps learned guidance in its summary. The current conversation’s learning switch stays in reach; diagnostics live in Activity. Both memory versions work on both supported OpenCode generations.

Desktop · Memory V1

OpenCode Desktop Memory library beside a CSV export conversation, showing its learning switch, saved notes, learned skills and session recaps.

Terminal · Memory V2

OpenCode terminal Memory library showing a CSV export summary, saved note and session recap, with keyboard shortcuts for search and conversation learning.

Try it

Use OpenCode normally. By default, a session becomes eligible for learning after 6 hours of inactivity, and consolidation combines learned material into memory. The work runs in the background while OpenCode is running; an empty memory immediately after installation is normal.

To try memory immediately, open Library → New note on OpenCode 2 or ask “Remember that I deploy this project with make release.” The note is searchable as soon as it is saved. The summary changes on a later consolidation.

In a later conversation, try:

  • “What do you know about how I work?”
  • “What was I working on in this repo last week?”

Memory is global across projects. Project-specific details carry context about where they came from, while general preferences can follow you into a new repo. Files live under ~/.local/share/opencode/ by default. See Storage and privacy for the layout, model-call privacy, backups, and relocation.

Start here

I want to… Read
Recall past work, save a note, or pause learning Using memory
Choose or switch memory behavior Memory V1 and Memory V2
Set models, learning frequency, or other options Configuration
Find, back up, move, or reset my data Storage and privacy
Share with Codex CLI or import Claude Code memories Integrations
Fix missing memory or check an update Troubleshooting

Learn more and contribute

License

Apache 2.0 — the same license as OpenAI Codex, whose memory system this project ports. See LICENSE and NOTICE. Not affiliated with the Codex project.

About

Port of the codex memory patterns to opencode, Purely opencode, no dependency on codex.

Resources

Contributing

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages