DeepSeek Harness Source Code Analysis: Prompt as a Runtime
dotey · x · 2026-08-14
The author deeply analyzed the DeepSeek Harness (DSH) source code, revealing that its core philosophy shifts away from static System Prompts towards a dynamic Prompt Runtime.
Core Architectural Designs:
- Modular Capabilities: Capabilities are split into Implementation + Interface + Model-facing Instructions. Each tool (like shell, filesystem) carries its own prompt instructing the model on its usage.
- Scoped Prompts: Divided into Global Prompt → Agent Scope → Agent-specific Override, acting like dependency injection for prompts.
- State/Instruction Separation: Explicitly separates stable Instructions, dynamic Runtime Context (e.g., cwd, git status), and Tools.
Comparison with Pi:
- Pi: Focuses on a minimal core where users assemble capabilities.
- DSH: Aims to pluginize almost everything, providing official, complete combinations.
Hardcore Session Mechanism:
- Built on the Cordis plugin loader, emphasizing reversible side effects (auto-cleanup on unmount) and spatial composability.
- Model adapters, tool registries, the agent loop, and even the UI are all plugins. There is no sacred, unmovable core.
- Sessions are append-only event streams. The model's final visible context must be entirely reconstructable from this log.
More from coding & agent
- Dev shows agents auto-verifying and sending SAFE fundraising docs in parallel — Scobleizer · 2026-11-30
- Ex-Citadel MD: AI will automate equity long-short workflows within 3 years; job seekers should build eval suites — _AustinCalvert_ · 2026-11-30
- Why Google bans users: wrapping Gemini CLI in Claude Code violates consumer ToS — thomasahle · 2026-11-30
- After two Claude account bans, a dev switches to Google AI and moves his Anthropic stock bets to Google — yangyi · 2026-11-30
- Antigravity remote control may not be enabled for enterprise accounts — gharik · 2026-11-30
- How Much Agent Swarm Hype Is Just Distributed Systems Rediscovered? — edgarpavlovsky · 2026-11-30