Persistent memory for Claude Code and OpenCode - knowledge + session storage
| .opencode | ||
| tests | ||
| .gitignore | ||
| AGENTS.md | ||
| CHANGELOG.md | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
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