DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

Rtk Optimizer — DSH Plugin for DeepSeek Harness
← Plugins
R

dsh-rtk-optimizer

Rtk Optimizer

RTK command rewriting suggestions + tool output compaction for DSH. Suggests rtk-rewritten bash commands (deny-mode under rewrite) and compacts noisy tool output (bash/grep/read) to reduce context usage. Port of pi-rtk-optimizer for the Pi coding agent.

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add github:sleepinginsummer/dsh-rtk-optimizer#63ad61daa9e78852eb739cdd11d66196ea6ace96
READMECompatibilityVersions

Compatibility and provenance

Rtk Optimizer is published as dsh-rtk-optimizer and currently resolves to version 0.1.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
any
Release source
github
Registry updated
10/19/2026

Versions

0.1.0stable
10/19/2026

Related plugins

Loading related plugins…

Latest
0.1.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
any
License
MIT
Source
github
GitHub
★ 2
Weekly downloads
0
Last push
10/19/2026
View source ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue
DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in

Related plugins

More verified plugins in developer-tools.

Client Ui Git Graph@linxin666/dsh-client-ui-git-graphExternal dsh web GUI plugin: a blank-session git branch selector + Git graph, with real host-side git operations and guards, as a dsh profile bundleSsh@linxin666/dsh-sshRemote SSH operations for the dsh web GUI: host config store (~/.dsh/dsh-ssh.json, import from ~/.ssh/config), a persistent ssh2 connection pool with jump-host support, exec / PTY web terminal / SFTP transfer / local port-forward tunnels / cluster executiUpdate@linxin666/dsh-updateSelf-update plugin for the dsh web GUI: probes npm for newer family releases and runs the owning profile's pnpm update in place, from a sidebar trigger beside the settings seat with a release-notes panelOpsdsh-opsNative file and PTC tools for DSH on Windows x64, Linux x64 and macOS Apple Silicon; optional managed Bash and host PowerShell integration

README

dsh-rtk-optimizer

RTK 命令改写建议 + 工具输出压缩——DSH 插件(Host 拦截器),移植自 Pi Coding Agent 生态的 pi-rtk-optimizer。

不注册模型工具:它挂在两个工具事件上,全局生效(对所有会话的 bash/grep/read 调用),并提供 /rtk 命令查看状态。

功能

1. RTK 命令改写(tools/pre-execute)

模型调用 bash 时,若本机装有 rtk 二进制(rtk rewrite <command>),插件:

  • mode: rewrite(默认关闭,需 /rtk 切换)——deny 一次该调用,并在错误反馈中给出改写后的命令;模型重试时用新命令(rtk 幂等,不会循环;同一命令 30s 内只 deny 一次)。
  • mode: suggest(默认)——不打断调用,在结果末尾附注 [rtk-optimizer] rtk suggests: ...。

DSH 工具参数在分发管道中不可变(tools/execute 只能改 exec.signal),所以"自动改写"以 deny+反馈的形式实现——这是架构允许下最接近自动改写的语义。 rtk 未安装时:原命令原样执行(guardWhenRtkMissing: true),探测结果缓存 60s,不重复 probe。

2. 输出压缩(tools/post-execute)

对成功返回的 bash/grep/read 文本输出按配置走压缩管线(可单独开关):

阶段说明
ANSI 剥离移除 CSI/OSC 颜色控制序列
Git 压缩git status --short 行汇总为一行统计;40 位 commit hash 缩短为 7 位
测试聚合保留 Tests: N passed, M failed 总结与失败行,折叠其余(jest/mocha/vitest/go test/pytest 命令触发)
构建过滤只保留 error/warning 行 + 汇总统计(build/tsc/make/npm 等命令触发)
搜索分组path:line:content 行按文件分组(grep 工具输出)
智能截断超 maxOutputChars(默认 30000)时保留头 + 尾,中间打截断标记

统计每个调用的节省字符数,/rtk stats 可查。

3. /rtk 命令

/rtk [show|verify|stats|clear-stats|reset|set|help]——配置与运行状态、rtk 二进制探测、压缩节省量统计。

子命令说明
show当前配置 + rtk 二进制状态 + 统计
verify检查 rtk 二进制是否可用(探测结果缓存 60s)
stats / clear-stats查看 / 重置压缩节省量统计
set <key> <value>运行时切换:mode(suggest|rewrite)、enabled、guardWhenRtkMissing、readCompaction
reset恢复默认配置

实现适配:rtk 0.43 对成功改写返回退出码 3(非文档所述 0),插件同时接受 0 与 3;不支持的命令退出 1 且无输出,命令原样放行。

安装

dsh plugin --profile <name> add dsh-rtk-optimizer

安装后重启 DSH,压缩与改写对全部会话的 bash/grep/read 调用生效(/rtk 命令可查状态与统计)。

开发

npm test   # 20 用例:ANSI、git 压缩、搜索分组、测试聚合、构建过滤、截断、总管线、静态求值

参考

  • pi-rtk-optimizer (GitHub)
  • pi-rtk-optimizer (npm)