Learn DeepSeek Harness
August 16, 2026 · View on GitHub
Get official DeepSeek Harness running, one layer at a time.
中文: README.zh-CN.md
Companion: awesome-dsh · dsh-xhs-note
Caution
Do not pip-install the unrelated PyPI package deepseek-harness-cli (Henry Zhang). It ships dsh doctor / dsh chat and will steal the dsh name.
Official CLI: @deepseek-ai/dsh. Official Python SDK: deepseek-harness-sdk (not pip install deepseek-harness).
Check: which -a dsh.
npx @deepseek-ai/dsh web
Then open http://127.0.0.1:3080.
Package: @deepseek-ai/dsh@0.1.0-rc.6 (MIT). One-page commands: QUICKSTART.md.
Philosophy
Agent = Model + Harness. The model is the driver; the harness is the pair of hands.
Everything is a plugin, including the loop. Model adapters, tool registries, session logs, and ctx.agentLoop itself hang on a shared ctx — unload and the registrations retract.
Model-visible means logged. Every line the model sees must be reconstructable from the session log. deriveMessages() projects history from the log; it does not keep a second copy.
Do not fork packages/ to change the loop. Add capability beside it.
Lessons
| Lesson | One line | |
|---|---|---|
| s01 | One loop + bash | python s01_run_dsh/code.py; product entry is still npx @deepseek-ai/dsh web |
| s02 | Settings → models + Key | Official screenshots; key is write-only, stored at $DSH_HOME/.credentials.yaml |
| s03 | Pick a workspace + approve | Composer stays gray until a workspace is selected |
| s04 | First real task | Summarize this repository and identify its main packages. |
| s05 | Four presets | standard / PTC / minimal / cordis |
| s06 | Same prompt, minimal vs PTC | Two-tool baseline vs Code Mode composing tools |
| s07 | Headless one-shot | dsh --profile headless "job" |
| s08 | Plugins, lightly | dsh plugin + topic dsh-plugin; installing even one is optional |
| s09 | Official Python SDK | pip install deepseek-harness-sdk (not Windows) |
| s10 | Add capability from docs | Official docs/user/develop/basic; no source edits, no fake plugins |
| s11 | Everything is a plugin | ctx.sessions / systemPrompt / tools / agents / agentLoop / llm |
| s12 | Profile layers | dsh-base is the first layer; later layers replace whole lines |
| s13 | turn / step | Official turn cycle; pre-step; turn-stopping |
| s14 | Session log | Model-visible means logged; deriveMessages |
| s15 | Event gates | waterfall must call next(); turn-stopping is serial |
| s16 | Xiaohongshu format plugin | format.mjs + defineTool; source overlay |
| s17 | Plugin config | Schemastery Config, not a plain object |
| s18 | Bundle and install | dsh.bundle vs dsh.profile; prepare and allowBuilds |
| s19 | Three Xiaohongshu notes | Title ≤ 20 characters; course repo link |
| s20 | Preview boundary | Breaking changes coming; do not patch packages |
Developer preview. Official wording: THERE WILL BE COMPATIBILITY-BREAKING CHANGES.
Official
Copyright (c) 2026 国彬 张 / 老张教你用AI · MIT