A JSONL session event logger plugin for OpenCode. Logs chat messages and tool executions as structured JSONL files, organized by session.
Inspired by opencode-plugin-simple-memory by Kris Nicolov.
-
Add the plugin to your OpenCode config:
{ "$schema": "https://opencode.ai/config.json", "plugin": ["@frankhommers/opencode-plugin-logger"] } -
Enable logging via the
logger_settool or configuration file.
The plugin supports its own config files:
- Global defaults:
~/.config/opencode/logger.json - Per-project override:
.opencode/logger.json
Project config overrides global config.
Example:
{
"logger": {
"enabled": true,
"scopes": [],
"dir": "${project}/.agent-session-logs"
}
}Supported placeholders:
${home}${project}(workspace/project root)${workspace}(alias of${project})${date}${env:VAR_NAME}
| Tool | Description |
|---|---|
logger_set |
Enable/disable logger and set scope filters |
logger_status |
Show active logger configuration |
Logs are organized by session:
.agent-session-logs/
2026-03-20-fix-auth-bug/
main.jsonl # Main session events
explore-ses_abc.jsonl # Subagent events
codex-ses_def.jsonl # Another subagent
Each line is a JSON object with fields like:
{
"ts": "2026-03-20T10:00:00.000Z",
"event": "chat_message",
"session_id": "ses_main",
"parent_session_id": null,
"root_session_id": "ses_main",
"agent": "main",
"message_id": "msg_1",
"model": { "providerID": "anthropic", "modelID": "claude-opus-4" }
}chat_message— Chat messages with model info and partstool_execute_before— Tool call with args (before execution)tool_execute_after— Tool result with output (after execution)
git clone https://github.com/frankhommers/opencode-plugin-logger.git
cd opencode-plugin-logger
bun installPoint your OpenCode config to the local checkout:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["file:///absolute/path/to/opencode-plugin-logger"]
}