<!-- generated-markdown-alternate -->
---
title: "OpenCode Context Doctor"
description: "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."
url: "https://briansunter.com/projects/opencode-context-doctor"
---

Nov 27, 2026 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.

[View Source](https://github.com/briansunter/opencode-context-doctor)

TypeScript AI Developer Tools OpenCode

![Cover image for OpenCode Context Doctor](/_astro/opencode-context-doctor-overview.DPfIT1aa_Z27YxSl.webp)

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](/_astro/opencode-context-doctor-tools.BD7nFN7S_2fpXse.webp)

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](https://github.com/briansunter/opencode-context-doctor#install)

## Related projects

- [OpenCode Recent Folders](/projects/opencode-recent-folders)

  [An OpenCode V2 plugin for finding recently used project folders, pinning favorites, and switching directories from the terminal.](/projects/opencode-recent-folders)
- [OpenCode Session Tabs](/projects/opencode-session-tabs)

  [An OpenCode V2 plugin for finding, previewing, and reopening existing sessions as terminal tabs without restarting their agents.](/projects/opencode-session-tabs)
- [Dust](/projects/dust)

  [A native pixel-art editor for drawing layered sprites, animating frames, and exporting assets for games.](/projects/dust)

## Share this project
