These are my notes on the DeepSeek Harness project. I want to put its capabilities and structure on the same map: which entry points are available, what manages models, tools, and sessions, how plugins change the system, and where to begin when integrating it.
DSH covers a lot of ground. A useful way to understand it is to start with the complete system, then examine the connections between its parts. This article introduces the project and its plugin architecture, works through model context, tool environments, task coordination, and state management, and finishes with ways to use and extend it. If you are also exploring the engineering behind agents, I would be glad to hear your thoughts.
1 Project Scope: What Kind of Agent System Does DSH Provide?
Project Responsibilities: What Is Available Beyond the Model?
DeepSeek Harness, or DSH, is an open-source Agent Harness from DeepSeek. The model provides generation and decision-making capabilities; the Harness organizes model calls, tools, execution environments, context, and state so that a user's task can progress through multiple interactions and actions.
DSH provides both a ready-to-use agent application and a runtime foundation for developer integration and extension. Within a workspace, users can configure models, work with files, run commands, use web tools, load Skills, and retain interactions as Sessions. Additional capabilities for subtasks, collaboration, and automation come from the relevant plugins and their combinations.
| Need | Corresponding DSH capabilities |
|---|---|
| Connect models and organize requests | Model adapters, system prompts, and context contributions |
| Perform operations in a workspace | Files, Shell, terminals, and their execution backends |
| Use additional guidance or external services | Skills, MCP, and custom tools |
| Divide a task into multiple parts | Subagents, task boards, and workflows |
| Retain and review the work process | Sessions, persistence, projections, and queries |
| Integrate with products or automation environments | Web/Desktop, Headless, SDK, and ACP |
These capabilities come from specific combinations. The commonly used Web, Headless, SDK, and ACP runtime profiles share the base bundle; sdk-minimal uses a separate, reduced combination. Browser control, desktop operations, and other extensions also have their own providers and dependencies. After choosing an entry point, you still need to check which plugins are actually loaded. Base bundle, capability groups
Usage Forms: Who Are Web, Desktop, Headless, and SDK For?
Web provides interactive access to sessions, workspaces, model configuration, and plugin settings, making it a useful starting point for trying the complete system. Desktop packages the Web application and its Host runtime into a native application: the desktop shell manages the interface, lifecycle, and local integration, while the core capabilities still come from the same runtime system. Desktop documentation
For a one-off task, Headless is an option. To drive an agent from your own application, use the SDK. Protocol clients can connect through the Agent Client Protocol (ACP). These options change how you connect and what is assembled; the specific model and tool configuration still needs to be defined. Chapter 7 develops these entry points into practical usage paths.
Project Characteristics: How Do Plugin Combinations Determine Capabilities and Behavior?
DSH uses Cordis to organize model adapters, tools, sessions, policies, and interfaces as plugins. You can add a capability by loading its plugin, switch implementations by changing the provider, or adjust deployment behavior through the combination and its configuration. The default agent loop also participates through public interfaces.
This makes it possible to understand product features and the extension mechanism through the same structure: users select capabilities in the interface or configuration, while developers contribute implementations to the corresponding interfaces. The responsibility map below provides an overview before we examine the connections between plugins. Official architecture

