DeepSeek Harness 插件

mkpoli/dsh-history-search

分类 工具与能力 收录于 2026-11-10

给智能体增加一个检索 Claude Code、Codex 与 DSH 会话记录的工具(不改动原记录),并为每条结果给出恢复命令。需要 PATH 上有 ripgrep(rg)与 zstd(zstdcat),并会在 ~/.dsh/cache/history-search 保留 DSH 会话的明文缓存。

安装

# Release 预构建包

dsh plugin --profile web add "https://github.com/mkpoli/dsh-history-search/releases/download/v0.1.0/dsh-history-search.tgz"

# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)

dsh plugin --profile web add github:mkpoli/dsh-history-search

装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。

README

该插件的 README 只有英文版本。

A DeepSeek Harness plugin that gives the agent one search tool over the transcript stores of three CLI agents:

Source Store
Claude Code ~/.claude/projects/**/*.jsonl
Codex ~/.codex/sessions/**/rollout-*.jsonl
DeepSeek Harness ~/.dsh/sessions/**/session.*.jsonl*

The tool is read-only. It returns the newest matching sessions with excerpts, working directories, and the command that resumes each session (claude --resume, codex resume, dsh tui --resume).

Install

dsh plugin --profile web add github:mkpoli/dsh-history-search

Restart the host afterwards. The plugin declares its bundle patch in cordis.patch.yml, so mounting it adds one history-search row with default configuration.

Use

Ask the agent to search earlier work, for example:

Search my history for the spectrogram rendering fix.

The model calls history_search with:

Argument Meaning
query Literal words; every word must appear in the same transcript record.
source all (default), claude, codex, or dsh.
project Case-insensitive substring of the session working directory.
limit 1–30 sessions, newest first. Default 8.

Matching is case-insensitive. A multi-word query requires all words on one record, which keeps results focused on messages that discuss the whole phrase.

How it reads each store

Claude Code and Codex are searched in place with ripgrep, so results always reflect the current files.

DeepSeek Harness appends one zstd frame per batch to each session log. Node's zstdDecompressSync stops after the first frame, so the plugin decompresses each log once with zstdcat into ~/.dsh/cache/history-search/dsh/ and refreshes an entry only when its size or mtime changes. The cache holds plain JSONL, is created with owner-only permissions, and mirrors live sessions as they are written. Delete ~/.dsh/cache/history-search to reclaim the space; the next search rebuilds it (about 10 seconds for a few hundred sessions).

Requirements

  • ripgrep (rg) on the server's PATH.
  • zstdcat from the zstd package on the server's PATH.

Both are reported as tool errors when missing.

Limits

  • Searches record text found in messages, reasoning, tool input, and tool output. Base64 attachments and other binary payloads are skipped.
  • Subagent sidechains are included; their resume command points at the parent session.
  • Older DeepSeek Harness sessions keep their historical id, which may carry a session- prefix.

内容来自项目 README(GitHub)↗

链接

同类插件

查看整个分类 →

社区评论

评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。