opencode-session-log
v0.1.8
Published
OpenCode plugin that writes human-readable and detailed session logs under .agents-log
Maintainers
Readme
opencode-session-log
opencode-session-log is an OpenCode plugin that writes session artifacts to ./.agents-log with a structure aligned to the Claude-side session logger.
It generates:
.agents-log/
├── summary/<yyyy-mm-dd_hh-mm-ss>/
│ ├── summary.md
│ ├── usage.json
│ └── agents/
│ ├── main/
│ │ ├── summary.md
│ │ └── usage.json
│ └── <agentKey>/
│ ├── summary.md
│ └── usage.json
└── meta/
├── index.md
├── state/<session_id>.json
└── sessions/YYYY/MM/<session_id>/
├── index.md
├── merged/session.md
├── agents/<agentKey>/session.md
└── artifacts/Install
Add the npm package name to your OpenCode config:
{
"plugin": ["opencode-session-log"]
}OpenCode installs npm plugins automatically on startup.
Project-level config:
.opencode/opencode.json
Global config:
~/.config/opencode/opencode.json
Automated npm Publishing
This repo is configured to publish from GitHub Actions. You do not need your own server.
The publish workflow runs when you push a tag like:
git tag v0.1.7
git push origin v0.1.7Before the publish step, GitHub Actions will:
- install dependencies
- run
npm test - verify that the tag version matches
package.json
One-time GitHub setup
Add this repository secret:
NPM_TOKEN
The token should be an npm publish token with permission to publish this package. If your npm account enforces 2FA for publishing, use a token that supports publish without interactive OTP.
Release flow
- Update
package.jsonversion - Commit and push
main - Create and push a matching tag:
git tag v0.1.7
git push origin main --tagsGitHub Actions will publish that exact version to npm.
What It Captures
- Session-level summary and usage
- Per-agent summaries for
mainand child sessions - Merged detailed timeline
- Per-agent detailed logs
- Tool calls, tool results, reasoning, assistant output
- Session state and rendered sidecar artifacts
Output Root
The plugin always writes into:
./.agents-logThis keeps OpenCode logs separate from Claude-side .claude-log output.
Notes
- Child sessions are emitted as separate agent directories.
- When the live SDK snapshot is incomplete, the plugin falls back to the local OpenCode SQLite database to keep output stable.
- The session root
summary.mdis an overview page; full detail lives underagents/*andmeta/.../merged/session.md.
Development
npm test