Persistent memory for Claude Code and OpenCode - knowledge + session storage
Find a file
2026-06-10 20:36:19 +05:00
.opencode Production check fixes 2026-04-16 19:53:59 +05:00
tests OpenCode version created 2026-04-16 18:56:56 +05:00
.gitignore OpenCode version created 2026-04-16 18:56:56 +05:00
AGENTS.md Memory saving protocol updated 2026-04-20 23:42:03 +05:00
CHANGELOG.md Initial copy from model_memory 2026-04-16 18:21:34 +05:00
LICENSE Initial copy from model_memory 2026-04-16 18:21:34 +05:00
pyproject.toml OpenCode version created 2026-04-16 18:56:56 +05:00
README.md Fix Quick Start: add explicit AGENTS.md copy command 2026-06-10 20:36:19 +05:00

Model Memory

Persistent memory for OpenCode. Two tiers — knowledge (permanent facts) + session (current task state) — stored as plain Markdown files.

Why use it

LLMs forget everything between sessions and after context compaction. This gives them a memory that survives.

  • Knowledge — architecture decisions, gotchas, patterns, configs. Write once, recall forever. No rediscovering the same PostgreSQL connection string or Docker incantation.
  • Session — task plans, todos, progress, blockers. Survives context compaction. Work resumes where it left off.
  • Isolation — multiple sessions or agents work in parallel without conflicting.

Quick Start

git clone https://github.com/itohnobue/model-memory-opencode
cp -R model-memory-opencode/.opencode /path/to/your/project/
cp model-memory-opencode/AGENTS.md /path/to/your/project/

If you already have an AGENTS.md, append this one instead of overwriting. This teaches OpenCode how and when to use the memory system.

Commands

.opencode/tools/memory.sh add gotcha "psycopg2 needs libpq-dev" --tags postgres,ubuntu
.opencode/tools/memory.sh search "postgres connection"
.opencode/tools/memory.sh session add todo "Implement auth middleware" --status pending
.opencode/tools/memory.sh session show

18 commands total (6 knowledge, 12 session). See AGENTS.md for full usage.

License

MIT