
Deepseek Agent Harness & its Patterns (openSource)
DeepSeek open-sourced a full coding agent harness for free that directly replaces Claude Code's $200 a month plan.
Everything is a plugin, model adapters, tools, session logs and the agent loop itself, all swappable from config
Here are Patterns from DeepSeek's Agent Harness
1. Log-derived context, not maintained state
Session is an append-only event log. The harness recomputes every model request from it at call time. A check diffs each outgoing request against a fresh derivation and throws log-reconstruction desync on mismatch.
To port: append the event first, build the request from what you appended, add the equality check in dev.
2. Break loops with reminders, not blocks
A plugin counts consecutive identical tool calls. At 3, 5, and 8 it injects a firmer reminder instead of blocking. Denied calls count as repeats too. Each agent tracks its own counter.
On Claude Code, hooks cover this.
3. Disclose what got cut
File search caps at 100 but samples across the project, flags the result as truncated, and writes the full list to a file with the path. Sandbox denials say explicitly: policy denial, not a bug, don't retry another way.
4. Permissions apply inside code execution too
One tool, run_code. Every other tool becomes a callable function inside the program the model writes. Every call still routes through the full permission pipeline, and the harness logs it individually. Denials surface as catchable errors, not silent nulls.
5. Restart the context, keep the workspace
Fixed objective, fresh agent each round, zero conversation history. Handoff between rounds: status, summary, evidence, next steps, blocker. Agent can't declare itself blocked before three rounds. Only a human sets the objective.
npx @deepseek-ai/dsh web
Plugin layer: ~/.dsh/profiles/web/cordis.patch.yml, disable the row with id ui-sidebar, reload.