dsh-context README

The project's README from github.com/bowenliang123/dsh-context. As one markdown file: README.md.

Social preview

dsh-context

npm version GitHub stars dshfind

The best DeepSeek Harness plugin for Agent's context insights and management.

dsh-context provides full context lifecycle management features.

Install / Update

Install dsh-context plugin from DeepSeek Harness:

dsh plugin --profile web add dsh-context

Or update the dsh-context plugin:

dsh plugin --profile web update dsh-context@latest

Then start the web UI with dsh web. No build step, no restart.

Use it

Three surfaces, one story — what your agent is carrying, how it got there, and what it did with it:

Where What you get
Context tab The full dashboard: stats, composition, per-request trend, events, file activity, and the agent network — in every session.
/context command A centered modal with the same composition and context browser, without leaving the chat.
Settings → Plugin configuration Per-user defaults: trend granularity & mode, File Activity sort.

📊 The Context tab

Open any session and click the Context / 上下文 tab:

Context panel overview

Card The question it answers
Context Stats Turns, steps, live tool calls & images, context-event tallies — plus a list-price cost estimate (hover the ? for per-1M rates).
Token Stats Where the billed tokens went: cache read/write, uncached input, output — around the cache-hit ring.
Timing Stats How active time split across model calls, tool runs, and overhead.
Current Context What's in the window right now.
Context Trend Every request's size — and its story.
Context Browser What any request was actually assembled from.
Context Events When and why the window changed.
File Activity What the agent did to your files.
Agent Network The whole agent family, live.

The headline occupancy and composition read the same official token-meter projections as the chat composer's context ring (contextPressure / contextBreakdown), so the figures always match what the ring tells you.

🧱 Current Context — who ate the budget

Current Context card

A six-color stacked bar against the model's full window (hatching = free headroom): system prompt, tool schemas, user messages, injected context, assistant replies, tool results — each with its ≈token figure and share. When a conversation starts degrading, this is where you see which part is responsible.

📈 Context Trend — every request, sized and explained

Context Trend with the step brief

One stacked bar per model request — finer than per-message — so you watch the window grow turn by turn:

Context Trend in Delta mode

🧭 Context Browser — open the box of any request

Pick Live (next request) or any retained step, and browse what that request was assembled from: six collapsible categories expand into one row per element with its token price, and every element expands again into its actual content — the system prompt, each tool's JSON schema, message text, reasoning, tool arguments, and tool outputs.

Tool schemas with source chips, filter, and sort

A tool result expanded with Raw/Markdown toggle

An image payload rendered as a thumbnail card

⚡ Context Events — when and why the window changed

Context Events with a compaction

Every injection, compaction, prune, model switch, and plan-mode toggle — labeled with its producer (instruction file, plugin id, skill name), its net token delta (compactions show what they reclaimed), turn/step, and time. The Inject / Compact / Prune / Switch / Mode chips filter the log by kind.

📁 File Activity — what the agent did to your files

File Activity

One row per touched file — read, written, or searched — aggregated up to whichever step you pick on the trend chart:

🕸 Agent Network — the family portrait

Agent Network with two subagents

The current agent, its parents, and every subagent — one node per agent, colored edges for the lineage, multi-level delegation on one map. Each ring is that session's composition scaled to its window occupancy; hover for tokens, requests, billing, and active time; click to jump into that session's own Context tab. Running agents breathe with a green pulse.

⌨️ /context command

Type /context (or pick it from the / menu) and press Enter:

Slash menu with the context command

A centered dialog opens with the Current Composition card and the Context browser — the same composition bar, per-step picker, and vs previous turn diff badges as the tab:

The /context modal

⚙️ Settings

In Settings → Plugins → Plugin configuration, the Context card holds this plugin's per-user preferences — default trend granularity (Step/Turn), default trend mode (Total/Delta), and the File Activity default sort. In-chart and in-card toggles stay per-view and never overwrite the stored preference.

The Context settings card

Good to know

Like it?

If dsh-context helped you understand what your agent is carrying around, a ⭐ on GitHub is much appreciated — and issues/PRs are welcome!

License

Apache-2.0

dsh-context (bowenliang123/dsh-context)

Searching Database…

这是什么?dsh-context 是一个 DeepSeek Harness(dsh)插件,让你完整洞察 AI 智能体的上下文窗口——包括一个仪表盘标签页、一个侧边栏面板和一个 /context 斜杠命令,展示 token 统计、上下文构成、趋势、压缩/修剪事件、文件活动以及智能体家族树。
这是独立应用,还是插入到其他东西上的插件?它是一个扩展 DeepSeek Harness 自带 Web UI 的插件——添加一个 Context 标签页、一个右侧边栏面板和一个 /context 斜杠命令——而不是独立的应用程序。
我需要先装好 DeepSeek Harness 吗?需要——这纯粹是 DeepSeek Harness 的插件,要求 @deepseek-ai/dsh 版本 0.1.2-rc1 或更高。
显示的 token 数字是精确值吗?大多数分类细分使用 dsh 自己的固定密度 token 估算启发式(与其内置的 token 计量器相同),而服务商上报的实际 prompt/输出/缓存数字则与固定的趋势详情并列显示,方便对比。
Context Trend 图表显示什么?每次模型请求一根堆叠柱,展示上下文窗口逐轮的增减情况,压缩和修剪事件精确固定在它们发生的位置,并配有通俗易懂的步骤简报,解释有什么内容进入和离开。
Agent Network 视图是做什么的?它把当前智能体连同其父级和每个子智能体绘制成家族树,用实时圆环显示每个会话的 token 用量、请求数、计费和活跃时长,让多智能体委派一目了然。
UI 可以用中文吗?可以,dsh-context 自带英文和简体中文翻译。
有了内置的上下文圆环,我为什么还需要它?内置的输入框圆环只显示总体占用,而 dsh-context 把同样的数据按请求、工具调用和文件逐一细分,还加入了历史记录(趋势、事件、差异),让你能确切看到是什么导致了上下文变化。
Size
15.1 MB
Stars
2.3K
Age
2mo
Commits · 90 Days