![Social preview](https://raw.githubusercontent.com/bowenliang123/dsh-context/main/docs/social-preview.png) # dsh-context [![npm version](https://img.shields.io/npm/v/dsh-context)](https://www.npmjs.com/package/dsh-context) [![GitHub stars](https://img.shields.io/github/stars/bowenliang123/dsh-context?style=social)](https://github.com/bowenliang123/dsh-context) **See what your DeepSeek Harness agent's context window is actually made of and how it evolves.** `dsh-context` is a [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness) plugin that adds a **Context Insight** panel to the web UI: a live, visual answer to *"what is the model carrying right now, and how did it get there?"* β€” context composition, per-request history, compactions, and injections, all in one place. ![Context panel overview](https://raw.githubusercontent.com/bowenliang123/dsh-context/main/docs/context-overview.png) ## Install One command, from any DeepSeek Harness installation: ```sh dsh plugin --profile web add dsh-context ``` Then start the web UI with `dsh web`, open any session, and click the **δΈŠδΈ‹ζ–‡ / Context** tab. No build step, no restart. ## What you'll see ### πŸ“Š Context stats β€” the session at a glance Turns, steps, how much context has been recycled by compactions and prunes, how many injections happened, model switches, and the estimated total tokens sent β€” next to the provider-reported actuals, so you can see how the estimate holds up. ### 🧱 Current composition β€” what's in the window right now A six-color stacked bar scaled against the model's full context window (the gray track is your remaining headroom): system prompt, tool schemas, your messages, injected context, assistant replies, and tool results β€” plus the top-5 most expensive tool schemas. When a conversation starts degrading, this is where you find out *which part ate the budget*. ### πŸ“ˆ History β€” watch the window grow (and get compacted) One stacked bar per model request, finer than per-message. Toggle between **Turn** and **Step** granularity, scroll sideways through the session, hover any bar for a quick tooltip, and click to pin the full breakdown β€” including provider-reported actual prompt/output tokens next to the estimate. **βœ‚ marks where compaction or pruning happened** β€” watch the bars drop: ![History chart with a pinned request](https://raw.githubusercontent.com/bowenliang123/dsh-context/main/docs/history-detail.png) Above: a real session that grew to ~563k tokens across 48 turns, then compaction (βœ‚) recycled βˆ’535.5k in one step, and the conversation continued from a fresh, small window. In **Step** granularity, hovering any bar shows that single step's context info instantly β€” its turn/step, timestamp, and estimated vs. provider-reported token counts: ![History chart with a step hover tooltip](https://raw.githubusercontent.com/bowenliang123/dsh-context/main/docs/history-step-hover.png) ### ⚑ Context events β€” when and why the window changed Every compaction, tool-output prune, skill or plugin context injection, and model switch β€” each with its token delta, turn/step attribution, and timestamp: ![Context events and messages](https://raw.githubusercontent.com/bowenliang123/dsh-context/main/docs/context-events.png) ### πŸ’¬ Messages β€” the currently model-visible surface The exact message list the model sees right now, newest first, with a per-message token cost. ## Like it? If `dsh-context` helped you understand what your agent is carrying around, a ⭐ on [GitHub](https://github.com/bowenliang123/dsh-context) is much appreciated β€” and issues/PRs are welcome! ## License [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)