subtask

io.github.tedin7由 GitHub 账号 tedin7 发布v0.5.9更新于 Nov 4, 2026

适用于 Claude Code、Codex、Kimi 和 OpenCode 的后台子代理,通过 MCP 运行,并设有支出上限。

AI 翻译由 AI 模型根据下方的原文描述翻译,可能有误。

原文描述

Background sub-agents for Claude Code, Codex, Kimi and OpenCode, over MCP, with a spend cap.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

subtask 的本地 MCP 服务;无需登录;STDIO;18 个工具。

暂无 AI 概览:以下信息来自注册中心条目和服务本身。

安装

在 SourceWeft 中

  1. 打开 控制台中的 subtask,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

subtask

A local delegation scheduler for coding agents. One MCP server (and a twin CLI) lets Claude Code, Codex, Kimi Code or OpenCode start work in parallel, wait for it with a single call, and read back a short summary with evidence. It picks an engine that can take the job, books money and slots safely across processes, and says honestly how isolated each run is.

start_many([{task: "Fix the flaky test in tests/test_sync.py", repo: "/src/app", verify: "pytest -q tests/test_sync.py"},            {task: "List every caller of parse_date()", kind: "read", readonly: true, cwd: "/src/app"}])  -> st-4f2a91 started · sonnet-api · branch subtask/st-4f2a91 · sandbox     st-77c0de started · haiku-api · /src/app · readonlywait(["st-4f2a91", "st-77c0de"])          # Claude Code shows: Subtask · 01:16 · 1/2 ended — st-4f2a91 running tests: pytest -q  -> st-4f2a91 done · sonnet-api · 6m · 0.412$ · verified · ...     ## Summary (≤10 lines: the answer, files, commits, tests, what is left)result("st-4f2a91", evidence=True)        # JSON: base/head, changed files, observed commands, verify exit code, cost

Why

  • Save the caller's context. The worker's search, test runs and dead ends stay in its own session; the caller reads about ten lines.
  • Few round trips. start_many + one wait replace a polling loop.
  • Use whatever has room. engine="auto" filters engines that can enforce the requested isolation, are installed, fit the budget and have quota, then ranks them with an explicit utility (subtask routing explain).
  • Money is a primitive. Paid engines reserve their budget before any work, under one lock with the slot; every reservation is closed exactly once.
  • Evidence, not claims. verify="..." runs your check on the commit the worker left; result(evidence=True) separates what subtask observed from what the worker reported.

Install

The distribution is subtask-mcp (the PyPI name subtask is an unrelated project). Full guide, per client, with native commands: docs/install.md.

sh
uv tool install "git+https://github.com/tedin7/subtask@main"   # or: uv tool install /path/to/checkoutsubtask install --client all          # prints the plan for every detected clientsubtask install --client all --yes    # applies it: MCP server + skillsubtask doctor --client all           # checks app, config entry and a real handshake

Jev provides advisory workflow checks automatically, or only when requested:

sh
subtask jev                 # policy, key availability and the current process's budget limitssubtask jev setup           # guided setup; key input is hiddensubtask jev auto            # automatic routing, feedback and final delivery advicesubtask jev manual          # explicit review submissions onlysubtask jev off             # block new Jev submissions

New installations start in manual mode. The policy and private key are shared by the configured clients. Enter keys through hidden subtask jev setup input or explicit stdin, never chat, argv or tool arguments. In auto, start_many appends routing advice, reply includes feedback advice, and final wait / result include evidence consistency and risk triage. Read this advice together with the existing baseline output. Routing and feedback preserve authorized work and worker instructions. manual requires explicit submissions; off blocks new ones.

These extra checks share the existing cap and deduplicate identical content. skipped, blocked and unknown are not passes; never retry an unknown send. Distinguish raw provider_choice from filtered assessment: a failed verification can veto supported deterministically, without being a Jev finding. Suggested next actions grant no authority, replace no checks, and trigger no automatic model fallback, merge, retry or release. See Jev setup and limits and the workflow study and its limits. These instructions describe the upcoming release; they do not certify a live install.

Claude Code plugin: claude plugin marketplace add tedin7/subtask then claude plugin install subtask@subtask. Codex: codex plugin marketplace add tedin7/subtask. API engines read ANTHROPIC_API_KEY from ~/.config/subtask/env (chmod 600).

Engines

