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

LessonOne line
s01One loop + bashpython s01_run_dsh/code.py; product entry is still npx @deepseek-ai/dsh web
s02Settings → models + KeyOfficial screenshots; key is write-only, stored at $DSH_HOME/.credentials.yaml
s03Pick a workspace + approveComposer stays gray until a workspace is selected
s04First real taskSummarize this repository and identify its main packages.
s05Four presetsstandard / PTC / minimal / cordis
s06Same prompt, minimal vs PTCTwo-tool baseline vs Code Mode composing tools
s07Headless one-shotdsh --profile headless "job"
s08Plugins, lightlydsh plugin + topic dsh-plugin; installing even one is optional
s09Official Python SDKpip install deepseek-harness-sdk (not Windows)
s10Add capability from docsOfficial docs/user/develop/basic; no source edits, no fake plugins
s11Everything is a pluginctx.sessions / systemPrompt / tools / agents / agentLoop / llm
s12Profile layersdsh-base is the first layer; later layers replace whole lines
s13turn / stepOfficial turn cycle; pre-step; turn-stopping
s14Session logModel-visible means logged; deriveMessages
s15Event gateswaterfall must call next(); turn-stopping is serial
s16Xiaohongshu format pluginformat.mjs + defineTool; source overlay
s17Plugin configSchemastery Config, not a plain object
s18Bundle and installdsh.bundle vs dsh.profile; prepare and allowBuilds
s19Three Xiaohongshu notesTitle ≤ 20 characters; course repo link
s20Preview boundaryBreaking changes coming; do not patch packages

Developer preview. Official wording: THERE WILL BE COMPATIBILITY-BREAKING CHANGES.

Official


Copyright (c) 2026 国彬 张 / 老张教你用AI · MIT