Author-created capability map: entry points, plugin combinations, and runtime dependencies grouped by responsibility. The groups help explain the composition; the capabilities actually enabled depend on the selected profile, plugins, and providers.
2 Overall Architecture: How Does Cordis Assemble Plugins into a Runtime System?
Basic Objects: Plugin, Context, Service, and Dependencies
Cordis provides DSH with plugin dependencies, registration, and lifecycle management. A Plugin is a unit that contributes behavior; a Context is the runtime context through which it accesses services and registers extensions; a Service provides a stable capability interface. For example, tool plugins register tools through ctx.tools, model plugins register adapters with ctx.llm, and other parts of the system use capabilities through those interfaces.
inject declares which services a plugin needs. If its dependencies are not ready, the plugin waits for the required conditions and activates once they are established. Assembly relationships can therefore be expressed as service requirements, allowing feature code to depend on interfaces without importing a particular implementation.
A plugin can provide a service or register tools, prompt sections, policies, or interface features. A model tool is just one kind of model-facing entry point. Registrations also have a lifecycle: when a plugin exits, its registrations and listeners are disposed of, preventing old contributions from remaining in the runtime system. Cordis primer
Replacing Capabilities: How Do Interfaces, Providers, and Consumers Divide the Work?
DSH organizes replaceable capabilities into three roles: a service definition declares the interface, a Provider supplies the implementation, and a Consumer uses the service. For Shell, for example, the interface expresses execution requests and results, the provider performs the actual execution, and a model tool wraps that capability as an operation the model can call.
This division gives replacements a clear location. To move files, processes, and sandboxing to a remote system, you need compatible backends so that paths and execution belong to the same environment; consumers continue to depend on the corresponding interfaces. The SSH capability family combines remote file, subprocess, and sandbox providers in this way. SSH capability family
Scope further determines who can see a contribution: some registrations belong to the deployment, while others can be restricted to a particular Agent. Deregistration handles runtime resources. External state, such as files already written by a tool or requests submitted to a remote system, is managed according to the rules of the relevant system.
Configuration Composition: How Do Profiles, Bundles, and Patches Take Effect?
The plugin mechanism answers how capabilities connect; configuration composition answers what is actually installed for this run.
| Object | Responsibility | What to consider when using it |
|---|---|---|
| Profile | A named application composition that records bundles, dependencies, and its own configuration | Choosing the runtime form and customization entry point |
| Bundle | A distributable composition layer that supplies configuration rows and the required code | How a set of cooperating plugins is assembled |
| Patch | Overrides existing configuration rows or inserts new ones | Changing specific settings in an existing composition |
| Provider | Implements a service interface | Which backend actually supplies a capability |
The launcher starts with ordered bundles, then applies profile patches, home patches, and command-line overrides in sequence. Configuration rows are located by ID. Overriding a row's config replaces it as a whole, so any fields that need to remain must also be included. sdk-minimal is an explicitly reduced tree for integrations that need a smaller composition. Boot and configuration composition
Behavior is intercepted through events. Observation notifications and policy processing use different dispatch methods. A waterfall is a middleware chain built around next(): a listener can do work, pass control downstream, and then receive the result, or return at the decision point it owns. Tool approval, model requests, and prompt assembly can therefore share service interfaces while their respective policies determine behavior.
Runtime View: How Do Client, Host, and Connection Protocols Fit Together?
Plugin relationships also need to be placed in their actual runtime locations. The Web Client runs in the browser and handles sessions, settings, tool cards, and approval interfaces. The Host provides services, model and tool execution, and the connection layer for communicating with clients. Client plugins implement visible features, using the connection layer to obtain service state, call interfaces, and receive events. Client composition
Desktop adds management of native windows and the Host subprocess. Headless can drive a single task directly, while SDK and ACP provide programmatic or protocol boundaries. Model services, MCP servers, and remote execution environments may run in other processes or on other machines. The logical components in a diagram and their actual deployment locations should be understood separately, and configuration must point to the appropriate runtime environments.
3 Models and Context: Where Does the Information in a Request Come From?
DSH separates model connectivity from input organization. Adapters connect to specific model services, context plugins contribute instructions, background information, history, and tool descriptions, and the default driver organizes these materials into the current request. When switching models, you can reuse existing tools and sessions while adapting the input to the new model's capabilities.
Model Connectivity: How Does a Common Interface Connect Different Providers?
ctx.llm is the common entry point for model calls, providing adapter registration, a model catalog, capability resolution, and streaming calls. The DeepSeek adapter handles its own request protocol, while other adapters perform the conversions for their respective providers. Adapters also describe model capabilities, such as context window size, output limits, reasoning levels, and image input support, so that callers can prepare requests accordingly. LLM service
The default composition provides a DeepSeek connection. Users can also add supported third-party providers in Models settings or configure a custom API for a self-hosted service or gateway. Custom configuration must specify the protocol, endpoint, and model, and the declared capabilities should match the actual service. The common interface reduces integration work in higher layers; protocol conversion and model differences are still handled by the specific adapter. Model configuration

