opencode_sessions
List and filter opencode sessions across all projects by state, agent, directory, or title to see active runs, outcomes, and stale sessions.
Instructions
READ-ONLY. List opencode sessions of the background service across all projects (newest first): id, state (running / succeeded / failed / interrupted / stale?), agent, age, tokens, directory, title. Use state=running to see what is active now; a session whose last update is older than ~45 min and has no outcome is shown as "stale?".
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "opencode_sessions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | only this agent, e.g. deep-research | |
| limit | No | max rows (default 25, max 200) | |
| state | No | running (default: all) | active | finished | succeeded | failed | interrupted | stale | all | |
| search | No | only titles containing this text (server-side search) | |
| children | No | include child (sub-task) sessions; default true | |
| directory | No | only sessions whose directory contains this text | |
| title_prefix | No | only titles starting with this text, e.g. "ALPHA/" | |
| since_minutes | No | only sessions updated in the last N minutes |