dsh-context-monitor: DeepSeek Harness Conversation Context Visualization

Introduction

In long conversations or complex agent scenarios, DeepSeek Harness (DSH) sessions can suffer from context bloat, making it difficult to pinpoint the specific sources consuming space. The built-in context dashboard (context-meter) only displays a percentage, lacking fine-grained visibility into categories, nodes, tools, and growth trends. The dsh-context-monitor plugin adds two layers of context visualization to DSH: a compact context usage popup in the editor’s bottom status bar, and a “Context Lens” tab at the top of the conversation view that presents a full category breakdown, execution flow, and growth trends.

Plugin Overview

dsh-context-monitor is a client-side plugin that is part of the DeepSeek Harness UI. It displays the composition and evolution of the current session’s context through a “Context Lens” tab and a usage donut chart in the editor’s bottom area. The plugin was originally named dsh-context-lens and was renamed to dsh-context-monitor on November 11, 2026. Prior to that, it was known as dsh-claude-context (API routes, tab types, and persisted state still use the old name, so open tabs and preferences are preserved after renaming).

The plugin is maintained by DaYangtuo247, open-sourced on GitHub, version 0.1.0, under the MIT License. It depends on DeepSeek Harness 0.2.2-rc.3 (DSH NEXT 2.0.23).

Core Features

1. Compact View: Editor Bottom Status Bar

In the editor’s bottom status bar (conversation.composer.dock), the plugin replaces the DSH built-in context dashboard percentage with a donut chart. Clicking the donut chart opens a compact context overview popup:

  • The title reads “View Context Lens”; hovering reveals the current model in use and the context window size
  • Displays used / window percentage, as well as remaining space (with a hint about the compression threshold)
  • A category stacked bar identical to the one in the “Overview” tab
  • A single-line header describing the compression threshold and data source; hovering shows the pre-compression raw size
  • A two-level grouped list with Chinese labels and English terms:
  • Level 1: Messages, System Tools, MCP Tools, System Prompt, Skills, Memory Files (sorted by size descending)
  • Level 2: Expanding Messages reveals the category breakdown from “Overview” (tool results, reasoning, tool calls, etc.); expanding Memory Files reveals AGENTS.md / CLAUDE.md files
  • Unloaded auto-compression buffers, idle space, and lazy-loaded MCP / system tools are shown as placeholders
  • Hovering a row or bar segment highlights the corresponding item, dimming others; each non-empty section retains a minimally visible bar
  • Entrance animation: donut chart pops in, counts increment, bars expand, rows fade in sequentially (configurable reduced motion)

2. Context Lens Tab

At the top of the conversation view, the plugin adds a “Context Lens” tab (alongside “Conversation” and “Trajectory”). It always follows the current session and updates in real time (refreshes on contextPressure projection changes, or every 5 seconds if no projection is available).

View Layout

  • A fixed toolbar at the top with a segmented control for switching between sections
  • The toolbar shows real-time usage (% · used / window) and a “Live” indicator
  • Both the content area and the toolbar span the full view width; charts render at actual pixel widths to ensure consistent text height
  • When switching to other views, the editor area is hidden (input box, task dock, status bar, and the width drag handle)
  • All lists use a unified row style: rounded corners, no border lines, right-side arrow

Sections

Overview

  • Top card: donut chart, used/window percentage, data source, model, max output, compression threshold, remaining space, and a 13-category stacked bar
  • Category breakdown: clickable rows showing Chinese name, English term, token count, percentage (used / window), item count; hovering shows raw estimates
  • Context growth: cumulative growth per node with threshold / window lines (clickable to jump); or new tokens per turn
  • Compression strategy description
  • Calculation basis and raw data: calibration info, recent request usage, cache hit rate, event type counts

Interactions: The stacked bar supports hover preview, click to pin, click again to unpin; when pinned, other bars and legend dim while the corresponding detail row highlights; hovering shows token count, percentage (window / used), and item count. Idle space and auto-compression buffer can also be highlighted.

