ds-run

A command that sends a task to DeepSeek through claude-ds and records its streamed output in a session directory.

In plain words
What is it for?
Delegating coding tasks, monitoring their progress through a small status file, and running code-changing work in an isolated worktree.
Why use it?
It lets another model handle a task separately while keeping progress observable and resumable. Repository changes can run in an isolated Git worktree, a separate copy of the code for safer edits.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/rbinar/cli-dispatch/ds-run
Clone the repo
git clone --depth 1 https://github.com/rbinar/cli-dispatch
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 728 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00012 $0.00728
Opus 5 $0.00006 $0.00364
Sonnet 5 $0.00002 $0.00146
Haiku 4.5 $0.00001 $0.00073

Measured yesterday against content hash cd802c7df034, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ds-run scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cli-dispatch/commands/ds-run.md · 58 lines

What it actually says

Delegate a task to claude-ds

Task to delegate: $ARGUMENTS

The task runs via claude-ds-stream: its output is parsed as stream-json and written to a session directory → live, observable, resumable. Monitor progress in a cost-conscious way: read only the small status.json, never the raw transcript.

If it's a real repo task (file changes needed) — use an isolated worktree:

  1. Write the task to a brief file (e.g. /tmp/ds-brief.txt).

  2. Run it (as a background task) — macOS / Linux / WSL / Git Bash:

    "${CLAUDE_PLUGIN_ROOT}/scripts/ds-worktree-run.sh" <repo-path> <branch-name> /tmp/ds-brief.txt
    

    (The script uses claude-ds-stream internally; the session directory is printed on stderr.)

    Windows: repo tasks need bash (WSL or Git Bash). The PowerShell twin of this runner was removed in 4.6.0 (issue #125) — nothing selected it, cli-dispatch-run.ps1 requires bash for worktree runs anyway, and a second uncalled copy of the guard logic could only drift. Pure generation (below) and every other Windows path are unaffected.

  3. Monitor (cost-conscious): capture the session id, occasionally check status.json via /cli-dispatch:watch <id> (state: running→done). Do NOT tight-loop tail.

  4. When done, review the diff in the worktree (git -C <worktree> diff), verify independently (tsc/build/test).

  5. If all good, you handle git/commit/push/PR/merge; then clean up the worktree.

If it's pure generation (code/text, no files) — as a background task:

claude-ds-stream -p "$ARGUMENTS"

The final text is printed to stdout; progress lives in status.json/progress.log. Session id on stderr.

Note: the worker runs with bypassPermissions, so it can still write files even here. If the output must be text-only with no disk writes, add --read-only (claude-ds-stream --read-only -p "$ARGUMENTS") — it denies Write/Edit/Bash.

Reasoning effort:

ds-agent --effort high -q "$ARGUMENTS"

--effort low|medium|high maps to a thinking-token budget via MAX_THINKING_TOKENS (low=1024, medium=8192, high=31999), applied through the CLI wrapper's --effort flag. Best-effort — only honored if the DeepSeek Anthropic-compatible API respects the thinking budget.

Follow-up / fix (continue the same DeepSeek session):

claude-ds-stream --resume <session-id> -p "<follow-up>"

To see all sessions, use /cli-dispatch:sessions.

claude-ds = worker, you = reviewer/merge owner. Don't trust the output until verified.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 58 lines · 12 tokens per session scan A cd802c7df034

Subscribe to this mod's changes

ds-run is a command published in the GitHub repository rbinar/cli-dispatch (5 stars, last pushed 13d ago), licensed MIT. It adds 12 tokens to every session and 728 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.