What Is dsh-context? See Inside Your DSH Agent Context
dsh-context is a context insight and management plugin for DeepSeek Harness (DSH) that provides full lifecycle management for Agent context: view context stats, composition, trends, events, file activity, and the agent network directly inside the harness, with no manual log analysis required. This guide covers what dsh-context is, its core features, the full install/update/uninstall commands, typical usage, and troubleshooting — so you can see how your agent's context is composed, how it evolves, and when it gets compressed.
What Is dsh-context?
dsh-context solves the problem of opaque Agent context: it turns the composition, evolution, compaction, and pruning of conversation context into a visual dashboard and browser, so developers understand context dynamics without digging through logs. The positioning and facts below all come from the official README (source):
dsh-context (GitHub repo bowenliang123/dsh-context) is maintained by bowenliang123 under the Apache-2.0 license. It does not change DeepSeek Harness's core behavior; it offers three entry points: the Context tab in every session, the /context command in chat, and per-user default preferences in settings. The headline occupancy and composition read the same official token-meter projections as the chat composer's context ring, so the figures always match. It is a context-insight plugin in the DSH Plugin ecosystem, with UI in English and Simplified Chinese.
What Are the Core Features of dsh-context?
The core capabilities revolve around five views — composition, trend, events, file activity, and agent network: a context dashboard from stats to detail, plus a /context command that brings the browser into the chat. These capabilities all come from the official README (source):
- Context tab: a full dashboard with stats, composition, per-request trend, events, file activity, and the agent network in every session.
- /context command: opens a centered modal with the same composition and context browser without leaving the chat.
- Context stats: turns, steps, live tool calls and images, context-event tallies, plus a list-price cost estimate.
- Context trend: one stacked bar per model request with Step/Turn granularity, Total/Delta modes, and scissors marks for compaction and prune events.
- Context browser: browse what any request was actually assembled from, with Live (next request) or retained steps, plus diff badges against the previous turn.
- File Activity and Agent Network: per-file read/write/search operations with line deltas, and a node map of the current agent, parents, and all subagents.
How to Install and Enable dsh-context?
One official npm command installs it; after starting the Web UI with dsh web, the Context tab is ready — no build step or restart needed.
1. Install dsh-context: install the plugin into the DeepSeek Harness Web profile via npm:
dsh plugin --profile web add dsh-context
2. Install from GitHub for source auditing: use the repository source for development or auditing:
dsh plugin --profile web add github:bowenliang123/dsh-context
Git installs execute install-time code, so only install trusted sources.
3. Validate and start the Web UI: validate the composed profile, then start the Web UI:
dsh --profile web --dump-config
dsh web
4. Update the plugin: the README's update command follows the latest release:
dsh plugin --profile web update dsh-context@latest
5. Uninstall the plugin: remove it when no longer needed:
dsh plugin --profile web remove dsh-context
The command forms above follow the host documentation, and the package name dsh-context comes from the README and the plugin entry (source).
Typical dsh-context Usage
dsh-context works right after installation: open the Context tab in any session for the full picture, dig deeper with /context in chat, and adjust per-user defaults in settings.
1. Open the context dashboard: in any session, click the Context / 上下文 tab to see the full dashboard — stats, composition, trend, events, file activity, and the agent network.
2. Open the browser with /context: type the command in chat or pick it from the slash menu to open the centered context browser:
/context
A centered dialog opens with the Current Composition card and the context browser, with the same composition bar, per-step picker, and diff badges as the tab.
3. Read the trend chart and prune events: one stacked bar per model request; find compactions and prunes by their scissors marks, hover for an instant tooltip, and click to pin the full breakdown with provider-reported actuals.
4. Revisit any request's assembly: in the context browser, pick Live (next request) or any retained step and expand system prompt, tool schemas, message text, reasoning, and tool outputs to see the cost row by row.
5. Set per-user defaults: in Settings → Plugin configuration, the Context card stores trend granularity, trend mode, and File Activity sort; in-chart toggles stay per-view and never overwrite the stored preference (source).
dsh-context Troubleshooting
If the numbers do not match, pre-compaction steps look incomplete, or images do not render, match the symptoms below. The troubleshooting points below all come from the official README (source):
1. Occupancy does not match the pinned detail numbers: the symptom is a mismatch between the Current Context card share and the trend detail token counts. The cause is that category figures use dsh's fixed-density heuristic, while pinned details and the Token/Timing rings show provider-reported actuals. Fix: treat hover/pinned details as actuals and category overviews as estimates.
2. Pre-compaction steps look incomplete: the symptom is approximate composition for older steps in the context browser. The cause is that steps older than a compaction are reconstructed from the removed-message archive. Fix: rely on the card's "approximate" label; the makeup may not be exact.
3. Image payloads do not render as cards: the symptom is image attachments shown as plain text in the browser. The cause is that multimodal rendering requires a newer DSH version. Fix: upgrade DeepSeek Harness and reopen the browser; see the README for supported versions.
4. The Context tab does not appear: the symptom is no Context tab after enabling. The cause is that the Web UI was not started, or the install did not take effect. Fix: confirm the install command succeeded and start the Web UI with dsh web; no build or restart needed.
Use Cases and Notes
dsh-context suits every DSH user who wants deep visibility into agent context dynamics, especially when tracking down what is eating the window and managing long conversations.
Use cases: developers who want to see which part of the window is full and when compaction or pruning happens; debugging sessions that need to revisit what any request was assembled from; and multi-agent sessions where you want to watch the main agent and all its subagents at once. In short, context stops being a black box.
Notes: category figures are estimates and pinned details are actuals; compatibility covers @deepseek-ai/dsh 0.1.0-rc7+, 0.1.1-rc2+, and 0.1.2-alpha1+, with multimodal rendering requiring 0.1.1+; the UI supports English and Simplified Chinese; hovering the trend chart previews that step's assembly in the browser (source).
Project Links
dsh-context is an Apache-2.0 open-source project maintained by bowenliang123. Plugin detail page: dsh-context plugin details.
This page is an independent guide rewritten from the plugin's official README — for the authoritative documentation and the latest changes, defer to the source: bowenliang123/dsh-context. A plugin is third-party code that runs on your machine once installed; inclusion is not an endorsement — review the source before installing.
FAQ
In dsh-context, the Context trend chart supports Step and Turn granularity, with the default set in settings. Step granularity shows each model request, while turn granularity aggregates by conversation turn; switching re-renders and keeps the current mode (Total or Delta).
In the dsh-context context browser, select Live (next request) to preview what the next request will actually be assembled from. This mode shows the current window contents, including system prompt, tool schemas, and user messages, updating as the conversation progresses.
dsh-context's cost estimate uses list prices, i.e., standard model pricing. Hover the question mark icon in the Context stats card to see per-million-token rates; the estimate is for reference only.
In the dsh-context trend chart, compaction and prune events are marked with a scissors icon pinned to the bar where they occurred, showing when and why the context window shrank. In Delta mode, a compaction dives below the baseline.
Adjust the dsh-context File Activity sort in Settings → Plugin configuration, for example by time or file path. This per-user default does not affect other users' views.
The dsh-context context stats card updates live tool calls and image counts as the conversation progresses, reflecting the latest state in the window. The numbers use DSH's official token-meter projections, consistent with the composer's context ring.
Related Terms
- dsh-context
- dsh-context is a context insight and management plugin for DeepSeek Harness (DSH) that provides a Context tab, /context command, and context browser for understanding context composition, evolution, and compression.— dsh-context README
- Context trend chart
- Context trend chart is a core view in dsh-context: one stacked bar per model request, with Step/Turn granularity and Total/Delta modes, and scissors marks for compaction and prune events.— dsh-context README
- Context browser
- Context browser is a dsh-context component that shows what any request was actually assembled from, supporting Live (next request) or retained steps, with system prompt, tool schemas, and message bodies.— dsh-context README
- File Activity
- File Activity is a dsh-context view that lists per-file read, written, and searched operations with line-delta estimates and per-purpose filters.— dsh-context README
- Agent Network
- Agent Network is a dsh-context view that shows the current agent, its parents, and every subagent as nodes, with hover details for tokens, requests, billing, and active time.— dsh-context README