@everme/opencode
v0.7.10
Published
EverMe long-term memory for OpenCode and Kilo Code: profile and recall injection and automatic turn capture, as an in-process plugin.
Readme
@everme/opencode
EverMe long-term memory for OpenCode and Kilo Code CLI, as an in-process plugin.
Kilo Code CLI is an OpenCode fork. Its plugin API and config schema are the same, so one bundle serves both hosts.
What it does
| Host hook | What the plugin does |
|---|---|
| experimental.chat.system.transform | Adds the durable Profile block to the system prompt. The plugin fetches the profile once per session. |
| chat.message | Fetches recall for the user's text and adds it to the message as a synthetic text part with <everme_recall>. |
| event: session.idle (or session.status idle) | Reads the session through the host's SDK client and uploads the turns that are not uploaded yet. |
The plugin skips child sessions, which the host creates for subagents.
Install
evercli plugin install opencode # or: evercli plugin install kilocodeThe install does these steps:
- It stages this bundle at
<config-dir>/everme/. - It writes credentials to
<config-dir>/everme.envwith mode0600. - It adds this element to the
pluginarray of the host's global config:["<config-dir>/everme", {"envFile": "<config-dir>/everme.env", "platform": "opencode"}] - It keeps the read-only
mcp.everme-memoryentry, so the model can also callmem_searchandmem_contextas tools.
<config-dir> is ~/.config/opencode for OpenCode and ~/.config/kilo for
Kilo Code. The config file is opencode.json or kilo.json.
Restart the host after install. The host loads plugins only at startup.
How a turn is read
When the session becomes idle, the plugin calls
client.session.messages({ path: { id } }) and maps the result:
- User text parts become the user message. Synthetic and ignored parts are skipped, so our own recall part is never uploaded.
- Assistant text parts become assistant messages, in source order.
- A tool part becomes an assistant tool call (
callID,tool,state.input) and a tool result (state.output, orstate.errorfor a failed call). - Reasoning, step, file, patch and compaction parts are skipped.
The plugin waits while the newest assistant message has no time.completed
or a tool call is still pending or running.
A per-session checkpoint stores the native ids that were uploaded, so a repeated idle uploads nothing. The first time the plugin sees a session, it uploads only the newest turn and records the earlier history as the excluded baseline. A rejected upload is not committed, so the next idle retries it. An upload that only timed out is committed, because the gateway stores the messages before it answers.
Configuration
The plugin reads credentials from the file in this order:
EVERME_ENV_FILE_PATH.- The
envFileoption of thepluginconfig entry. ~/.config/opencode/everme.env.
EVERME_STATE_DIR moves the checkpoint directory. The plugin never writes the
token into process.env, because the host passes that environment to every
tool and shell command.
Without credentials the plugin does nothing.
Uninstall
evercli plugin uninstall opencode # or kilocodeTo uninstall manually, do these steps:
- In the host's config file, remove the
pluginelement whose path is<config-dir>/evermeand themcp["everme-memory"]entry. - Run
rm -rf <config-dir>/everme <config-dir>/everme.env. - Restart the host.
Tests
npm test --workspace @everme/opencodeLicense
Apache-2.0
