Session Tools
Session tools for OpenCode v2: session metadata, history recall and Claude Code-style cross-session messaging
0
353
34.7
Multi-signal model
24 days ago
2026-09-26
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@kerneloops/opencode-session-tools@0.1.1"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@kerneloops/opencode-session-tools@0.1.1"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D @kerneloops/opencode-session-toolsOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
Session tools for OpenCode v2, as two local plugins:
opencode-metaopencode_meta: bounded, read-only session metadata (a session, its parent and children, message and tool statistics, recent sessions, tool usage).send_message: cross-session messaging, in the style of Claude Code's. One session sends plain text to another by ID or title; by default the target receives it at its next step boundary, marked as coming from a peer (not from its user, and never an approval), with the address to reply to.
opencode-recall-literecall/recall_get: search earlier sessions across projects, and read one back.- A short system reminder to search history before answering questions about it.
Both plugins use only OpenCode v2's public plugin API. They share a small session index, kept in plugin storage, which is built from session events.
Install
From npm, as one plugin: add it to the plugins list in your OpenCode v2 opencode.json, and OpenCode installs it:
{ "plugins": [{ "package": "@kerneloops/opencode-session-tools" }] }
Or, as two local plugins, copy both directories into your OpenCode v2 config directory's plugins/, for example ~/.config/opencode/plugins/:
cp -r plugins/opencode-meta plugins/opencode-recall-lite ~/.config/opencode/plugins/
OpenCode v2 loads every directory under plugins/. Keep the two side by side: opencode-meta imports the session index from ../opencode-recall-lite.
Optionally, allow the tools without a permission prompt in opencode.json:
{ "permission": { "opencode_meta": "allow", "send_message": "allow", "recall": "allow", "recall_get": "allow" } }
Limits
- The index only covers sessions seen since the plugins first ran. Plugins get live events, not history. Tools can still address any session directly by ID.
recallranks by term matches in titles and transcripts; it is not semantic search.send_messagefinds a session by title only among indexed sessions. An ambiguous title returns the candidates, so pass the ID.
See each plugin's README for details and options.
Tests
cd plugins/opencode-meta && bun test
cd plugins/opencode-recall-lite && bun test
Acknowledgements
opencode-recall-litebuilds on opencode-session-recall by maelos (MIT), which we used with OpenCode v1. It takes that plugin's idea, itsrecall/recall_gettool names and its[recall-nudge]system reminder, and reimplements a much smaller version on the v2 plugin API. It shares no code with it. For OpenCode v1, use the original: it is far more capable.send_messagefollows the design of Claude Code's cross-session messaging. See also opencode-agent-messaging, an implementation for OpenCode v1.
Licence
MIT
Similar plugins
Threads
@op1/threads
Opinionated background agents for OpenCode V2: visible worker sessions that report back with a verdict, and durable parallel workflows that survive restarts.
Rtk
opencode-rtk-plugin
OpenCode v2 plugin that rewrites shell commands through rtk to cut LLM token usage by 60-90%.
Memory
@bandonker/opencode-memory
Local-first long-term memory: store and BM25-recall fragments with SQLite FTS5. No embedding API, no cloud. Auto-injects relevant memories into each request within a hard character budget.