opencode-status
v0.0.0
Published
Status tracking plugin for OpenCode - tracks tool usage and agent state in a local database
Maintainers
Readme
opencode-status
A lightweight status tracking plugin for OpenCode that records agent and tool usage into a local SQLite database.
Features
- Status Tracking: Records when agents are "thinking", using tools, or idle
- SQLite Database: Stores all status data in
~/.config/opencode/status.db - Session Mapping: Maps session IDs to registered names for easy tracking
- Lightweight: No Electron, no GUI - just pure status tracking
Installation
npm install opencode-statusUsage
Add to your OpenCode configuration:
{
"plugins": ["opencode-status"]
}The plugin will automatically:
- Create a
status.dbSQLite database in your OpenCode config directory - Track tool usage for registered sessions
- Record when agents are thinking, executing tools, or idle
Database Schema
The plugin creates a latest_tool_usage table:
CREATE TABLE latest_tool_usage (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
session_id TEXT NOT NULL,
tool_name TEXT NOT NULL,
timestamp INTEGER NOT NULL,
UNIQUE(name, session_id)
);API
Tool: register_status_name
Register a name for the current session to enable status tracking:
// The LLM can call this tool to register itself
register_status_name({ name: "my-agent" })Once registered, all subsequent tool usage and state changes will be tracked for that name.
Querying Status
You can query the database directly:
import { Database } from "bun:sqlite";
const db = new Database("~/.config/opencode/status.db");
const status = db.query("SELECT * FROM latest_tool_usage WHERE name = ?").get("my-agent");Tracked States
registered- Initial registration of a session namethinking- Agent is processing a message<tool_name>- Any tool being executed (e.g., "bash", "read", "write")idle- Agent is waiting for input
License
MIT