Image source: DeepSeek-AI, official model configuration guide, MIT license. Original image, unmodified.
Model selection also distinguishes the deployment default from a Session's own choice. The default model service determines which model a new session should start with; an existing session retains its selection in its own records. Changing the default mainly affects sessions created afterward. An existing session changes its model through its own operations. This allows the default on the configuration page and an ongoing task to be managed separately. Default model service
Prompt Organization: How Are System Instructions, Dynamic Background, and History Combined?
ctx.systemPrompt collects ordered prompt sections, dynamic background, variables, and tool schemas. Prompt sections form the system prompt and are suited to roles and relatively stable working guidance. Dynamic runtime information enters separately as context contributions in user-role messages with provenance. Updating the two separately helps keep frequently changing facts toward the end of the history while maintaining stable instructions at the front.
| Input material | Source and placement | How it is updated |
|---|---|---|
| System instructions | Ordered sections contributed by plugins or configuration, rendered as system messages | Changes are handled according to this step's assembly result and model capabilities |
| Dynamic background | Runtime information contributors, forming user-role context snapshots | New effective background is recorded when it changes |
| Workspace instructions | Files such as AGENTS.md and CLAUDE.md, forming instruction messages | Loaded initially, then checked according to file activity and restoration conditions |
| Skills | Available skill catalog and bodies loaded on demand | Catalog is replaced when it changes; bodies are read when invoked |
| Conversation and tool observations | Current model history projected from the Session log | Appended through interaction and adjustable through mechanisms such as compaction |
| Tool descriptions | Capabilities permitted in the current scope and step | Selected each step according to registrations and availability conditions |
Prompt contributions with the same name can override global defaults within a particular Agent's scope. Model-visible tool descriptions also correspond to the tools actually permitted in that step. An adapter may send schemas as a separate field, but DSH still includes them in the same input assembly so that tool guidance and available capabilities can work together. System Prompt
A dedicated plugin loads workspace instructions and is enabled in the default base bundle. It adds the user-level and project-level instruction chain to the first request, with project instructions ordered from broad to specific, from the root directory to the current working directory. After successful file reads, writes, or edits reach deeper directories, later requests can add newly applicable instructions. Changes and deletions are refreshed through the corresponding activity, and the baseline is checked again on resume. Discovery relies on structured file operations and does not continuously watch all external edits. The instruction chain has its own size budget; when exceeded, more specific content is prioritized. Workspace instructions
Skills and Information Reuse: How Are Guidance and Existing Materials Retrieved?
Skills divide responsibilities among a registry, providers, and consumers. The registry collects skills from different sources, the filesystem provider discovers skills in project or user directories, and tool-skill exposes the available catalog and loading tool to the model. The default base bundle loads all three parts; what they can discover depends on the actual files and configuration.
The model first receives skill names and brief descriptions. After selecting a skill, it calls skill to read the full guidance and information on using relative resources. Users can also explicitly load a user-invocable skill with /name. This keeps the catalog small and leaves scripts, references, and other resources to be read when needed. Catalog changes enter subsequent history; changes to a skill body affect its next load, while content already returned remains in the original historical record. Skills
File instructions, persistent sessions, and history queries can also support reuse across tasks. These mechanisms retain working conventions, past interactions, and searchable materials, respectively. When an external memory service is integrated, the relevant components handle fact extraction, vector indexing, and update rules. Automatic memory capabilities cannot be inferred simply from DSH saving sessions or supporting Skills.
Context Budget: How Do Large Results, Pruning, and Compaction Work Together?
The default base bundle provides token accounting, large tool-result handling, and basic compaction. Accounting assesses pressure using the actual model window and reserved output space, and the policies can be adjusted for the deployment and model. DSH can intervene at several points when input becomes too large.
When a tool returns, the spill policy can write formatted results that exceed the inline budget to a storage backend, leaving the model a preview, file location, and instructions for reading the content back. The model can then read the full material as needed, avoiding carrying large results in every request. The policy requires the corresponding backend and budget configuration; it also cannot recover content that the original tool has already truncated. Large-result spill
When context pressure triggers compaction, the tool-result pruner first tries to shorten oversized historical results, retaining the beginning, end, and a pruning marker. This step does not call the model. If further reduction is needed, the basic compactor replaces an older history range with a summary while keeping calls paired with their results and retaining recent content. A confirmed context-window overflow can also trigger compaction as a recovery action, and /compact is available when the relevant command is loaded. Original records remain in the session log; later requests use the adjusted active history. Basic compaction, tool-result pruning
4 Tools and Execution Environments: How Are Capabilities Called and Applied to External Systems?
Capability Entry Points: How Do Built-in Tools, MCP, and Custom Tools Connect?
DSH separates model-facing tool entry points from the services that perform the actual execution. The model generates a name and arguments from the tool description, and the Host executes them according to the registered definition. File operations, Shell, and web tools can use their respective services in this way.
| Capability category | Typical uses | Actual implementation and requirements |
|---|---|---|
| Files and workspace | Read, search, write, and edit artifacts | File service, working directory, and write policies |
| Shell and terminal | Execute commands and interact with persistent terminals | Platform Shell, subprocess, and PTY backends |
| Web and external services | Search, fetch web pages, and call third-party capabilities | Web provider or configured MCP servers |
| Browser and desktop | Operate pages or graphical interfaces | Corresponding providers, runtime environment, and permissions |
| Documents and office processing | Render, convert, or compute document data | Corresponding tools, engines, and dependencies |
The default base bundle selects the Shell by platform: macOS/Linux use the Bash stack, while Windows uses the corresponding PowerShell stack. The terminal service manages pseudoterminals (PTYs) with their own lifecycles. The current directory, launched processes, and permission to write files during a session are handled by the respective services. Platform tool composition
The MCP (Model Context Protocol) client registers tools discovered from external servers in the same tool system. Their public names include a server namespace to distinguish sources. Servers must actually be configured and connected; an empty scope does not produce MCP tools on its own. The current client supports tools and resources, and server instructions can enter the prompt, while MCP prompt templates are not supported. MCP client
Calling Methods: How Do Native and PTC Use the Same Tool Definition?
A tool definition covers input, execution, and output. The parameter schema describes calling requirements, execute performs the business operation, output.schema declares the canonical return value, and output.render converts the result into model-visible content. A tool can also supply a UI presentation projection, giving structured data, model text, and UI cards distinct responsibilities. Tool authoring contract
DSH provides two ways to use these definitions: Native and Programmatic Tool Calling, or PTC.
| Aspect | Native | PTC |
|---|---|---|
| Entry points directly given to the model | Schemas for each visible tool | run_code and a generated tool SDK |
| Calling form | Generate structured tool calls | Call tools.<name>(args) from a program |
| Result use | Model content rendered by the tool | The program receives the structured canonical value |
| Multi-step operations | The model makes further decisions from tool results | The program can organize calls, filtering, and aggregation |
| Main requirements | Select the Native executor | Select the PTC executor and a compatible runtime |
PTC is useful when data needs further processing between tool results: a program can extract fields, combine calls, and return the required results to the model. The same tool definition can serve both modes, so business logic does not need a second implementation just to return structured data.
The two modes use their respective executors, and calls inside PTC still pass through the shared tool pipeline. PTC changes how tools are expressed and organized; actual context usage and runtime cost also depend on the script, result size, and task. Native executor, PTC executor
Execution Control: How Do Policies, Approval, Guards, and Concurrency Work Together?
After a tool is selected, it still passes through the Host's execution controls. Pre-execution policies can allow, deny, or request approval. When approval is required, the interaction service obtains a one-time decision, after which guards must still be checked; later policies cannot relax them. Execution wrappers, result projections, and post-execution policies then handle the call and its returned content, ultimately producing the model-visible tool result.

