Build & submit taskBetaadvanced

Orchestrate a Scout and a Fixer: Subagents, Tool Scoping, and a Headless CI Sweep

Define a read-only scout subagent and an edit-capable fixer subagent in .claude/agents/, drive a find-then-fix sweep over a small message-routing library with five planted defects, and write the headless one-liner that would run the same sweep in CI. A local self-check re-runs the defect detectors and the test suite and writes your proof-of-work evidence only when the repo is genuinely clean.

1.3 hrs

Est. time

4

Outcomes

5

Rubric criteria

65%

Pass score

What you'll learn

Skills you'll have real reps in after shipping this.

A subagent is a scoped worker: its own context window, its own system prompt, its own tools line. Delegating exploration to one keeps grep noise and file dumps out of your main conversation, which is the practical meaning of context isolation.
The tools field is least privilege for agents: a scout that can only Read, Grep, and Glob cannot damage the repo no matter how wrong it is, and that is exactly why you can let it roam. Omitting the tools field hands the subagent every tool.
Subagents give you context isolation and delegation; they are not automatically parallel. Design the handoff (scout reports, fixer acts) instead of assuming a swarm.
Headless mode (claude -p with --output-format) turns an interactive workflow into a scriptable CI step, and pairing it with a deterministic check is what makes the sweep trustworthy.

The scenario

You inherit relaymail, a small message-routing library. The maintainers keep a catalog of five known defects (ISSUES.md) and nobody wrote down where they live. If you hunt for them by pasting files into your main Claude Code conversation, the exploration noise (grep output, dead ends, whole-file dumps) buries the context you actually need for the fixes.

This task is the subagent answer. A subagent is a helper agent with its own context window, its own system prompt, and its own tool list, defined as a Markdown file in .claude/agents/. You author a scout whose tools line is restricted to Read, Grep, and Glob, so it can roam the repo and report findings while being physically unable to change anything, and a fixer that is allowed to edit and applies minimal repairs. Delegation buys you context isolation: the scout's exploration happens in its own window and only the findings list returns to your main conversation. Subagents are not automatically parallel; the win here is isolation plus least privilege. You finish by writing the claude -p one-liner that would run the same sweep headless in CI, with a deterministic check as the gate.

Your role

You are the engineer wiring Claude Code subagents into a team repo. Your deliverable is two agent definitions (a read-only scout and an edit-capable fixer), the repaired library with its hashed test suite still green, a log of the real orchestration run, and a headless CI script, packaged as one submission.

Start the task to unlock the full brief

You'll get the step-by-step requirements, setup commands, the 5-criterion grading rubric, tips, and the ability to submit your solution for instant AI grading.

Free to start · submit when you're ready

Build a scout-and-fixer subagent pipeline, hands-on

Subagent definitions, tool scoping, and headless mode are the mechanics that turn Claude Code from one long conversation into an orchestrated workflow, and this task makes you wire all three for real. You author a scout subagent whose tools line is restricted to Read, Grep, and Glob, point it at a defect catalog with no file locations, and drive a find-then-fix handoff to an edit-capable fixer over a working Python library, keeping its hashed test suite green the whole way. A local self-check re-runs the five defect detectors and the tests and generates your evidence only on a genuine pass, and you finish by writing the claude -p one-liner that would run the same sweep in CI. You come away having practiced context isolation (exploration noise stays in the scout's window), least privilege for agents, and the interactive-to-headless translation that makes agent workflows scriptable.

Frequently asked questions

Do I need a Claude subscription or API key to finish this?

You need working Claude Code access for the orchestration step, because you drive the scout and fixer in your own session. The self-check itself is offline and deterministic (standard-library Python, no API key), and ci_check.sh must be correct as written but you are not required to execute it.

What exactly gets graded?

Your two agent definitions (frontmatter plus system-prompt body), the read-only scoping of the scout, the five repaired defects with the unmodified test suite passing, your ci_check.sh headless script, and the run log of the scout-to-fixer handoff. The evidence file generated by the self-check carries a canary token and a per-issue table that the grader cross-checks against your actual source.

Can I skip the subagents and just fix the bugs by hand?

The detectors only verify the fixes, so hand-fixing gets you part of the way, but the rubric puts heavy weight on the agent definitions, the verified read-only scout, and a run log whose findings and per-fix summaries are consistent with the actual planted defects and your actual diffs. Running the orchestration for real is the fastest way to produce all of that, and it is the skill the task exists to teach.