DDDPG/dsh-plugins--plugins-dsh-insights ↗★ 0
dsh-insights
DSH plugin: replica of Claude Code's /insights command — cross-workspace session usage analysis powered by the global session-query corpus, with per-session LLM facet extraction (cached), 8 analysis prompts, and a self-contained interactive HTML report. Runs as a foreground /insights command in the session, orchestrated via insights_collect / insights_facet / insights_aggregate / insights_render / insights_run model tools with subagent-parallel facet fan-out.
AI 分析
核心用途是分析跨工作区的会话历史并生成交互式分析报告。适合需要复盘、统计和可视化 AI 使用习惯与会话维度的用户。在会话中运行 `/insights` 即可触发。
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:DDDPG/dsh-plugins#543d4b046af0c67602be6d16cba7f6ed94239247&path:plugins/dsh-insightsドキュメント
README 全文を読む ↗Usage
In any session:
/insights # analyze new sessions and generate the report
/insights --refresh # ignore facet cache; re-analyze everything
/insights --window 30 # last 30 days only (0 = all)
/insights --max 20 # analyze at most 20 new sessions this run
Loader config is optional — without it, outputs default under the harness home ($DSH_HOME/storages/insights/, else ~/.dsh/storages/insights/). To customize, add an id-targeted config patch in the profile's cordis.patch.yml (last write wins per row):
- insert:
- id: insights
name: 'dsh-insights'
config:
reportPath: !!js dshHomePath('storages/insights/report.html')
facetDir: !!js dshHomePath('storages/insights/facets')
# optional: cheaper model for facet/analysis (must be a pair)
# provider: deepseek
# model: deepseek-chat
| key | default | notes |
|---|---|---|
reportPath | $DSH_HOME/storages/insights/report.html | HTML report output path |
facetDir | $DSH_HOME/storages/insights/facets | per-session facet cache directory |
maxNewSessionsPerRun | 50 | cap on new sessions analyzed per run |
transcriptCharLimit | 30000 | longer sessions are chunk-summarized first |
chunkChars | 25000 | summary chunk size |
facetMaxOutputTokens | 4096 | facet extraction max output tokens |
analysisMaxOutputTokens | 8192 | analysis prompt max output tokens |
timeoutMs | 120000 | per LLM call timeout |
openReport | true | open the report in a browser when done |
provider / model | (unset) | facet/analysis route override; both or neither |
locale | zh | report and prompt language (zh / en) |
The assistant orchestrates these tools (or you can ask it to call insights_run once):
| tool | role |
|---|---|
insights_collect | scan the global corpus, extract metadata, return new session ids |
insights_facet | LLM facet extraction for a batch (cached per session, failures isolated); safe to fan out across subagents |
insights_aggregate | aggregate cached facets + 8 analysis LLM calls (7 prompts + overview); writes insights-latest.json |
insights_render | render the HTML report and try to open it |
insights_run | one-shot serial pipeline (fallback; no subagent fan-out) |
Uninstall
dsh plugin --profile web remove dsh-insights
Limits and privacy
- Analysis runs on this machine; LLM requests leave the machine. The report is a local file — sharing it is your choice.
- The plugin writes three locations:
reportPath,facetDir(one JSON file per analyzed session), andinsights-latest.jsonnext tofacetDir(aggregate handoff). It does not append events to session logs. - Token totals only cover sessions whose adapter reported
usage(the report shows coverage). Input tokens use the billing formulainputTokens + cacheReadTokens + cacheWriteTokens. - Git activity, languages, and touched files are heuristics.
- Facet cache is one-shot per session id; later turns in the same session are not re-analyzed unless you pass
--refresh.