Reusable memory workflow for OpenCode projects.
This repo gives you two things:
- global OpenCode commands and agents for durable memory
- a lightweight bootstrap you can apply to any new repo
The goal is simple:
- keep long-term project context inside each project repo
- keep global OpenCode setup small and reusable
- avoid saturating model context with old session noise
/remember-feature <slug>/recall-feature <query>/review-memory <scope>memory-curatorsubagentmemory-recallsubagent
These are reusable across projects.
AGENTS.mddocs/ai-memory/INDEX.mddocs/ai-memory/decisions.mddocs/ai-memory/troubleshooting.mddocs/ai-memory/features/README.md
This is the durable memory that lives in the project and should be committed to Git.
agents/ Global OpenCode agents
commands/ Global OpenCode commands
templates/project/ Files copied into each target repo
scripts/ Install and bootstrap scripts
Use the default OpenCode directories. Do not override OPENCODE_CONFIG_DIR for normal usage.
- Install the kit once.
- Bootstrap each new repo once.
- Use
/remember-feature,/recall-feature, and/review-memoryduring normal work.
PowerShell install:
powershell -ExecutionPolicy Bypass -Command "iwr https://raw.githubusercontent.com/alejodevelop/opencode-memory-kit/main/install.ps1 -UseBasicParsing | iex"Bootstrap the current repo:
powershell -ExecutionPolicy Bypass -File "$HOME\.config\opencode\opencode-memory-kit\scripts\bootstrap-project.ps1" -Target .Typical usage:
/remember-feature auth-flow
/recall-feature auth
/review-memory auth
That is the core flow. Use /review-memory after large refactors, removals, or cleanup passes.
No clone is required.
PowerShell:
powershell -ExecutionPolicy Bypass -Command "iwr https://raw.githubusercontent.com/alejodevelop/opencode-memory-kit/main/install.ps1 -UseBasicParsing | iex"Unix shell:
curl -fsSL https://raw.githubusercontent.com/alejodevelop/opencode-memory-kit/main/install.sh | shThis installs into the default OpenCode locations:
~/.config/opencode/agents/~/.config/opencode/commands/~/.config/opencode/opencode-memory-kit/
You can rerun the same command later to update the installed kit.
After you create a new frontend or backend repo, seed the local memory files.
PowerShell:
powershell -ExecutionPolicy Bypass -File "$HOME\.config\opencode\opencode-memory-kit\scripts\bootstrap-project.ps1" -Target .Unix shell:
sh "$HOME/.config/opencode/opencode-memory-kit/scripts/bootstrap-project.sh" .If the target repo already has an AGENTS.md, the bootstrap script does not replace it.
Instead, it appends a marked memory block:
<!-- opencode-memory-kit:start --><!-- opencode-memory-kit:end -->
This avoids clobbering existing project rules.
- Bootstrap the repo once.
- Work normally with
planandbuild. - When a feature is accepted, run
/remember-feature <slug>. - In later sessions, run
/recall-feature <query>. - After large refactors, removals, or cleanup passes, run
/review-memory [scope].
Examples:
/remember-feature auth-flow
/remember-feature billing-webhook
/recall-feature auth
/recall-feature "TypeError fetch failed"
/review-memory auth
/review-memory "remove legacy billing"
docs/ai-memory/is the active memory tree for the current truth of the repo./remember-featureauto-refreshes related notes when the latest change makes older details stale./review-memoryis the broader cleanup pass for refactors, removals, and accumulated drift.- High-confidence rewrites and trims can be applied automatically.
- Deletions require a brief review before anything is removed from the active memory tree.
- Git history is the archive for old context; obsolete notes should not stay in
docs/ai-memory/.
- Global commands and agents are reusable.
- Project memory stays local to each repo.
- Memory is lazy-loaded through
AGENTS.mdanddocs/ai-memory/INDEX.md. - The stored notes are short, searchable, and Git-tracked.
- The active memory tree stays focused on current truth, while Git preserves history.
docs/ai-memory/is intentionally not injected into OpenCode global instructions.- If you run
/remember-feature,/recall-feature, or/review-memoryin a repo that has not been bootstrapped yet, the command will tell you what is missing. - Use
--forcewith the bootstrap scripts only when you want to overwrite existing template files underdocs/ai-memory/.
If you are developing this kit locally, you can still install it from the checked-out repo.
PowerShell:
powershell -ExecutionPolicy Bypass -File .\scripts\install-global.ps1Unix shell:
sh ./scripts/install-global.shThis is useful for development and testing the kit itself, but it is not the recommended day-to-day setup.