Animations: Cards float up sequentially, usage and token counts increment, donut chart and bars expand, category rows slide in, bars grow, growth curve draws in, expanded category rows drop down; configurable reduced motion.

Execution Flow

  • Session lifecycle diagram: Session Start → User Input → Turn Start → [Agent Loop: Model Request → Model Output → Tool Call → Tool Execution → Tool Result → Sub-agent → Todo → Step End ↺] → Turn End → Context Compression
  • Side nodes: Goal / Target Turn / Queue Input / Context Injection / Approval / Model Switch / Planning Mode / Scheduling / Title / Deliverables / Workspace Changes

Live mode (default):

  • The current stage glows with a highlight
  • Traversed path is connected with numbered nodes and arrows
  • Refreshes every 2.5 seconds while a turn is open
  • The status card shows the current stage, turn/step, running tasks and pending approvals, elapsed time, recent events, and current context (used/window, compression threshold, stacked bar)

Node display:

  • Each node shows a grey ×N (occurrence count)
  • If the node’s content is in context, the current held token count is shown (Model Request = tool definitions, Context Injection = system prompt + skills + memory files + injected context, User Input, Model Output = text + reasoning, Tool Call, Tool Result, Context Compression = summary)
  • It never substitutes a count for tokens, nor tokens for a count

Calculation rules: Verified from the event log.

Messages

  • List items show message type, timestamp, token count, and percentage (used / window)
  • Click to expand as a block with highlighting
  • Expanded content: rendered / raw text toggle, timestamp and call ID on hover, partial tags (only shown for multi-part messages or tool calls)
  • Code and JSON displayed on a light panel
  • Copy button on code blocks preserved

Tools Table

  • Left tools table: System tools and MCP tools
  • Right tools table: Tool calls and tool results
  • Row styling consistent with Messages

Skills

  • Skills list; click to expand as a block showing skill entry details

Memory Files

  • Shows AGENTS.md / CLAUDE.md files and their sizes
  • Expanding reveals agent-instructions messages, split by file

Trajectory

  • Displays the session trajectory

Animations: Cards float up, rows fade in, bars grow, capsule slides on section switch; configurable reduced motion.

Installation & Activation

The plugin uses client.js, which is committed and runs without any build step.

GUI Installation

  1. In DSH, navigate to “Plugins → Add Plugin → Install Third-Party Plugin”
  2. Enter github:DaYangtuo247/dsh-context-monitor (or a local checkout path)
  3. Enable the plugin under “Settings › Plugins”

CLI Installation

dsh plugin --profile <profile> add github:DaYangtuo247/dsh-context-monitor

Activation is the same as the GUI method: go to “Settings › Plugins” and enable the plugin.

Typical Usage

  1. After installing and enabling the plugin, a “Context Lens” tab appears at the top of the conversation view
  2. Send a message or initiate an agent task in the conversation editor, and observe the donut chart and popup in the bottom status bar
  3. Click the bottom donut chart to view the current session’s context composition and remaining space
  4. Switch to the “Context Lens” tab to review the overview, category breakdown, growth trends, and execution flow
  5. In “Overview,” click a category row to inspect its specific content (tool definitions, skill entries, memory files, etc.)
  6. In “Execution Flow,” check the current session stage, traversed path, and context occupancy

Applicable Scenarios & Notes

  • Suited for developers who need fine-grained control over context size, debugging of agent conversation flows, and analysis of context growth trends
  • The plugin runs with the current DSH process permissions; it is recommended to review the source code and license (MIT) before installation
  • The plugin works independently alongside dsh-composer-display, dsh-conversation-enhancer, dsh-whale-theme, and others, sharing a single build script
  • Ensure the DSH version is 0.2.2-rc.3 (DSH NEXT 2.0.23) before use

Conclusion

dsh-context-monitor provides DeepSeek Harness with complete context visualization capabilities, from the editor bottom popup to the conversation view tab, helping developers quickly locate context sources, monitor growth trends, and optimize compression strategies. The project directory and source code are available at SkillHub and GitHub.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye