← all repositories
bowenliang123/dsh-context

An X-ray for your agent’s overstuffed memory window

This plugin exposes exactly what fills your agent's context window, when parts get compacted or pruned, and how the token budget is spent across every turn.

1k stars TypeScript LLMOps · EvalAgents
dsh-context
Collecting fresh signals — velocity needs a few days of history.
collecting data…
star history

What it does

dsh-context is a DeepSeek Harness plugin that surfaces the internal state of an agent’s context window. It renders a dashboard and an in-session modal that break down token occupancy by category—system prompts, tool schemas, user messages, injected skills, assistant replies, and tool results—while tracking how that composition changes, compacts, and prunes across every turn and step. Think of it as a persistent itemized receipt for the short-term memory your model is actually paying attention to.

The interesting bit

The plugin doesn’t just count tokens; it reconstructs the exact assembled context of any past request, including steps before compaction by drawing on the removed-message archive, and renders signed deltas so you can watch the window shrink and grow like a financial ledger. It even prices image attachments using DeepSeek’s own image-to-token conversion rules, so multimodal payloads aren’t invisible black boxes.

Key highlights

  • Context browser lets you inspect any historical request’s full assembled contents—system prompts, tool JSON schemas, message text, reasoning traces, and tool-call arguments—down to the individual element’s token cost.
  • History chart visualizes cumulative or per-step token deltas with a stacked bar per request; hover scrubs the companion browser in real time, and scissors icons mark where compaction or pruning reclaimed tokens.
  • Context events log filters injections, compactions, prunes, model switches, and plan-mode toggles by producer source and signed token impact, so you know which skill or plugin just inflated the window.
  • Composition bar mirrors the chat composer’s official contextPressure / contextBreakdown projections, subdividing the message bucket by surface category and flagging the top five most expensive tool schemas.
  • Multimodal support renders image attachments as thumbnail cards with normalized dimensions, stored size, and estimated token cost using the provider’s own size-to-token formula.

Caveats

  • Steps reconstructed from the removed-message archive are explicitly marked as approximate, so pre-compaction forensics aren’t guaranteed exact.
  • Settings for default trend granularity and mode require the Host half to be installed and the settings document to be writable; remote browser sessions keep settings process-local and hide the configuration card.
  • Image loading depends on the harness’s session-authorized loader, and degrades to metadata-only cards when that loader is unavailable.

Verdict

Anyone running long or tool-heavy DeepSeek Harness sessions should install this immediately; if you treat your agent as a black box that just answers questions, you will not care.

Frequently asked

What is bowenliang123/dsh-context?
This plugin exposes exactly what fills your agent's context window, when parts get compacted or pruned, and how the token budget is spent across every turn.
Is dsh-context open source?
Yes — bowenliang123/dsh-context is open source, released under the Apache-2.0 license.
What language is dsh-context written in?
bowenliang123/dsh-context is primarily written in TypeScript.
How popular is dsh-context?
bowenliang123/dsh-context has 1k stars on GitHub.
Where can I find dsh-context?
bowenliang123/dsh-context is on GitHub at https://github.com/bowenliang123/dsh-context.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.