dsh-session-analyst
DiscoveredDSH Plugin: Agent Session Quality Analysis — Tool Success Rate, Token Efficiency, Redundant Call Detection, and Cross-Session Regression Comparison.
dsh-session-analyst
Session quality analysis plugin for DeepSeek Harness.
Gives the agent (and you) structured insight into session behavior: tool success rates, token efficiency, redundant calls, error patterns, and regression detection.
Install
dsh plugin add dsh-session-analyst
Or add to your cordis.patch.yml:
- id: session-analyst
plugin: dsh-session-analyst
config:
redundantCallThreshold: 3
excessiveStepThreshold: 10
Tools provided
analyze_session
Parse a session log file (.jsonl or compressed .jsonl.zstd) and return quality metrics.
Agent: I'll analyze the session from the last run.
→ analyze_session({ path: "~/.dsh/sessions/abc123/session.jsonl" })
Returns:
{
"summary": {
"totalTurns": 5,
"totalSteps": 12,
"totalToolCalls": 8,
"totalErrors": 1,
"successRate": 0.875,
"avgStepsPerTurn": 2.4
},
"issues": [
{ "severity": "warning", "code": "REDUNDANT_TOOL_CALL", "message": "..." }
],
"tokenStats": { "efficiency": 0.12, ... },
"toolStats": { "byName": { "bash": { "count": 5, "errors": 1 }, ... } }
}
compare_sessions
Compare baseline vs current session to detect regressions.
Agent: Compare today's run against yesterday's baseline.
→ compare_sessions({ baseline: "./baseline.jsonl", current: "./today.jsonl" })
Returns:
{
"verdict": "regressed",
"regressions": [
{ "dimension": "Tool success rate", "baseline": "100%", "current": "75%", "changePercent": -25 }
],
"delta": { "stepsDelta": +3, "errorsDelta": +2, "tokenDelta": +1500 }
}
Analysis dimensions
| Dimension | What it detects |
|---|---|
| Tool success rate | Percentage of tool calls that return without error |
| Redundant calls | Same tool + same arguments called multiple times |
| Token efficiency | Ratio of output tokens to total consumed |
| Excessive steps | Turns with >10 steps (possible loop) |
| Error patterns | Tools with >50% error rate |
| Duration | Wall-clock time per turn |
Use cases
- Post-run diagnostics: Agent analyzes its own session after a task to identify inefficiencies
- Regression detection: Compare sessions before/after a prompt or skill change
- CI integration: Headless mode runs a task, then analyze_session checks quality gates
- Skill tuning: Identify which tools are being misused and refine system prompts
Standalone usage (without dsh)
The parser and analyzer are usable as a library:
import { parseSessionFile, analyzeSession, compareSessions } from 'dsh-session-analyst'
const session = await parseSessionFile('./session.jsonl')
const analysis = analyzeSession(session)
console.log(analysis.summary)
Development
npm install
npm test
License
MIT
Comments
Loading…
Similar plugins
by Momojie-S
DSH 插件: 子agent会话清理 —— 会话自清 + 运维侧跨workspace大扫除(归档可逆/可彻底删除)
★ 0
MIT
TypeScript
Sep 12, 2026
dsh plugin --profile web add @momojie-s/dsh-subagent-cleanupby omdsh-dev
DSH 会话健康检查插件:多帧 zstd 会话文件的帧级扫描诊断(torn/损坏/空会话检测),零依赖只读,注册 session_health 工具
★ 8
MIT
TypeScript
Sep 10, 2026
dsh plugin --profile web add @deepseek-ai/dsh-session-healthby 2031814001yuyue-tech
DSH Side Chat — 并行侧边对话插件:真实并行 agent 会话、独立上下文、摘要带回主对话。
★ 3
↓ 88/wk
MIT
JavaScript
Aug 15, 2026
dsh plugin --profile web add dsh-side-chatby TheHeartFickle
DSH 会话管理插件 —— 对话回退 + 归档会话,长会话可回滚、可整理。
★ 0
MIT
JavaScript
Sep 20, 2026
dsh plugin --profile web add @the-heart-fickle/dsh-session-managerby TheHeartFickle
DSH 对话流渲染增强插件 —— 折叠过程,保留正文,长对话更清爽。
★ 0
MIT
TypeScript
Sep 11, 2026
dsh plugin --profile web add @the-heart-fickle/dsh-conversation-foldingby lanlandeli
DeepSeek Harness 会话管理插件|归档与恢复、批量操作、工作区分组、子代理关系、活动详情、记录目录与安全文件清理
★ 2
↓ 61/wk
NOASSERTION
TypeScript
Aug 18, 2026
dsh plugin --profile web add dsh-conversation-manager