Introduction

After running an intelligent agent session in DeepSeek Harness (DSH), a common problem arises: there are many raw events, yet it is difficult to see where tokens are actually consumed, which tool takes the longest, or if there is context compression, approval, sub-Agents, or LLM retries. If you need to send results to collaborators, simply pasting raw events is not convenient enough.

dsh-session-lens is a DSH plugin designed for this scenario: it generates an in-depth health report within the session and exports the session as a self-contained single-file HTML replay page. The following introduces its functional boundaries, installation method, and export options.

What is it

dsh-session-lens is a DSH plugin maintained by bobostudio, positioned as “Session Insight and One-Click Sharing”.

It targets:

@deepseek-ai/dsh >= 0.1.0-rc.6

for the web profile, with runtime requirements:

Node >= 20

The license is MIT.

Core Features

“Insight” View Inside a Session

After enabling, a new “Insight” tab is added to the session for viewing real-time analysis. During the session, this view automatically refreshes every 5 seconds.

Aggregated analysis includes:

  • Token Usage Breakdown (5 segments): Input / Output / Cache Read / Cache Write / Chain of Thought; where Compressed Summary calls are listed separately.
  • Breakdown by Turn: Duration per turn, tokens, number of tool calls, number of errors.
  • Tool Statistics: Call count, error rate, duration.
  • Activity Statistics: Context compression, approvals, sub-Agents, LLM retries.

Export Single-File HTML

Clicking “Export HTML” downloads a single-file report.

The exported result satisfies:

  • Self-contained single-file HTML replay page;
  • Zero JavaScript;
  • Zero external requests.

Exported content includes full session replay, tool calls and results, approvals, context compression, and sub-Agent markers.

The interface supports Chinese and English, and the export language is optional.

Privacy and Export Boundaries

The export boundaries of dsh-session-lens are quite clear:

  • System prompts are never included;
  • Image attachments never leave the local machine;
  • Content Security Policy is default-src 'none';
  • Tool parameters/results are truncated to 2000 characters by default, with the option to keep them fully;
  • Path sanitization is enabled by default, and local paths are automatically sanitized to ~;
  • Absolute paths outside the working directory are kept as-is by default;
  • API route /api/session-lens/{analytics,export} is loopback-only, GET-only.

If you wish to share the exported file, it is recommended to check the export content first, especially the absolute paths outside the working directory that are kept as-is.

Installation and Enablement

The installation command is as follows:

dsh plugin --profile web add github:bobostudio/dsh-session-lens

After installation, open a session in DSH Web and click the “Insight” tab to view real-time analysis.

Typical Usage

  1. Open a session and click the “Insight” tab to view real-time analysis.
  2. Click “Export HTML” to download a single-file report.
  3. Export options are automatically remembered:
  • Full tool results: Disabled by default, truncated to 2000 characters;
  • Path sanitization: Enabled by default;
  • Theme: Optional;
  • Chinese/English: Optional interface language for the exported file.

When mounting in development mode, you can use the following command to point to the patch file in this repository:

dsh web --patch <本仓库路径>/cordis.patch.yml

Applicable Scenarios and Notes

Suitable for the following scenarios:

  • Need to view token breakdown, Turn costs, and tool error rates in DSH sessions;
  • Need to view activities such as context compression, approvals, sub-Agents, and LLM retries;
  • Need to export sessions as single-file HTML replay pages for offline viewing or sharing;
  • Need to control tool results, local paths, and image attachments in the exported content.

Notes:

  • DSH is in developer preview phase, and internal interfaces relied upon by the plugin may change with versions;
  • All optional services have fallback handling;
  • The plugin runs with the current dsh process permissions; check the source code and license before installing;
  • Absolute paths outside the working directory are kept as-is by default; you need to confirm the export content yourself before sharing.

Conclusion

The value of dsh-session-lens lies in aggregating information such as tokens, tools, approvals, context compression, and sub-Agents in DSH sessions into a readable report, and exporting the replay as a self-contained single-file HTML.

See GitHub for source code and license:

  • https://github.com/bobostudio/dsh-session-lens