Standalone OpenCode plugin that ports the patch-memory fork patch into an external plugin.
- Registers a
memorytool via the OpenCode plugintoolhook - Injects memory context into the system prompt via
experimental.chat.system.transform
| Path | Scope | Location |
|---|---|---|
/memories/ |
User | $OPENCODE_CONFIG_DIR/memories/ |
/memories/session/ |
Session | $OPENCODE_CONFIG_DIR/memories/session/<sessionID>/ |
/memories/repo/ |
Repo | <project>/.opencode/memories/ |
| Command | Description |
|---|---|
view |
List directory or read file (with optional line range) |
create |
Create a new file (fails if exists) |
str_replace |
Replace exact string (must be unique in file) |
insert |
Insert text at a line number |
delete |
Delete file or directory |
rename |
Move/rename within same scope |
{
"plugin": ["opencode-memory"]
}If you don't want to install with npm, use file:// paths. Add to opencode.json:
{
"plugin": ["file:///path/to/opencode-memory/index.ts"]
}This plugin replaces the registry.ts and prompt.ts patches from patch-memory.ts.
The memory.ts and memory.txt file creation in the patch script is kept for now
as a compatibility shim, but tool registration and system prompt injection are
handled entirely by this plugin.