{"slug": "deepseek-harness-from-your-files-to-the-model", "title": "DeepSeek Harness: From Your Files to the Model", "summary": "DeepSeek published DeepSeek Harness (dsh) 0.2.2-rc.5, an open-source agent harness under the MIT license as a developer preview, started with a single npx command. Testing against a fake local model server showed the harness keeps no index or embeddings, opens project files only through model-issued tool calls such as grep, glob and read, and sends requests straight from the user's machine to whichever inference host is configured, with DeepSeek out of that path unless a DeepSeek key or sign-in is used. The DeepSeek API connector adds a copy of the session log to requests by default while connectors for other providers do not, and the agent loop, file access, shell and session history all run locally.", "body_md": "# DeepSeek Harness:\n\nFrom Your Files\n\nto the Model\n\n        DeepSeek Harness (`dsh`) is an open-source agent harness you start with one\n        `npx` command. This article follows your code through it: who decides which\n        files to open, what leaves your machine on each request, and how that changes when the\n        model runs on Fireworks, Baseten, or Modal instead of at DeepSeek.\n      \n\n        A model takes in text and produces text. It remembers nothing between requests and can't\n        touch your files. A **harness** is the program around it that supplies the rest.\n        It builds the context for each request, keeps the session history, chooses which tools to\n        offer, runs the calls the model makes within the permissions you set, and repeats until the\n        task is done. The harness sets what the model can see and do. The model decides what to do\n        next.\n      \n\n        Claude Code and Codex are harnesses. So is [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness),\n        which DeepSeek publishes under the MIT license as a developer preview.\n        This article looks at it through three questions that come up when you let a harness work on\n        your own code.\n      \n\n## Three Questions\n\n        The questions come from where a harness sits, between your code and a model. Which files does\n        it open? Where do their contents go? How much of it runs on your machine? The next two\n        sections cover the parts of `dsh` and follow one complete run, and the three after\n        that take one question each. Figure 1 shows the whole system those sections zoom into.\n      \n\nThree colors mark location in every figure: your machine, model host (whoever runs inference), and vendor cloud (other services from the harness maker, such as search or sign-in).\n\nHere are the same three questions with their short answers.\n\nIt doesn't. The model asks, one tool call at a time. `dsh` keeps no index\n            and no embeddings. It loads instruction files such as `AGENTS.md` by itself.\n            Other project files are opened by tools the model calls, usually `grep`,\n            `glob`, and `read`.\n\n[Full answer: How It Decides What to Read](#reading)\n\nStraight from your machine to that host. DeepSeek is not in that path, but a\n            web search by the model goes to DeepSeek if you have a DeepSeek key or sign-in. Requests also get smaller, because the part of\n            `dsh` that talks to DeepSeek's API adds a copy of your session log by default,\n            and the part for other providers doesn't. Signing in to a DeepSeek account or\n            submitting feedback also contacts DeepSeek.\n\n[Full answer: Swapping the Model Host](#hosts)\n\nThe loop, file access, shell, and session history all run on your machine. The only\n            required remote part is a model endpoint, and that can be your own server. Codex and\n            Claude Code are built the same way, then add hosted runs that `dsh`\n            doesn't ship.\n\n[Full answer: Local, Host, or Cloud](#placement)\n\n        Because the source is open, these answers can be checked. For this article,\n        `dsh` 0.2.2-rc.5 (the `latest` release on npm) ran in a small test\n        project with made-up API keys, and every provider's address was pointed at a fake model server\n        on localhost. The byte counts below are the sizes of the requests that server received. No\n        provider was contacted, so they show what `dsh` sends and nothing about how a\n        provider responds. Other claims come from the source code or vendor docs, linked in the text\n        or in the references.\n      \n\n## The Pieces on Your Machine\n\n        Running `npx @deepseek-ai/dsh web` starts a Node process that serves a web page\n        at `127.0.0.1:3080`. The browser tab is a client and the Node process is the\n        server, but both are on your machine. Nothing about that split involves a cloud. The same\n        process also runs without a page, as a one-shot command (`headless`) or behind\n        a TypeScript or Python SDK. Figure 2 opens up that process.\n      \n\n### Session log, steps, and turns\n\n        A **step** is one model request plus the tools it calls. A **turn**\n        is the run of steps that answers one of your messages. Everything that happens is appended\n        to a **session log**, and the history sent to the model is computed from that\n        log. The project holds itself to a strict rule here:\n      \n\nThat rule is why resume, fork, and replay work. It also means the log holds everything the model saw, including file contents and command output, which matters once we look at where the log goes.\n\n### Tools and permissions\n\n        A model can't open a file or run a command itself. It can only reply. So the request\n        in each step carries a list of **tools**, which are actions `dsh` can run for it,\n        such as `read`, `grep`, `write`, and `bash`. To\n        use one, the model replies with the tool's name and its inputs. That reply is a\n        **tool call**:\n      \n\n```\n{\n  \"name\": \"read\",\n  \"input\": { \"file_path\": \"src/pricing/discount.js\" }\n}\n```\n`dsh` runs the tool and puts the result in the next request. These are stages 3\n        and 4 in Figure 2. Since every action passes through `dsh`, it can refuse one.\n      \n\n        Two settings decide what it refuses. The **sandbox mode** limits which files a\n        tool can change: none (`read-only`), those in your project and temporary folders (` workspace-write`), or any\n        (`danger-full-access`). The **approval policy** covers a call that\n        needs more than the sandbox mode allows. With `ask`, you get to approve or reject\n        it. With `never`, it is rejected without asking you. New sessions start with\n        `workspace-write` and `ask`.\n      \n\n### How a plugin works\n\n        The four boxes inside `dsh` in Figure 2 are each a\n        **plugin**. The [architecture document](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.2-rc.5/docs/architecture.md)\n        says every part of the product is one. A plugin is a package of code with a setup function, usually called\n        `apply`. (Some core plugins, such as `tools`, use a class constructor\n        instead.) When `dsh` loads the plugin, it runs that function and passes in an\n        object, `ctx`, that connects the plugin to the others. Through `ctx`, a plugin can do three things:\n      \n\n- **Provide something others use.** The`tools` plugin provides the\n          tool list, which other plugins reach as`ctx.tools` .\n- **Add to what another plugin provides.** The`tool-fs` plugin\n          adds file tools such as`read` ,`write` , and`edit` by calling`ctx.tools.register` .\n- **Respond to an event.** As`dsh` works, it announces events such\n          as \"a step is about to start\" or \"a tool has returned\". With`ctx.on` , a plugin\n          registers a function to run each time one happens.\n\n        Events are how something can happen without the model asking for it. A tool runs because the\n        model called it. A function registered for an event runs because `dsh` reached\n        that point. The `agent-instructions` plugin works this way. It loads\n        `AGENTS.md` files, which hold instructions for agents, mainly through two events:\n      \n\n```\n// simplified from agent-instructions\nexport function apply(ctx, config) {\n  // before each step\n  ctx.on('agent/pre-step', (step, next) => {\n    // read AGENTS.md files not sent yet\n// add them to this step as a message\n  })\n  // after each tool call\n  ctx.on('tools/result', (call, result) => {\n    // after a read, write, or edit, note the\n// file. When the step ends, check its\n// folder for AGENTS.md\n  })\n}\n```\nIn order, this is what happens:\n\n1. **The plugin loads.**`apply` registers the two functions. No\n          instruction file has been read yet.\n2. **You ask a question.** Before the first step, the agent loop announces`agent/pre-step` and waits. The first function reads the`AGENTS.md` files from disk and hands back a message with their contents. The\n          loop writes that message to the session log, so it is part of the first request.\n3. **The model calls `read`.** When the tool returns,` tools/result` is announced, and the second function notes which file was read.\n          When the step ends, the plugin checks that file's folder. If there is an`AGENTS.md` the model hasn't seen, it is queued for the next step.\n\n        The loop doesn't know which plugins are listening, so one can be removed without touching the\n        rest. In a test run with `agent-instructions` turned off, no\n        `AGENTS.md` was sent and nothing else in the requests changed. Other plugins\n        that come up in this article connect in the same ways:\n      \n\n| Plugin | What it does | How it connects | \n|---|---|---|\n| `tool-fs` | Adds file tools such as `read` ,`write` , and`edit` | Adds to the tool list | \n| `llm-pi-ai` | Sends requests to hosts such as Fireworks | Adds to the model adapters | \n| `session-log-deepseek` | Copies the session log into requests to DeepSeek | Adds a field to those requests | \n| `session-title` | Sets the session's title, which a second plugin, `session-title-llm` , asks the model for | Event: your message was logged | \n| `compaction-basic` | Summarizes old history when it gets too long | Event: a step is about to start | \n\n### Profiles and presets\n\n        The framework that loads plugins and passes events between them is called\n        [Cordis](https://github.com/cordiverse/cordis). It needs to be told which plugins\n        to load and with what settings. That is a list, written in YAML.\n      \n\n        A **profile** is a named version of the list, one for each way of running\n        `dsh`: `web` for the browser app, `headless` for the\n        one-shot command, `sdk` and `acp` for other programs to drive it. The\n        `web` and `headless` lists start from the same 99 entries. Then\n        `web` adds 103 for the browser app, and `headless` adds 2. The\n        `--dump-config` flag prints a profile's list without starting anything. Here are\n        4 of the 202 entries in `web`, with comments added:\n      \n\n```\n$ dsh --profile web --dump-config\n# the session log\n- id: session\n  name: '@deepseek-ai/dsh-session'\n# copies that log into requests to DeepSeek\n- id: session-log-deepseek\n  name: '@deepseek-ai/dsh-session-log-deepseek'\n# which model to start with\n- id: agent-default-model\n  name: '@deepseek-ai/dsh-agent-default-model'\nconfig:\n    provider: deepseek-official\nmodel: deepseek-flash\n# calls DeepSeek's API with your key\n- id: llm-deepseek\n  name: '@deepseek-ai/dsh-llm-deepseek-api-key'\n```\n        Each entry is one plugin. `name` is the package to load, `config` holds\n        the settings passed to its setup function, and `id` is the label you use to\n        change the entry. Entries can load in any order, because each plugin declares what it needs and\n        Cordis waits until that is available. You don't\n        edit this list directly. Your changes go in a separate patch file for that profile, and\n        `dsh` applies them on top. For example, this turns off the session log copy:\n      \n\n```\n# ~/.dsh/profiles/web/cordis.patch.yml\n- id: session-log-deepseek\n  config:\n    enabled: false\n# the entry that --dump-config prints afterwards\n- id: session-log-deepseek\n  name: '@deepseek-ai/dsh-session-log-deepseek'\nconfig:\n    enabled: false\n```\n        An edit replaces the entry's whole `config`, so include any settings you want to\n        keep. [Swapping the Model Host](#hosts) uses the same file to add Fireworks,\n        Baseten, and Modal.\n      \n\n        In the web profile, a **preset** picks what one agent can do. It is a second,\n        shorter list of plugins that load for that agent only. The default, `standard`,\n        has the usual tool set. `minimal` leaves out the text search, read, and edit tools and\n        gives the model a shell. It also leaves out `agent-instructions`, so\n        `AGENTS.md` isn't loaded. The same harness can behave quite differently from\n        session to session.\n      \n\n### Routes and adapters\n\n        A **route** is a provider name plus a model, such as\n        `deepseek-official` with `deepseek-flash`. An **adapter**\n        turns a step into an HTTP request for that route. `dsh` has two kinds: its own\n        DeepSeek adapter, and one backed by\n        [pi-ai](https://github.com/earendil-works/pi), the provider library from the\n        [pi agent](../pi-agent/), for every other route. DeepSeek is also one of the\n        providers pi-ai knows, so its API can be reached through either one. Which of the two handles\n        your request decides most of what leaves your machine.\n      \n\n## One Question, Start to Finish\n\n        The test project had four small files: two JavaScript files and two `AGENTS.md`\n        files. The one at the root said to use tabs and run\n        `npm test` before finishing. The one in `src/pricing/` said \"Never\n        round inside this folder.\" The question was \"Where is the discount logic?\" The fake model\n        was scripted to search first, then open one file, then answer, which is how a real model\n        usually handles a question like this.\n      \n\n### What left, and when\n\nFour requests left the machine, in this order:\n\n- **Request 1, 24.9 KB**  - Sent: the system prompt, the question, the root `AGENTS.md` , the working\n              directory path, the sandbox policy, and 23 tool definitions. The tool definitions are\n              20.5 KB of it.\n  - Not sent: source code, a file listing, or git status.\n- Sent: the system prompt, the question, the root \n- **Title request, 0.8 KB**  - Sent: your first message and a short instruction, asking the same model for a session title.\n  - Not sent: anything from the project.\n- **Request 2, 25.6 KB**  - Added to request 1: the model's `grep` and`glob` calls and\n              their results.\n  - This is the first source code to leave. A `grep` result includes the\n              matching lines, so three lines of code were sent before any file was opened.\n- Added to request 1: the model's \n- **Request 3, 26.5 KB**  - Added to request 2: the model's `read` call, all of`discount.js` , and`src/pricing/AGENTS.md` .\n- Added to request 2: the model's \n\n        The model never asked for `src/pricing/AGENTS.md`. `dsh` added it\n        because the model had just read something in its folder, with a note that the instructions\n        apply to work under `src/pricing` and take precedence over broader ones. It made\n        no difference to this question, but if you next asked for a change to the discount, the model\n        would already know not to round.\n      \n\n        These sizes are from the one-shot `headless` command. The same question asked in the\n        web app sent more. Its first request was 41.5 KB and had 31 tools, and it also carried the\n        local time and time zone, a list of available skills, the folder `dsh` is installed\n        in, and the address of the web page.\n      \n\n### How a result gets into the next request\n\n        Two parts of `dsh` build each request. Prompt assembly supplies the system prompt\n        and the list of tools. The session log supplies the messages. A tool feeds both, in different\n        ways: its definition goes to prompt assembly, and its results go to the log.\n      \n\n        So when `grep` returned in the recorded turn, prompt assembly wasn't involved. The\n        result was written to the log, and the loop started another step because the model still had\n        to see it. The messages read back from the log now ended with the model's call and its\n        result. In the captures from the DeepSeek, Fireworks, and custom routes, the system prompt\n        and tool list were identical in all three steps, and each step's messages were the previous\n        ones with new ones added at the end. An unchanged beginning also lets a host reuse cached\n        work.\n      \n\n        A plugin can also add a message of its own. That is how `src/pricing/AGENTS.md`\n        arrived in the third request. `agent-instructions` saw that `read` had\n        returned and queued the file for the next step, where it was recorded as a message separate\n        from the `read` result.\n      \n\n### Every step resends the history\n\n        The API is stateless, so each step sends the whole history again, rebuilt from the local\n        log. That is why the requests in Figure 3 grow from 24.9 to 26.5 KB. When the history\n        nears the model's limit, at 80% of the context window at the latest, a plugin asks the model the\n        session last used to [summarize\n        the older part](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.2-rc.5/packages/compaction/compaction-basic/README.md) and keeps the newest messages as they were, up to about 16% of the window.\n      \n\n## How It Decides What to Read\n\nThere is no retrieval system to describe. A search of the source tree finds no embedding model, no vector index, and no repository map. The model decides, and the harness shapes that decision in four ways: what it loads up front, which tools it offers, what it tells the model about them, and how much each call may return.\n\n### What loads before the model speaks\n\n        The [`agent-instructions`](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.2-rc.5/packages/context/agent-instructions/README.md)\n        plugin reads files before the model has asked for any, because it runs when a step is about to\n        start ([How a plugin works](#plugins)). It finds the project root by walking up to the nearest\n        `.git`, then loads the `AGENTS.md` and `CLAUDE.md` files,\n        and their `.local.md` versions, from there down to your working directory. Without a\n        `.git` it looks only in the working directory. A personal `AGENTS.md` in\n        `~/.dsh` or `~/.agents` loads first. The project files and the personal files each get a 64 KiB\n        budget, and when a group is over budget the broadest files are dropped first. Instruction\n        files in deeper folders load only after the model uses `read`,\n        `write`, or `edit` on something in or below that folder, as in Figure 3.\n        A `grep` match there doesn't count, and neither does a `bash` command.\n      \n\n        Two things look like file loading and are not. Typing `@src/app.ts` in the web UI\n        completes a path, and the docs are explicit that choosing one \"never reads or attaches file\n        contents\". Skills work in a similar way: the model sees their names and descriptions, and a\n        skill's body loads only when it asks for it or you type `/` and the skill's name.\n      \n\n### Search first, then read\n\n        The default prompt tells the model to use `glob` to find files by name,\n        `grep` to search contents, and `read` to open a match. It also says not\n        to do these jobs with shell commands such as `find`, `rg`, or\n        `cat`, which the model could run through the `bash` tool.\n      \n\n        These are instructions to the model and nothing enforces them. A plugin that would require\n        reading a file before editing it exists, and the shipped configuration\n        [lists\n        it as disabled](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.2-rc.5/packages/bundle/base/cordis.patch.yml).\n      \n\n        Some of the names match shell commands, but only `bash` uses a shell. In a run\n        that called all four tools, a system call trace showed what each one started:\n      \n\n- `read` started nothing. The`dsh` process opened the file itself.\n- `grep` and`glob` each started a copy of ripgrep that ships with`dsh` . The model fills in inputs such as the pattern and the path, and`dsh` sets the rest of the command.\n- `bash` started a shell inside the sandbox, and the shell ran the command the\n          model wrote.\n\n`glob` lists hidden and git-ignored files and skips version control folders.\n        A plain `grep` leaves hidden and git-ignored files out, which is ripgrep's default. (The\n        [package\n        README](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.2-rc.5/packages/fs/tool-fs-search/README.md) says both tools include them, but only `glob` passes the flags that do\n        so.) That doesn't protect a secret in an ignored `.env` file. In a test run,\n        `glob` listed the file, `read` opened it, and `grep` searched\n        it when given its path or the filter `*`.\n      \n\n### How much one call returns\n\n`read` returns up to 2,000 lines or 51,200 bytes of file text, whichever comes first,\n        and cuts any line at 2,000 characters. The result ends with a note telling the model where to\n        continue. Try a few file shapes.\n      \n\n        The last preset shows a blind spot. Paging works by line, so anything past character 2,000 on\n        a single line can never be reached with `read`. The model has to fall back to the\n        shell.\n      \n\n        Other tools have their own limits. `grep` shows 250 matches and `glob`\n        shows 100 paths, oldest first, so a long list leaves out the most recently changed files.\n        Anything else over about 12,500 tokens is cut to its beginning and end. Shell output has an\n        earlier limit: past 64,000 bytes, such as in a long test run, only the end is kept. The full\n        output is normally saved to a file on your disk and the model is told the path, so it can search\n        the saved copy with another tool call. Saving isn't guaranteed. A command that prints more than\n        64 MiB, for example, leaves only its last 64,000 bytes.\n      \n\n        These limits decide what the model sees, not what leaves your machine. With each\n        `grep` result, `dsh` also logs the matching lines as data for the web\n        app, and that data is cut separately. On DeepSeek routes it can go out with the session log copy\n        ([Swapping the Model Host](#hosts)). In a test run, a search found 250 long lines. The\n        model was shown 154 of them, and the log copy held 96 that it wasn't shown.\n      \n\n### What is it allowed to open?\n\n        Almost anything you can. The sandbox modes cover file changes, and reading is left alone. In a test\n        run, `read` opened `/etc/hostname`, well outside the project,\n        with no prompt. A shell command reached a server over the network. Writing outside the\n        project failed from both the shell and the `write` tool. The\n        [sandbox\n        documentation](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.2-rc.5/docs/subsystems/sandbox.md) says the same thing: network access is \"outside this vocabulary\".\n      \n\n**Put together:** in `workspace-write` mode, the model can read\n          any file you can, including `~/.ssh`, and can use the network from a shell\n          command, without asking. The\n          project's own [safety\n          notice](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.2-rc.5/SAFETY.md) recommends a disposable VM or container.\n        \n\n## Swapping the Model Host\n\n        DeepSeek's models are available from several companies, and `dsh` is not tied to\n        DeepSeek's API or even to DeepSeek's models. To see what changes, `dsh` was configured for\n        each route with a made-up key, and the same question was asked with the provider's address\n        replaced by the fake server. No Fireworks, Baseten, or Modal account was involved. Figure 5 shows\n        the size and contents of each request `dsh` built.\n      \n\n## Show the numbers as a table\n\n### Two adapters, two data flows\n\n        On the DeepSeek route, 70 KB of the 171 KB sent during that turn was a field called\n        `dsh_session_log`. The model never sees it, because it sits outside the messages\n        and tool definitions. It is a copy of the session log, sent in pieces as the log grows. The\n        [wire\n        reference](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.2-rc.5/docs/deepseek-llm-api-wire-extensions.md) says it may include the working directory, system prompts, your messages, tool\n        arguments and results, and output from failed attempts. A second field,\n        `dsh_plugin_packages`, lists the plugins you have active.\n      \n\n        Both are on by default. The web UI has a switch under Settings, General,\n        \"Upload Session Log when using the official model API\", described as \"Help improve DeepSeek\n        models and products.\" Your `cordis.patch.yml` can turn\n        off both:\n      \n\n```\n# ~/.dsh/profiles/web/cordis.patch.yml\n- id: session-log-deepseek\n  config:\n    enabled: false # test turn: 171 KB to 101 KB\n- id: plugin-package-inventory-deepseek\n  disabled: true # then to 78 KB\n```\nMuch of that log repeats what the request already carries as model input, since DeepSeek's API has to see your prompt to answer it. The additions are the parts outside the model's view and the fact that it arrives as a structured record of the whole session.\n\n        On pi-ai routes neither field exists. The adapter doesn't implement them, and the captures show\n        none. That includes pi-ai's own `deepseek` provider, so the adapter decides this and\n        not the destination. What remains is an ordinary chat request with a\n        `deepseek-harness` user agent, plus, on the Fireworks and Baseten routes, a\n        session ID that lets the host send related requests to the same server. A system call trace\n        of a full turn on the custom route, with telemetry left at its default, showed connections to\n        the model server and nowhere else, both in the headless command and in the web app.\n      \n\n### Fireworks, Baseten, and Modal\n\nFireworks and Baseten are two of more than 40 built-in providers, so an API key is enough. Modal isn't in the list. There you run your own model server, for example vLLM, and add it as a custom route.\n\n| Host | Setup in dsh | API used for DeepSeek models | What the host says about storing requests | \n|---|---|---|---|\n| Fireworks | Built in, `FIREWORKS_API_KEY` | Anthropic Messages | [Not logged or stored](https://docs.fireworks.ai/guides/security_compliance/data_handling) for open models unless you opt in. Kept in memory for the request and briefly for prompt caching. | \n| Baseten | Built in, `BASETEN_API_KEY` | OpenAI Chat Completions | Model APIs follow a [zero data retention](https://www.baseten.co/security-practices/) posture. | \n| Modal | Custom route: base URL, API type, model IDs, key | Whatever your server speaks | Depends on how you deploy. Servers and Endpoints: [not stored](https://modal.com/docs/guide/security) . Functions and Web Functions: up to 7 days. | \n\n```\n# ~/.dsh/profiles/web/cordis.patch.yml\n- id: llm-pi-ai\n  config:\n    providers:\n      fireworks:\n        apiKeyEnv: FIREWORKS_API_KEY\nbaseten:\n        apiKeyEnv: BASETEN_API_KEY\nmy-modal:\n        apiKeyEnv: MODAL_VLLM_KEY\napi: openai-completions\nbaseURL: https://your-app.example/v1\nmodels:\n          - id: deepseek-v4-flash\n```\n        Two practical notes. An unrecognized endpoint is addressed as if it were OpenAI, and many\n        servers reject something in that shape, so the\n        [provider\n        guide](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.2-rc.5/docs/user/guide/providers.md) documents `compat` switches such as `maxTokensField` and\n        `thinkingFormat: deepseek`. And Modal's\n        [vLLM example](https://modal.com/docs/examples/llm_inference) deploys an endpoint\n        that anyone with the URL can call, so add authentication before sending it private code.\n      \n\n### The base URL trap\n\n        There are two ways to point `dsh` at another host, and they don't send the same\n        data. Adding a provider uses the pi-ai adapter. Setting `DEEPSEEK_BASE_URL` keeps\n        the DeepSeek adapter and changes only the address, so the session log copy and package list\n        go to the new host. Select \"DeepSeek adapter, other URL\" in [Figure 5](#hosts-demo) to see it. The wire\n        reference states this directly: a gateway chosen through `baseURL` \"receives the\n        same values as the official endpoint\".\n      \n\n### Web search still goes to DeepSeek\n\n        Search is separate from inference. On a DeepSeek route, `web_search` runs as a\n        second model call at DeepSeek. On any other route, it calls DeepSeek's Search API. With a\n        Modal-style model route and a DeepSeek key present, the test run sent this:\n      \n\n```\nPOST <DeepSeek API origin>/v1/tools/search\n{ \"query\": \"half-even rounding\", \"count\": 10, \"need_content\": false,\n  \"ori_question\": \"How should I round prices in the cart?\" }\n```\n        The query came from the model. The `ori_question` field is the user's own prompt,\n        cut to 128 characters, and `sendOriginalQuestion: false` removes it. Without any\n        DeepSeek credential, `dsh` leaves `web_search` out of the tool list, so\n        a setup with only a Fireworks key has no reason to contact DeepSeek during a turn. Two other\n        things contact DeepSeek whichever route you use. Submitting feedback uploads the\n        session up to that point. In a test run on the custom route, nothing was uploaded until\n        `/feedback` was typed, and then 94 KB was, including the source code the model\n        had read. And if you sign in to a DeepSeek account, the web app checks it for notifications in\n        the background, every 10 minutes unless the server sets another delay. By default\n        `web_fetch` downloads pages directly from your machine.\n      \n\n## Local, Host, or Cloud\n\nIt helps to split a coding agent into jobs and ask where each one runs. Codex and Claude Code make good comparisons because they solve the same problem with more hosted services around them. Switch the harness, then switch who hosts the model.\n\n### Four reasons to need something remote\n\n1. **Inference.** Something has to run the model. It can be a vendor, a host\n          like Fireworks, or a machine you own. The captures in this article used a server on\n          localhost and needed no cloud at all.\n2. **Hosted tools.** Web search is the main one. In all three harnesses it\n          runs on the vendor's or model host's servers.\n3. **An account.** Signing in pays for usage.`dsh` needs an API key\n          or an optional DeepSeek sign-in, and a third-party key alone is enough to work.\n4. **Running while your laptop is closed.** This is the one job where a cloud\n          client changes the design. The repository has to be copied to a remote machine, and the\n          loop, files, and shell all move there.\n\n        On the last point the three differ most.\n        [Codex cloud](https://learn.chatgpt.com/docs/cloud) and\n        [Claude Code cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web)\n        run on the vendor's machines by default and need a ChatGPT or claude.ai account, so they aren't\n        available with only a third-party model key. The `dsh` repository ships no hosted\n        runner. You can run the `dsh` host on your own server and open its web page\n        through a [reverse\n        proxy](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.2-rc.5/docs/user/guide/public-deployments.md), in which case \"local\" means that server.\n      \n\n### Compared with Codex and Claude Code\n\n|  | dsh | Codex CLI | Claude Code | \n|---|---|---|---|\n| Finds code with | `grep` and`glob` tools, bundled ripgrep | The shell, with a prompt that prefers `rg` | `find` and`grep` in Bash on macOS, Linux, and WSL; Grep and Glob tools on Windows | \n| Opens files with | `read` , 2,000 lines or 51,200 bytes | The shell | Read, 25,000 tokens by default | \n| Loads without asking | `AGENTS.md` and`CLAUDE.md` , nested ones when touched | `AGENTS.md` from root to working directory, 32 KiB | `CLAUDE.md` , or`AGENTS.md` if there is none, nested ones when touched, plus memory and git state | \n| Model APIs spoken | Anthropic Messages, OpenAI Chat Completions and Responses, Gemini, and others through pi-ai | OpenAI Responses only | Anthropic Messages, Bedrock, Google Cloud | \n| Other vendors' models | Built in | If the host offers the Responses API | [Not supported](https://code.claude.com/docs/en/llm-gateway) by Anthropic | \n| Shell sandbox by default | Writes limited, network open | Writes limited, [network off](https://learn.chatgpt.com/docs/agent-approvals-security) | [Off](https://code.claude.com/docs/en/sandboxing) ; permission modes decide what runs. When on, writes limited and network allowlisted | \n| Session record on disk | `~/.dsh/sessions` , compressed | `~/.codex/sessions` | `~/.claude/projects` , plaintext, 30 days by default | \n| Transcript sent to the vendor outside model input | On by default on DeepSeek routes. On any route, feedback uploads the session | Session logs go with feedback when you include them. Usage metrics are on by default | Only if you [choose to share it](https://code.claude.com/docs/en/data-usage) | \n\nWhere the work happens is nearly identical. All three run the loop on your machine, search with text tools by default, and send a growing history to a model endpoint. The differences are in which endpoints they accept, how tightly the shell is confined, and what the vendor receives besides model input.\n\n## Before You Use Private Code\n\nEverything above turns into a short list of choices.\n\n- **Choose the route on purpose.** A built-in or custom provider sends model\n          input to that host. The DeepSeek adapter also sends the session log copy and package list,\n          wherever its base URL points.\n- **Decide on session log upload** if you use a DeepSeek route. It is one\n          switch, and it is on by default.\n- **Decide on web search.** If a DeepSeek credential is present, the model's\n          search queries go to DeepSeek, whichever host runs the model. When that host isn't DeepSeek,\n          the start of your prompt goes with them by default.\n- **Treat feedback as an upload.** It sends the session to DeepSeek on every\n          route.\n- **Check the host's storage terms** for the product you deploy. On Modal the\n          answer depends on the deployment type.\n- **Confine it from outside.** The sandbox limits writes. To limit reads or\n          network, use a container or VM.\n- **Pin a version.** The README promises breaking changes, and the defaults\n          described here belong to 0.2.2-rc.5.\n\nThe harness decides what the model sees and what leaves your machine, and both are easy to check. Point it at a server you control and read what arrives.", "url": "https://wpnews.pro/news/deepseek-harness-from-your-files-to-the-model", "canonical_source": "https://www.akashtandon.in/interactive-explainers/deepseek-harness/", "published_at": "2026-12-03 07:16:09+00:00", "updated_at": "2026-12-03 07:47:53.670547+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-safety", "large-language-models"], "entities": ["DeepSeek", "DeepSeek Harness", "dsh", "Claude Code", "Codex", "Fireworks", "Baseten", "Modal"], "also_reported_by": [], "takeaway": "DeepSeek Harness 0.2.2-rc.5 keeps no index or embeddings and reads project files only via model-issued grep, glob and read calls, and its DeepSeek API connector appends a copy of the session log to each request by default while other providers' connectors do not.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/deepseek-harness-from-your-files-to-the-model", "markdown": "https://wpnews.pro/news/deepseek-harness-from-your-files-to-the-model.md", "text": "https://wpnews.pro/news/deepseek-harness-from-your-files-to-the-model.txt", "jsonld": "https://wpnews.pro/news/deepseek-harness-from-your-files-to-the-model.jsonld"}}