Image source: DeepSeek-AI, Tool Execution Pipeline, MIT license. Rendered from the complete official Mermaid diagram through format conversion, preserving the original nodes and connections.
The Host also controls concurrency. Tools explicitly declare that calls may safely overlap through isConcurrencySafe(args). Eligible calls enter a bounded parallel pool, while exclusive calls form barriers. Actual execution can overlap, but pre-execution processing, results, and additional context are committed in the model's call order. This allows safe calls to execute concurrently while preserving the order of result history. Batch scheduling
Beyond execution permission, the sandbox and provider determine where an operation runs and what it can affect. DSH's process sandbox implements platform-specific restrictions on filesystem effects while sharing the current host's kernel and filesystem. Using a container or remote environment is a choice of capability provider. Remote MCP tools act on systems on the server side and must also be understood in terms of that service's permissions and behavior. Sandbox capability family
5 Task Execution: How Do Agents, Workflows, and Multiple Agents Coordinate?
Default Execution: How Do Turns, Steps, and Inputs Connect the Capabilities?
An Agent instance connects the model, context, tools, and Session. The default driver divides work into Turns and Steps: a Turn is an execution round that can advance through several Steps; each Step organizes a model request and handles the tool batch proposed by that response.
At the start of a step, the driver determines the model and available tools, assembles the prompt, and admits input. Once the model response is settled, the Host executes the tools and records their results in the session. The next step constructs model input from those records, allowing the model to decide whether to take further action or respond based on the new observations. Default driver
Inputs also enter at different points. followup queues a subsequent turn, steer adds guidance at the next step, and inject supplies context without actively waking an idle Agent. Tool feedback can drive the next step. Before a natural stop, stop hooks also run, and existing additional input or policy guidance may keep the task going. The lifecycle and loaded policies jointly organize the exact orchestration. Runtime lifecycle
Subtasks and Collaboration: What Do Subagents, Forks, and Teams Each Do?
Subagents provide separate interaction contexts for dividing work. The fresh mode starts with a new context, while fork inherits the permitted history prefix. Through provider interfaces, DSH also connects different subagent implementations, including in-process instances, another DSH, and external agents under the relevant configuration. Subagent capability family
The default creation tool first returns the identifier of a managed subagent. The parent Agent can then send messages, inspect its status, or wait for a report and use that information to advance its own task. Context inheritance, messaging, and execution environments are separate choices. Whether workspaces are shared and how the backend runs depend on the specific provider.
| Organization | What it adds | Suitable use |
|---|---|---|
| Single Agent | One primary context and execution decision-maker | Tasks with a focused scope that proceed sequentially |
| Subagents | Independent contexts, managed subtasks, and communication | Assigning separable work to different executors |
| Teams | A shared task board, owners, and dependencies on the Agent tree | Collaboration that needs explicit task-state coordination |
Once explicitly selected on the root Session, Teams provides task coordination for the same tree. Tasks can record owners, dependencies, and status, and completing dependencies affects whether later tasks are ready. Updating the task board does not itself wake idle members; explicit communication is required. writeScopes helps coordinate write boundaries, while the executors still need to handle actual concurrent file access. Agent Teams
Long Tasks and Automation: How Do Plan, Goal, Workflow, Jobs, and Schedule Divide the Work?
DSH has several other mechanisms for advancing tasks, each with a different role. Comparing them makes it easier to choose the layer you need.
| Mechanism | What it manages | Progression and lifecycle |
|---|---|---|
| Plan | Exploration, design, and plan confirmation | Provides behavioral guidance and a review process; tool permissions are configured separately |
| Goal | A goal and its progress within the same Session | An optional round driver continues work according to status and remaining goal rounds |
| Workflow | Subtask calls organized in a script | The corresponding tools and engine execute them and aggregate results |
| Jobs | Background operations started by tools | Managed by the job runtime, owner, and backend |
| Schedule | Follow-up instructions delivered at scheduled times | The running Host delivers them on schedule and saves the corresponding state |
| Webhook | Input triggered by trusted external events | Authentication adapters and registered rules convert events into session work |
Plan provides a collaborative state for discussing and confirming an approach, while execution policies continue to enforce permissions. Goal retains a goal's status and progression conditions. Automatic continuation requires the corresponding driver, an active goal, and remaining goal rounds. This round limit is managed separately from token, cost, and runtime policies. Resuming a session or creating a branch does not automatically restart the previous goal progression. Plan, Goal Driver
Workflow uses programs to organize multiple subtasks and their results. It is suited to situations requiring explicit control over aggregation and dispatch. The relevant tools, engine, and runtime are required, and script execution follows the calling session's policies. Workflow
Jobs handles long operations that have already started. For example, after a tool hands work to the background, the Agent can obtain an identifier, read output, and manage its termination. Records in jobs-local are tied to process and owner lifecycles. Schedule, by contrast, manages future instructions: schedules can be saved, but the Host must remain running, and successful delivery is only the beginning of the subsequent task. Jobs, Schedule
Webhook is an experimental extension that creates work from authenticated external deliveries and trusted rules. It is useful for connecting external events to the Harness. Durable queues, retries, deduplication, and business completion status need to be considered separately with the integrating system. Webhook
6 Sessions and State: How Are Records, Queries, and Recovery Organized?
DSH uses Sessions to retain event records of an interaction, then derives model history, interface content, and other state views from those records. Understanding this layer requires looking at session records, the workspace, and running resources together: they preserve different objects and play different roles when work resumes.
State Objects: What Do Sessions, Model History, Workspaces, and Tasks Each Preserve?
A Session uses an append-only event log. User inputs, model responses, tool calls and results, and the configuration needed to reconstruct requests each have their own records. deriveMessages() projects the log into the messages the model uses for the current round. Compaction and replacement change the active message view while retaining the original events in the log, allowing interface review and the next model input to use different ranges. Session
| Object | What it preserves | Role |
|---|---|---|
| Session log | Inputs, responses, calls, results, and related events | Reconstruct interactions and derive history and runtime state |
| Active model history | Messages produced by appending to, replacing, and projecting the log | Determine the material visible to the next request |
| Workspace files | Source code, documents, and actual artifacts | Preserve work through the filesystem and execution environment |
| Goals, task boards, and child sessions | Progress, relationships, and state managed by the relevant plugins | Organize subsequent tasks and collaboration |
| Background jobs and external data | State held by running processes or business services | Managed according to each backend's lifecycle |

