Skip to content

๐Ÿš€ WTD โ€“ What To Do

The autonomous AI agent fleet platform

CI License

Overview

WTD turns every TODO โ€” a code comment, an unlabeled GitHub issue, an unreviewed pull request, a failing workflow, a missing README โ€” into queued work for a fleet of Claude-powered agents that look for work, do the work, and add new todos as they go.

โ•ฆ โ•ฆโ•”โ•ฆโ•—โ•”โ•ฆโ•—
โ•‘โ•‘โ•‘ โ•‘  โ•‘โ•‘
โ•šโ•ฉโ• โ•ฉ โ•โ•ฉโ•

It is a standalone application: a CLI, a daemon loop, and a REST API with local JSON state โ€” no server infrastructure required. Everything is wired through Claude Code OAuth by default (your Claude subscription) with the Anthropic API as fallback, and a token-capacity load balancer decides which lane serves each agent run.

โœจ What the fleet does

Agent role SDLC work it handles Actions it may take
triage new/unlabeled issues comment, label
bug-hunter bug-labeled issues, latent bugs analysis comment, file issue
reviewer open pull requests review comment
janitor standing CI failures diagnosis issue, comment
doc-writer missing or thin documentation draft PR
contributor TODO/FIXME debt in code small draft PR
author articles / blog drafts draft PR

Agents also report discovered work (new todos) on every run, which the platform validates, dedupes, and enqueues โ€” the flywheel that keeps the fleet finding its own work.

๐Ÿงญ How it works

        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ one cycle โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚                                                               โ”‚
 roster โ”€โ–ถ DISCOVER โ”€โ–ถ QUEUE (dedup) โ”€โ–ถ SCHEDULE โ”€โ–ถ DISPATCH โ”€โ–ถ MONITOR โ”‚
 (wtd.yml)  issues       work items      priority +   Claude     ledger โ”‚
            PRs, CI,     ("todos")       per-repo     Code OAuth  runs, โ”‚
            docs gaps         โ–ฒ          fairness       โ–ผ fallback budgets
                              โ”‚                     Anthropic API       โ”‚
                              โ””โ”€โ”€โ”€โ”€ agents add discovered todos โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  1. Discover โ€” deterministic scanners sweep the roster: issues, PRs, workflow runs, docs gaps.
  2. Queue โ€” findings become work items with stable dedup keys; rescans converge instead of duplicating.
  3. Schedule โ€” a pure scheduler matches items to agent roles: priority bands, oldest first, repos interleaved round-robin so one noisy repo can't starve the rest. A roster entry's roles: list is an allowlist โ€” only those agents touch that repo.
  4. Balance โ€” each provider lane has a daily token budget; the balancer picks the first lane with headroom (subscription first, API spillover), benches rate-limited lanes, and tracks burn.
  5. Dispatch โ€” the agent gets bounded evidence and must reply in a structured JSON contract; the platform validates every requested action against the role's grants before touching GitHub.
  6. Monitor โ€” every run lands in a ledger; wtd fleet status shows queue, budgets, lanes, and outcomes.

๐Ÿš€ Quick start

# Install
pip install -e .

# 1. Auth (pick at least one lane)
claude setup-token          # default lane: Claude Code OAuth (subscription)
export CLAUDE_CODE_OAUTH_TOKEN=...
export ANTHROPIC_API_KEY=sk-ant-...   # fallback lane: Anthropic API

# 2. GitHub (read for discovery; write scopes only needed for --apply)
export GITHUB_TOKEN=ghp_...

# 3. Configure the fleet
wtd fleet init              # writes a starter wtd.yml + agents/
$EDITOR wtd.yml             # add your repos to fleet.repos

# 4. Fly
wtd fleet status            # lanes, roster, queue, budgets
wtd fleet run               # ONE cycle, dry-run (agents think, nothing is written)
wtd fleet run --apply       # let the agents act
wtd fleet loop --apply      # the autonomous daemon (Ctrl+C to stop)

Dry-run is the default everywhere: without --apply (or WTD_FLEET_APPLY=true) agents plan and their intended actions are recorded, but nothing is written to GitHub.

๐Ÿ“– Commands

