Skip to content

Coder

Picks a task, fixes it in a worktree, and opens a pull request.

  • Picks one ready task per run from the aven todo queue, limited to improver and security-analyst findings, reopened test-writer PRs, and tasks you created yourself ("taskFilter": { "found-by": ["improver", "security-analyst", "test-writer", null] })
  • Works in an isolated git worktree (never touches the main working tree)
  • Makes minimal, focused changes following existing code style
  • Does not commit or push; the orchestrator handles all git operations and PR creation
  • Default cron: every 5 minutes (*/5 * * * *)
Terminal window
vteam run coder
  1. Acquires an advisory lock (locks/coder.lock in the project’s state directory)
  2. Under a short-lived claim lock shared by all agents (locks/task-claim.lock), picks the highest-severity ready task routed to it from aven (aven list --status todo --ready filtered by its taskFilter, see Triage and routing; oldest first within a severity; skips tasks that have failed maxRetries times), or the task given with --task, and sets it to active with claimed-* metadata
  3. Fetches the base branch and creates a git worktree at worktrees/vteam/<task-title-slug>-<runId> in the project’s state directory, branched from origin/<baseBranch>, so the branch starts from the latest remote code and never picks up unpushed local commits
  4. Builds the prompt with the task description, the task’s aven notes (including summaries from earlier attempts), existing task titles, and agent instructions
  5. Spawns claude -p in the worktree; Claude implements the fix and returns a commit message as structured JSON
  6. If Claude reported changes:
    • The orchestrator commits (git add -A + git commit using Claude’s commit message)
    • Pushes the branch to origin with --force-with-lease, retrying network errors
    • Creates a pull request via gh or glab (falls back gracefully if the CLI is missing or labels don’t exist)
    • Sets the task to done with completion metadata
  7. If Claude reported no changes: returns the task to todo and increments its retry-count metadata
  8. On any other ending (crash, error): returns the task to todo without incrementing retries
  9. Unless it crashed or errored, adds an aven note to the task with Claude’s summary (and blocker reason or PR URL, if any)
  10. Cleans up the worktree
  11. Releases the lock

When a task already has a PR (pr-url metadata), the coder works on that PR instead of opening a new one. See Following up on review comments.