Author-created state diagram: the log is projected into the current model history and saved or indexed for queries by the corresponding backend. Workspace files, processes, and business services are maintained by their respective backends.
Durable events and live notifications also serve different purposes. The interface can display streaming fragments immediately; only after a response is settled does its complete response record or failed attempt enter the log. A failed attempt can be inspected but does not necessarily become a model message. If the process is lost before settlement, fragments already displayed may not yet form a recoverable record.
Persistence and Queries: How Do Storage Backends, Projections, and Session Indexes Work Together?
The core Session service manages in-memory events and projections, while persistence plugins handle saving. The default base bundle loads a persistence backend; a custom reduced composition depends on the plugins actually present. Appending in memory, the backend accepting an append, and waiting for flush are three distinct points. A backend may batch writes, and flush supplies the persistence barrier defined by the contract. The included JSONL backend manages log files, validation, and physical writes; other backends can implement the same interface. Persistence
The query index has a separate role. The SQLite query provider uses FTS5 to build an independent derived index for full-text search, filtering, ranking, and pagination. The index can be rebuilt from session sources and is not the original session storage. Web and Desktop use this query infrastructure by default, while the session query tool exposed to the model is a separate optional experimental component. Searching history in the interface and allowing the model to query history actively depend on different consumers. Query index, model query tool
To inspect a run, you can correlate request configuration, model responses, tool calls, and results through their events, then use usage and timing information to locate costs and failures. Logs, interface progress, and telemetry each support their own forms of observation; the corresponding plugins determine how they are stored and sent.
OTel session export in the default base bundle uses FEEDBACK_ONLY: a new feedback action authorizes the log prefix that has not yet entered the export chain to be passed to the exporter, up to and including that feedback event, with context included. Later records await a new feedback authorization. DISABLED prevents collection through this path. A separate plugin enabled by default, session-log-deepseek, can contribute incremental session logs to official DeepSeek API requests; its settings are independent of OTel. These two paths illustrate why local recording and which records are transmitted must be understood for each specific route. OTel export, official API session logs
Continuation and Recovery: How Do Resume, Fork, and Missing Results Work?
Resume reopens an existing session and restores its records and projections. Fork creates a branch from a selected history prefix, writing subsequent interactions into a new session. A branch manages interaction records; workspace files, processes, and remote data remain in their respective environments.
The persistence backend and checkpoint policy are loaded separately. The checkpoint policy enabled in the default base bundle waits for the necessary records to become durable before a model request is sent, before a top-level tool executes, and at the next-step boundary. Nested calls reuse the outer call's checkpoint. If a required barrier fails, the downstream model call or tool body does not begin. Checkpoint policy
One possible result gap occurs when a tool call has been saved and the tool may have modified files, but the process exits before its result is saved. On continuation, recovery logic fills calls lacking results with TOOL_OUTCOME_UNKNOWN, preserving the uncertainty. Subsequent work can read files, inspect differences, or query external records before deciding how to proceed. Log recovery provides evidence of known interactions, while checking actual artifacts supplies the missing information about whether an action took effect.
7 Practical Usage: From Startup to SDK Integration
Interactive Use: Start the System, Configure a Model, and Select a Workspace
To use the existing system, Web is a useful starting point. In an environment with Node.js already installed, the official startup command is:
npx @deepseek-ai/dsh webThe command starts the Host and Web application and prints an address to open. On the page, configure a model provider under Settings → Models, then select a workspace and create a session. The official getting-started guide explicitly distinguishes the startup directory from workspace selection in the interface: the process has a default directory, but the new Web interface still requires a workspace to be selected before tasks can be submitted.
Model configuration can begin with a DeepSeek API key, or you can add another provider. To connect a company gateway or self-hosted service, use the Custom model API form and enter the Provider ID, Base URL, API protocol, credentials, and model. The protocol must match the actual endpoint. An address compatible with OpenAI Chat Completions does not necessarily support Responses or other protocols. Requests and sessions refer to the Provider ID, so this identity relationship must be preserved when changing the display name or endpoint later. Model configuration guide