Command Description
wtd fleet status Fleet health: provider lanes, roster, queue, budgets, recent runs
wtd fleet agents List agent roles (built-ins + agents/*.md overrides)
wtd fleet discover Scan the roster and enqueue new work (no agents run)
wtd fleet plan Show what the next cycle would run
wtd fleet run [--apply] Run one cycle: discover โ†’ schedule โ†’ dispatch
wtd fleet loop [--apply] The autonomous loop (interval from config)
wtd fleet daily [--apply] The daily pass: docs drift โ†’ review every PR (Opus 5) โ†’ merge what is green
wtd fleet merge-check Read-only: why each open PR would, or would not, be merged
wtd fleet queue Show the cross-repo work queue
wtd fleet budget Today's token budgets and burn per lane
wtd fleet init Write starter wtd.yml + agents/ here
wtd fleet map Every AI lane across every repo, in one table
wtd fleet audit Conformance against the fleet's shared conventions
wtd fleet adopt <path> Derive a repo's fleet.manifest.yml from its workflows
wtd Classic mode: scan the local repo's TODOs into a recursive tree
wtd scan / wtd dashboard / wtd execute / wtd status Local TODO tree tools
wtd routines โ€ฆ Recurring TODO management
wtd serve REST API (/v1/fleet/* + local tree endpoints)

๐Ÿ”Œ Providers: Claude-first, by design

The default WTD_LLM_PROVIDER=auto resolves this chain:

  1. claude-code โ€” headless Claude Code (claude -p), authenticated by CLAUDE_CODE_OAUTH_TOKEN (or an interactive claude login). Runs on your Claude subscription.
  2. anthropic โ€” the Anthropic API via the official SDK (ANTHROPIC_API_KEY), default model claude-opus-5-5, streaming + adaptive thinking, with server-side refusal fallbacks enabled on Opus 5.

Failover is automatic: rate limits, timeouts, and transient errors on one lane roll to the next, and the balancer's budgets decide which lane a run starts on. Legacy providers (ollama, openai) remain available when selected explicitly, but are never part of the auto chain.

โš™๏ธ Configuration

Secrets live in the environment (see env.example); the fleet's shape lives in committable wtd.yml:

fleet:
  repos:
    - repo: you/your-app
      roles: [triage, reviewer, bug-hunter, janitor]
    - repo: you/your-blog
      roles: [author]
      articles: true
    - repo: you/docs-site
      roles: [reviewer, doc-writer]
      merge: true             # opt in to the merge gate for this repo
  daily:                      # the once-a-day pass (`wtd fleet daily`)
    docs: true                # docs-drift sweep across the roster
    review: true              # queue every open PR for the Opus 5 reviewer
  merge:
    enabled: false            # off by default; --apply is still required too
    method: squash
  max_runs_per_cycle: 8
  max_writes_per_cycle: 5
  budgets:
    claude_code_daily_tokens: 1500000
    anthropic_daily_tokens: 500000
    anthropic_daily_usd: 10

Key environment switches:

WTD_FLEET_ENABLED=true      # master kill switch
WTD_FLEET_APPLY=false       # THE write gate (dry-run by default)
WTD_FLEET_MERGE_ENABLED=false       # the merge gate's own switch (default for wtd.yml)
WTD_FLEET_CONCURRENCY=2     # concurrent agent runs
WTD_MODEL=claude-opus-5-5     # default model for both lanes

๐Ÿ›ก๏ธ Safety rails

The fleet is autonomous, so the guardrails are structural, not aspirational:

  • Dry-run by default โ€” writes require an explicit --apply / WTD_FLEET_APPLY=true.
  • Kill switch โ€” WTD_FLEET_ENABLED=false stops everything, including discovery.
  • Least privilege โ€” each role declares the only actions it may request; everything else an agent asks for is rejected and logged.
  • Loop guards โ€” the fleet never acts on its own issues/PRs/comments (marker <!-- wtd-fleet:โ€ฆ --> + author checks), so agents can't feed themselves.
  • Dedup everywhere โ€” stable work-item keys, marker-checked comments and issues; re-running never double-posts.
  • Hard caps โ€” per-cycle run cap, per-cycle write cap, per-run action cap (3), per-run discovered-todo cap, retry cap.
  • Path safety โ€” proposed PRs can't escape the repo, and can never write .github/workflows/ (that would hand the agent its own credentials).
  • Merging is two-key and four-locked โ€” an Opus 5 reviewer may recommend a merge; a pure gate re-verifies CI, mergeability, review state, and policy before anything is merged, and refuses fleet-authored PRs unless a repo opts in. See the merge gate.
  • Token budgets โ€” daily per-lane budgets + an estimated-USD cap on the API lane; exhausted budgets defer work instead of overspending.
  • Prompt-injection posture โ€” repository content is fenced as untrusted in every prompt, and roles are instructed to ignore embedded instructions.

๐Ÿ–ฅ๏ธ Running it as a service

Daemon: wtd fleet loop --apply (systemd, tmux, whatever you run daemons with).

Docker:

docker build -t wtd .
docker run --rm -e CLAUDE_CODE_OAUTH_TOKEN -e ANTHROPIC_API_KEY -e GITHUB_TOKEN \
  -v $PWD/wtd.yml:/app/wtd.yml:ro -v wtd-state:/root/.wtd wtd fleet loop --apply

GitHub Actions (serverless): .github/workflows/fleet-loop.yml runs one cycle every 4 hours โ€” default-OFF until the repo variable WTD_FLEET_ENABLED is set to true, OAuth-first secrets, state cached between runs. .github/workflows/fleet-daily.yml adds the daily pass (docs drift โ†’ PR review โ†’ merge gate) at 07:17 UTC, with WTD_FLEET_MERGE_ENABLED as the merge gate's own switch.

REST API: wtd serve โ†’ GET /v1/fleet/status, GET /v1/fleet/queue, GET /v1/fleet/runs, POST /v1/fleet/discover, POST /v1/fleet/run, POST /v1/fleet/daily (the API can narrow to dry-run but can never escalate to writes; docs at http://localhost:8787/docs).

๐Ÿค– Custom agents

Drop agents/<name>.md files (YAML frontmatter + system prompt) into your project or ~/.wtd/agents/ to override built-ins or add specialists โ€” see wtd fleet init for a template. Roles declare which work kinds they handle, which actions they may request, and their token cost envelope for the balancer.

๐ŸŒณ The classic recursive TODO engine

The original local-first engine is still here and still the substrate: wtd scans the current repo (TODO/FIXME comments, markdown checklists), builds the recursive tree in tree.json, and can break tasks down with the same Claude-first provider chain. See wtd --help.

Project structure

Path What it is
wtd/ Python package: CLI, daemon loop, REST API and agents
tests/ Test suite
docs/ Guides and reference
wtd.yml.example Example configuration

๐Ÿงช Development

pip install -e ".[dev]"
pytest            # 204 tests, all offline (fake GitHub + fake providers)
ruff check .
mypy wtd          # gates CI

The load balancer, scheduler, outcome validator, and discovery scanners are pure and fully unit-tested; the dispatcher and orchestrator are integration-tested against an in-memory GitHub.

๐Ÿงญ Harmonizing a multi-repo fleet

When several repositories each grow their own autonomous loops, they drift into different dialects โ€” and you lose the one view that matters: which loops run tonight, and which of them can I stop?

The fleet manifest (fleet.manifest.yml, spec fleet/v1) is the common denominator: a small descriptor of a repo's lanes, their kill switches, the credentials they need, and the guardrails they promise. Each repo keeps its own engine; the manifest is how one tool sees them all.

wtd fleet adopt ../some-repo --write   # derive it from the repo's workflows
                                       # (a committed manifest always wins over inference โ€” locally and over the API)
wtd fleet map                          # every lane, every repo, one table
wtd fleet audit --strict               # fail CI on a critical convention breach

The audit encodes what the repos already say in prose: every scheduled AI loop needs an off switch, no agent merges its own work, nothing pushes straight to the default branch, Claude auth is OAuth-first with an API-key fallback. Full spec and rule table: docs/FLEET-SPEC.md.

๐Ÿ“š More

  • docs/FLEET.md โ€” full architecture: subsystems, data flow, contracts, design decisions
  • docs/FLEET-SPEC.md โ€” the fleet/v1 manifest spec + the shared-convention rules
  • PRD.md โ€” the original product vision (v0.1)
  • CHANGELOG.md โ€” release history

Contributing

Contributions are welcome via pull request. Use Conventional Commits and keep the CI checks green. The fleet-wide workflow is described in the hub's CONTRIBUTING.md. AI agents should start with CLAUDE.md.

Changelog

Notable changes are recorded in CHANGELOG.md. Tagged versions are on the releases page.

๐Ÿ“„ License

MIT License โ€” see LICENSE.


Reality WTD'd. The fleet finds the work. The fleet does the work. The fleet finds more work.

Ship it. ๐Ÿš€


Part of the bamr87 portfolio โ€” browse every project on Amr's GitHub profile.