enginepays withread-onlyisolation it can enforce
haiku-api, sonnet-api, opus-apiAPI key, monthly capyessandbox (Claude Code OS sandbox)
codexCodex login (quota from local session files)yessandbox (workspace-write), isolated
opencode-goopencode-go subscriptionnoworktree, isolated
kimiKimi loginnoworktree, isolated
dshDeepSeek key, same cap (subtask-mcp[dsh])noworktree
opencodeOpenCode default provider (manual only)noworktree, isolated

Add an engine without touching the core: an EngineAdapter registered under the subtask.engines entry point (see CONTRIBUTING.md).

Isolation, honestly

  • worktree (default): a git worktree and branch per writing job. It prevents collisions; it is not a host sandbox.
  • sandbox: the engine's own sandbox. Same user: a guard rail.
  • isolated: bubblewrap. Read-only system, writable worktree and git dir only, a private HOME with only the engine's own state. Needs bwrap.
  • untrusted: sandbox or stronger, and no network for the worker's commands.

A job that cannot get the policy it asked for is refused, never downgraded. Output is redacted for common secret formats before it is saved or shown; redaction is a second layer, not a guarantee. See SECURITY.md.

Tools (MCP) and CLI

toolwhat it does
start(task, kind, repo, cwd, files, readonly, engine, max_usd, effort, base, max_turns, policy, verify, isolation, max_retries, adversarial, context_refs, auto_repomap, tier, invariants, allowed_paths, symbol_scope, oracle_cmd)start one job (see below)
start_many(tasks)start several; partial success is listed per item. Items with id and depends_on form a group (grp-…) run as a DAG without extra turns; foreach=<parent id> makes one copy per item of the parent's .subtask/fanout.json (at most 8), and dependents wait for every copy; after="any" starts when one parent succeeded
integrate(ids, action="apply", auto_resolve=False)worktree jobs back: diff, apply (all or nothing, uncommitted), discard; auto_resolve starts a reconciliation job on conflict
consensus(prompt, engines, verify_cmd, isolation="worktree")2 to 4 engines solve it blind in their own worktrees, then one job compares their diffs as anonymous patches and writes one solution, checked by verify_cmd and the invariants; returns a group id
bisect(good_ref, bad_ref, test_cmd, parallelism=4, auto_fix=False)first commit that makes test_cmd fail, testing up to parallelism (max 8) commits per round in temporary worktrees; returns the commit, author and diff; auto_fix starts a verified fix job
map_reduce(glob_pattern, prompt_template, batch_size=5, concurrency=3, verify_cmd, isolation="worktree")one job per batch of files ({{files}} in the template), at most concurrency at a time; returns a group id
wait(ids, timeout=300, mode="all", since=None, stall_timeout=None)block until they end (any: the first; first_success: the first done and verified, the others are stopped); returns early on a stalled job; progress notifications while waiting; since cursor for clients without progress
steer(id, action, instruction=None)hint (queued, sent as a reply when the attempt ends), abort, retry (fresh job with the instruction)
inspect(id, tail=80, grep=None)raw log lines, only when the summary is not enough
status(id) / result(id, full, evidence)one line / summary or full text or JSON envelope
reply(id, message) / stop(id) / cleanup(id)continue / stop the work / remove a clean worktree (branch kept)
engines()capacity per engine with source, freshness and confidence, plus spend

Options of start:

  • isolation="worktree": own worktree and branch (like repo=), plus SUBTASK_PORT (from 18100), SUBTASK_ID and a private TMPDIR. The result lists files_modified and diff_stat.
  • verify + max_retries: a failed check resumes the job with the output; when every retry fails, a worktree goes back to its best attempt (scored from "N passed / N failed").
  • adversarial=True: a Breaker job writes edge-case tests from the spec only; they are copied into the Builder's worktree and run with verify.
  • context_refs: file:PATH[:A-B], git:diff[:REF], subtask:ID:summary|diff, resolved before start. auto_repomap=True adds tracked files with their top-level symbols (cached per HEAD).
  • invariants (default ["no_test_deletion", "no_suppression"], [] turns them off): before verify counts, test functions may not decrease, no new skip/xfail markers, no new # type: ignore, # noqa or # pragma: no cover. A violation is a failed check with the reason, so a retry sees it.
  • allowed_paths: files changed outside these paths are put back and the revert is committed.
  • symbol_scope=["path.py::name", ...]: only those top-level functions or classes may change in those files. integrate then merges several jobs' edits to one Python file symbol by symbol; overlaps, import or constant changes, and symbols changed on the target meanwhile are a conflict, never a guess.
  • oracle_cmd: after a passing verify, runs the command on the job's base and on its result at the same time and reports whether exit code and stdout match, plus duration_ms_before, duration_ms_after, speedup_pct.
  • tier: fast (effort low), deep (effort high, kind hard), free_only. Past 75% of the monthly cap, auto and balanced go to free engines and the reply carries budget_warning.
  • Kimi's default K3-256k and supported managed model aliases accept low, high and max effort. Subtask maps medium to high and xhigh to max for those models, which can consume more quota. New sessions retain the effective effort when resumed; custom model aliases keep the requested value.

