Skip to main content
Launched

OpenCode Context Doctor

A read-only OpenCode V2 plugin that shows what fills your model's context window, from system prompts and conversation history to tool schemas and results.

TypeScript AI Developer Tools OpenCode
Cover image for OpenCode Context Doctor

When an OpenCode session gets long, the token count alone doesn’t tell you what to trim. Is it the conversation, a tool that returned a huge result, or the schemas sent with every request? Context Doctor is a terminal dashboard that breaks that total into parts.

Inspect a session

Run /context-doctor in OpenCode V2 to see the estimated size of the system prompt, conversation history, and tool schemas. The Tools tab ranks schema size separately from tool inputs and outputs, so a verbose tool result doesn’t get confused with the cost of exposing that tool in the first place. The History tab shows how those estimates change across requests.

Context Doctor Tools tab comparing tool schemas and transcript inputs and outputs, using synthetic test data
Context Doctor Tools tab comparing tool schemas and transcript inputs and outputs, using synthetic test data

Provider-reported token counts appear separately on the Usage tab. The breakdown is an estimate, not a bill. Run /context-doctor all to compare captured sessions across projects.

What stays local

The plugin observes requests without modifying them or making its own network calls. It keeps bounded, aggregate snapshots in a local SQLite database, not copies of prompts or tool outputs. The screenshots use synthetic test data.

Source and installation instructions

Share this project