Image source: DeepSeek-AI official custom model API configuration interface, model configuration documentation, MIT license. Official original image.
After model configuration is saved, the changes take effect in subsequent requests. Before starting a task, you can also open Plugins in the sidebar to inspect the current profile's plugins and bundles and confirm that the required capabilities are enabled. The plugin list in Settings is primarily for viewing; management takes place on the Plugins page. Whether plugin configuration is applied immediately depends on whether HMR is enabled in the current composition. Plugin management
The same composition also determines tools and execution environments. The MCP client plugin connects external tool services, Skill sources depend on their providers and directory configuration, and file, Shell, and terminal backends determine where actions actually occur. Session permissions further constrain the use of those capabilities. For a first task, you can submit something with a clear scope, such as reading a project's structure and explaining its main modules, then inspect the tool records to see which capabilities were used.
Session Modes: How Should You Choose Standard, PTC, Minimal, or Create?
After opening Desktop or Web, you can choose an Agent preset for a new session. The preset determines which tools the Agent can see, how it calls them, and which prompts and skills it loads. The interface presents these built-in presets as four modes.
| Session mode | How the Agent uses tools | Suitable tasks |
|---|---|---|
Standard (standard) | Directly selects registered tools such as file reading and writing, search, and Shell through native tool calling | Everyday document work, project exploration, and routine code changes |
PTC (ptc) | Runs TypeScript through run_code, placing tool calls and the filtering and aggregation of intermediate results in the same program | Collecting and processing data in batches across files or tools, reducing the need to return intermediate results to the model item by item |
Minimal (minimal) | Primarily uses a persistent Shell, retaining image-reading and working-directory capabilities and supporting automatic history compaction. Text file operations use the Shell | Programming tasks that mainly rely on command-line tools |
Create (cordis) | Loads plugin-development tools and skills to inspect runtime components, write plugins, or define custom Agent presets | Adding business tools, customizing the interface, or configuring an Agent for a particular task |
Enable Coding tools under Settings → General to show PTC and Minimal in the new-session selector. You can choose a mode for an individual new session or set the default under Settings → Agent presets. Sessions already started retain the mode chosen when they were created. Permission presets and approval policies separately determine file-access scope and approval behavior. Session mode interface documentation · CLI runtime composition reference · PTC executor
Entry Points: How Do You Choose an Interface, Command Line, or Programmatic API?
An entry point determines who submits tasks to the Harness and which interface or protocol receives the results. Take Minimal as an example: choosing Minimal mode in Desktop or Web changes the tool combination for a single session. Starting the application with sdk-minimal selects an entire separate runtime profile.
| Entry point | How to start or connect | Suitable scenarios |
|---|---|---|
| Desktop | Install and open the official desktop application, which starts the Host internally | Manage workspaces, continue sessions, review progress, and handle approvals on the desktop. Official installers are available for 64-bit Windows and macOS on Apple silicon |
| Web | Start the Host with npx @deepseek-ai/dsh web or dsh web, then open the interface in a browser | Interactive browser use with an environment you configure for the Host |
Headless (headless) | Submit one task through the CLI or standard input; the process exits after producing output. --json emits runtime events line by line, and --session-id can continue a saved session | Shell scripts, CI, or other one-off command invocations |
SDK (sdk) | An SDK client drives the runtime through stdio JSON-RPC, allowing the program to handle sessions, events, and interactions | Embed the Harness in your own application with the tools and settings supplied by the full profile |
SDK Minimal (sdk-minimal) | Uses the SDK protocol to start a separate reduced profile with persistent Shell, image reading, session persistence, and automatic compaction | Begin integration in your application with a small set of foundational capabilities |
ACP (acp) | Run dsh acp and connect over stdio from a client that supports the Agent Client Protocol | Use the Harness as an Agent backend for ACP-compatible editors or other clients |
For example, a script can obtain a task's output with dsh --profile headless "说明当前项目的主要目录". To display tool execution events in your own product, an SDK client can receive session events. Official desktop downloads · CLI entry points · SDK Minimal documentation
The following example uses the Python SDK. After installing deepseek-harness-sdk, prepare credentials for the selected provider. The default DeepSeek route can use DEEPSEEK_API_KEY from the environment. The example uses the current directory as the workspace and explicitly selects a Harness home:
from pathlib import Path
from deepseek_harness import DeepSeekHarness
with DeepSeekHarness(
dsh_home=str(Path("./.dsh-sdk-example").resolve()),
cwd=str(Path.cwd()),
profile="sdk",
provider="deepseek-official",
model="deepseek-v4-flash",
) as harness:
result = harness.run(
"只读查看当前工作目录,说明主要文件与目录的用途。",
session_id="project-overview",
)
print(result.final_response)DeepSeekHarness manages the runtime connection, and run() submits input and collects the result of that activity. The same instance can be reused, and the context manager closes it when finished. Along with the final text, the returned RunResult contains the stop reason, root-session events, and relevant notifications, which an application can use to organize its interface and processing logic. The selected composition must supply the provider and model used in the example. Before changing a model name, the corresponding adapter and route must be available. Python SDK and API documentation
If a task asks the user a question or triggers approval, the application must supply those interactions as well. The SDK can receive native questions through on_user_question. When client approval requests are enabled, request-handling logic must run concurrently and respond while the task waits. These interactions occur during task execution and cannot wait until after run() returns.
Processes and Data: How Does the SDK Client Drive the Harness Runtime?
The Python SDK communicates with the DSH runtime in a subprocess through newline-delimited JSON-RPC over stdio. The runtime wheel included at installation packages the ordinary dsh CLI and Node dependencies into a platform-specific executable, so this SDK path does not require a separate system Node.js installation. The selected profile still handles actual model calls, tool execution, and persistence. Runtime packaging
Two directories need to be distinguished. cwd points to the Agent workspace; dsh_home points to the Harness's own configuration and persistent resources, including profiles, plugins, and the corresponding session data. The Python SDK requires an explicit home, which can also come from DSH_HOME in the subprocess environment, and does not silently use the default user directory. Separate homes for different applications allow their configuration and data to be organized independently. Model services, remote tools, and external databases still run according to their own connection settings.
The full SDK's user configuration lives at $DSH_HOME/profiles/sdk/cordis.patch.yml, while the profile's package.json records external plugin dependencies and the ordered bundle list. The former determines how configuration rows are overridden; the latter determines which code can be loaded. To inspect a composition, use dsh --profile sdk --dump-config to view the final configuration tree and check whether a target plugin is present, disabled, or changed by later overrides.
For continued use, the application should retain the session ID. Within the same runtime, it can submit more input to the same session. To continue from saved records, use resume_session() and preserve the corresponding home and workspace conditions. Reading session state and restoring external execution environments follow the distinctions described in Chapter 6.
Customization uses the same entry points. Install long-term extensions in the profile; for temporary combinations, pass patches to the SDK to layer configuration files in order. A patch selects which components are enabled, while plugin packages supply the actual code, and the runtime environment must contain those packages and their dependencies. Installing or updating external plugins may require pnpm, but ordinary SDK calls do not therefore require the application to run a package-management process at every startup.
8 Plugin Extensions: Understanding Customization and Design Trade-offs Through One Tool
Plugin Sources: How Do the Official Catalog, Discover Page, and Community Plugins Connect?
To use existing plugins, start with Plugins in the sidebar. The official catalog lists plugins shipped or designated by DeepSeek, Discover reads indexes that you add, and the Community Plugins link on the official website takes users to GitHub to find third-party projects.
| Entry point | Who provides the content | How to enable or install | Links |
|---|---|---|---|
| Official plugin catalog | A list maintained by DeepSeek with the distribution, including configurable built-in components, optional features disabled by default, and components downloaded on demand | Configure built-in components directly, enable optional features on the Plugins page, and install on-demand components from their official entries. For example, the Codex and Claude Code entries provide DSH subagent integration plugins | Official catalog usage · Official plugin list source |
| Discover | DSH provides the browsing interface; team or community indexes added by users supply the actual entries | Appears after enabling Custom plugin indexes among the experimental plugins. Add a JSON index URL or a Git repository containing index.json to search, inspect, and install its plugins | Enable Discover · Add indexes and install |
| Community plugins | Independently maintained by third-party authors. The DeepSeek website links to GitHub's dsh-plugin topic to help users find repositories | Follow the author's documentation and enter an npm package name, Git URL, archive, or local absolute path in Add plugin. If the maintainer also provides an index, add it to Discover and install from there | Browse GitHub community plugins |
Discover has no preconfigured indexes by default. A GitHub topic is for browsing tagged repositories; Discover requires an index file containing installation information. For example, a team can maintain index.json in a Git repository to list frequently used plugins for colleagues. After a colleague adds the repository in Discover and selects a plugin, installation is handed back to the plugin manager and recorded in the current profile. The same plugin can also be added directly by package name.
A Minimal Tool: How Do Registration, Parameters, Results, and Disposal Fit Together?
A minimal plugin is enough to connect the Context, dependencies, and registration relationships introduced in Chapter 2. The official greet tutorial simply accepts a name and returns a greeting, without file or network dependencies, making it useful for understanding the tool contract. The following TypeScript module can be placed in scratch-plugin/src/my-plugin.ts in a source checkout:
import type { Context } from '@deepseek-ai/cordis'
import { defineTool } from '@deepseek-ai/dsh-tools'
export const name = 'greet-tool'
export const inject = ['tools']
export function apply(ctx: Context) {
ctx.tools.register(defineTool({
name: 'greet',
description: 'Greet someone by name.',
parameters: {
name: { type: 'string', required: true },
},
output: {
schema: { type: 'string' },
render: (_args, value) => [{ type: 'text', text: value }],
},
async execute(args) {
return `Hello, ${args.name}!`
},
}))
}inject makes the plugin wait for the tool registry service to become ready; apply then registers the capability through ctx.tools. defineTool infers argument types from parameters and validates model-generated arguments before execution. execute returns the canonical value declared by output.schema, a string in this case, and output.render turns that value into model-visible content blocks. When a result object contains fields such as IDs and status, the tool can likewise return a structured value first and then produce a readable explanation for the model. Official tool tutorial
Different executors can reuse the same definition. Native mode gives the model the tool schema, while PTC generates programmatic entry points for visible tools. PTC receives the canonical return value, making further filtering or data combination easier. The business implementation remains in the same execute. If a tool starts using network connections or other asynchronous resources, it should also respond to cancellation signals in the execution context and enforce business constraints that the schema cannot express. Tool authoring contract
In a source checkout where dependencies have been installed and the build completed, create scratch-plugin/cordis.yml to insert this local module:
- insert:
- id: greet-demo
name: '/absolute/path/to/deepseek-harness/scratch-plugin/src/my-plugin.ts'Replace the path with your local absolute path and start with pnpm dsh web --patch ./scratch-plugin/cordis.yml. The patch file does not change the base directory for module resolution, so an absolute path is retained here. In a session, ask the model to call greet to greet Ada and inspect the arguments and returned result. First plugin tutorial
Tools and listeners registered through Context are removed when the plugin unloads. If a plugin creates its own connections, timers, or other resources, it should register cleanup through lifecycle interfaces such as ctx.effect() so that those resources can be released when the component is disabled.
Extension Points: Replacing Providers, Adding Policies, and Combining Plugins
Tools are only one form of extension. Before customizing the system, decide whether you need to change a model-visible capability, an underlying implementation, or an execution rule, then choose the corresponding entry point.
| What needs to change | Preferred extension point | Main work |
|---|---|---|
| Add a business query or operation | Tool plugin | Define parameters, canonical results, and business execution logic |
| Connect an existing capability to a different environment | Service Provider | Implement the existing interface and configure the chosen provider |
| Add pre-execution checks or call observation | Policies and event listeners | Follow the event contract to add checks, wrappers, or final-result observation |
| Select different tools and backends for a specific task | Profile, bundle, or Agent preset | Combine plugins, dependencies, and their configuration |
| Add an interface entry point or result display | Client plugin and corresponding Host service | Organize the interface, protocol calls, and server-side capabilities |
When a capability needs an independently replaceable implementation, it can be split further into a service definition, provider, and consumer. In the official Shell example, dsh-shell defines the request and result interfaces, dsh-bash-local provides local execution, and dsh-tool-bash exposes the interface as a tool. Consumers continue to depend on the same contract when the provider changes. A simple tool can remain in a single package. Three-role capability design
The scratch example above is for source development. In an installed product, persistent extensions are usually installed into the target profile through plugin management or dsh plugin --profile <name> ..., then participate in composition through its bundles and patches. Adding a workspace package inside the repository also involves package dependencies, builds, and whether it belongs on the Host or Client. The adding a package guide covers that work; registering a simple tool does not require first changing the entire repository.
Interface extensions follow the same division: the client contributes controls and presentation, while capabilities involving models, files, or task control come through the corresponding Host services. Plugins can therefore change both what an Agent can call and how users observe and operate it.
Adoption Decisions: What Benefits and Costs Come with Flexible Composition?
Using Web or Desktop directly lets you reuse the project's existing workspace, session, and tool interactions. For application integration, choose the SDK and connect inputs and results to your own program. When custom capabilities are needed, add tools, replace providers, or introduce policies. These needs involve different amounts of work, so you can start from an existing composition and adjust it as actual requirements emerge.
More ways to compose the system make clear configuration ownership more necessary. Users need to know whether a behavior comes from the default bundle, a profile patch, or a higher-priority override. After changing a model, execution backend, or plugin, they also need to confirm that capabilities, credentials, and dependencies still match. Host plugins run in-process, so plugin sources and dependency code are themselves part of the adoption decision.
Runtime and data maintenance also need to be planned: who keeps the Host available, where configuration and sessions are saved, and how workspace and remote artifacts are retained. Actual costs also include models, external tools and optional services, execution environments, and maintenance effort. A plugin architecture does not replace assessing those costs.
The project is still officially described as a developer preview, with an explicit possibility of incompatible changes. Adoption should include managing DSH, external plugins, and their dependencies together, retaining your profiles and patches, and reading the relevant upgrade notes to check for changes to interfaces and persistence formats. How much repeated development DSH's composition capabilities can save depends on how well the existing components fit the task and how much configuration, plugin, and upgrade maintenance a team is willing to take on. Official project documentation