Memory: when a check fails and a retry fixes it, subtask stores a short lesson for that repository in $SUBTASK_HOME/engrams/ (at most 50, least recently used dropped). Jobs on the same paths get the top three. Groups have a blackboard file for shared notes; new notes show in wait(since=...).

CLI only: subtask board [--json] (the view the OpenCode plugin renders), subtask doctor, gc [--apply], du, roi, routing explain|calibrate, watch ID..., install, uninstall, and --model, --no-sandbox, --untrusted on start.

The gc preview reads recorded job states without settling workers; jobs recorded as active are kept. gc does not calculate file sizes, so its output reports folder counts rather than reclaimed bytes. Run subtask du separately for disk usage; scanning large stores can take time. A copy with files in .reports is kept until a collector leaves a receipt, the regular file .reports/.collected (any content; its mtime must be at least that of the newest report). Empty .reports needs no receipt.

Progress in the chat

clientduring a wait
Claude Code 2.1 (TUI)live line under the tool call, verified
OpenCode 2.0notifications received, not shown: use wait(since=...)
Kimi Code 2.1client does not request progress: wait(since=...)
Codex 0.162not yet verified (account at its usage limit)

Details and evidence: docs/progress-matrix.md.

Settings

variabledefault
SUBTASK_HOME~/.local/share/subtask (jobs, worktrees, ledger, telemetry)
SUBTASK_ENV_FILE~/.config/subtask/env
SUBTASK_MONTHLY_CAP_USD / SUBTASK_DEFAULT_MAX_USD / SUBTASK_MAX_JOB_USD180 / 2 / 20
SUBTASK_MAX_RUNNING4 (global across all processes)
SUBTASK_ROUTING~/.config/subtask/routing.json (weights, "mode": "legacy")
SUBTASK_JOB_RETENTION_DAYS / SUBTASK_TELEMETRY_DAYS30 / 90
SUBTASK_PROGRESS_MIN_S / SUBTASK_PROGRESS_HEARTBEAT_S2 / 10

Costs of API engines come from the SDK's estimate; a run whose real cost is unknown is charged its whole reservation. Telemetry stays on this machine.

Platforms

Linux: supported. macOS: degraded (no /proc start times for liveness, no bwrap: isolated refused). Windows: not supported (fcntl).

Documentation

Architecture · Requirements matrix · Benefits and measurements · Benchmark protocol · Install · Releasing · Contributing

License

MIT

来源:README.md,提交 5d936a1

工具

18

plan

Preview tasks before workers start. Read deterministic facts and advisory Jev contradictions, then launch=True with plan_id to start the unchanged plan once. Changed inputs require a new preview. This is a coordinator decision within the authorized task, not a new operator permission. Legacy start/start_many remain available. Read dependencies must be explicit in depends_on.

输入参数taskslaunchplan_id

start

Start one job; returns its id. kind: read|code|review|hard. Writes: repo= or isolation='worktree' (own branch). model: engine-specific model id (opencode, codex, kimi, API engines); omitted = the engine's default. verify: shell check run by subtask after the job; max_retries (0-5) resumes with the failure. invariants: default ['no_test_deletion','no_suppression'] fail verify on deleted/skipped tests or new noqa; [] = off. allowed_paths: files outside are reverted. symbol_scope: ['f.py::func'] only those defs may change; integrate merges by symbol. oracle_cmd: after verify passes, run on base and result; reports output_match and speedup_pct. adversarial: a Breaker job writes the tests first. context_refs: file:P[:A-B] | git:diff[:REF] | subtask:ID:summary|diff instead of pasting text; auto_repomap adds a symbol map. policy: worktree|sandbox|isolated|untrusted. tier: auto|fast|balanced|deep|free_only.

输入参数cwdbasekindrepotask必填tierfilesmodeleffortenginepolicyverify另有 13 个

start_many

Start several jobs in one call. Items take start()'s arguments. With id + depends_on they form a group (grp-…) run as a DAG; subtask:<id>:summary in task/context_refs is replaced by the real job id. With Jev auto, the response includes advisory dependency checks; read them without treating them as permission. foreach=<parent id>: one copy per item of the JSON list the parent writes to .subtask/fanout.json ({{item}} in task), max 8; dependents wait for every copy. after='any': start when one parent succeeded.

输入参数tasks必填

wait

Block until jobs or groups end and return their summaries. mode: all | any (first to end) | first_success (first done and verified; the rest are stopped). Returns early on a stalled job. since: cursor for clients without progress; with it, timeout is capped at 60 s. For Codex: wait(ids, mode='any', timeout=60, since=''), drop ended ids and pass back cursor=. An idle Codex 0.164.0 is not woken by ordinary local MCP progress or log notifications. Includes the automatic Jev delivery/evidence/risk advice, raw provider choice, wrapper assessment and next action: read it before a manual review and do not resubmit the same work.

输入参数anyids必填modesincetimeoutstall_timeout

status

One line per job.

输入参数id

result

Job summary; full=True for all; evidence=True for the JSON envelope.

输入参数id必填fullevidence

reply

Jev auto adds advisory feedback checks; read the output. Continue a finished job.

输入参数id必填message必填

stop

Stop a job.

输入参数id必填

steer

Correct a job: hint (instruction sent when the attempt ends) | abort | retry (fresh job with the instruction).

输入参数id必填action必填instruction

jev

Show or change the shared Jev policy: status | auto | manual | off. Only the operator changes the policy: do not switch it to obtain or avoid a check. Auto checks every new final delivery once within the existing budget; read that outcome in wait()/result before any manual review. All advice is consultative. Credentials are never accepted here: add or replace a key in a terminal with `subtask jev setup` (hidden input), never in chat, argv or a tool argument. Changes apply to new submissions in every configured CLI; no server reload is needed.

输入参数action

review

Advisory Jev review of a terminal delivery against the parent's criteria (1-12). Read the automatic outcome in wait()/result first; do not resubmit the same delivery. Default prepares a local evidence packet without network; packets=True prepares separate claim packets and manifests offline (never submits). submit=True sends one request (unknown sends are never retried). Supply original_request from the coordinator to judge full scope; without it scope_assessment is unproven, which is neither a pass nor a contradiction. supported is advice, not acceptance. provider_choice is the raw answer; assessment includes local vetoes (missing, failed or mismatched evidence), which are not findings by the model. Jev never accepts, merges, deploys or retries the worker; local checks remain necessary. Key/budget errors are final for the call: keys only from `subtask jev setup`, never a tool argument.

输入参数id必填submitpacketscriteria必填original_request

inspect

Raw log lines of a job (last `tail`, filtered by `grep`). Only when the summary is not enough.

输入参数id必填greptail

integrate

Bring worktree jobs back. diff first to review; apply = uncommitted, all or nothing, Python files of symbol_scope jobs merged by symbol; discard removes worktree and branch. auto_resolve: a reconcile job on conflict.

输入参数ids必填actionauto_resolve

bisect

First commit in good_ref..bad_ref that fails test_cmd, testing up to parallelism commits at once. auto_fix: start a fix job.

输入参数repobad_ref必填auto_fixgood_ref必填test_cmd必填parallelism

consensus

2-4 engines solve prompt blind in worktrees, then one job merges the best (verify, invariants). Returns a group id for wait().

输入参数repoprompt必填engines必填max_usdisolationverify_cmd

map_reduce

The same edit over many files: one job per batch of files matching glob ({{files}} in prompt_template), at most `concurrency` at once, each in a worktree with verify_cmd. Returns a group id for wait().

输入参数cwdrepoengineisolationbatch_sizeverify_cmdconcurrencyglob_pattern必填prompt_template必填

cleanup

Remove a job's worktree, keep branch.

输入参数id必填

engines

Free quota and API spend.

无需输入参数。

版本历史

9
  1. v0.5.9最新Nov 3, 2026
  2. v0.5.8Nov 3, 2026
  3. v0.5.5Nov 1, 2026
  4. v0.5.0Oct 25, 2026
  5. v0.4.5Oct 19, 2026
  6. v0.3.1Oct 18, 2026
  7. v0.2.11Oct 14, 2026
  8. v0.2.8Oct 14, 2026
  9. v0.2.6Oct 14, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分