Three-tier agents in VS Code with GitHub Copilot

Purpose

This guide reproduces a three-tier agent workflow in Visual Studio Code with GitHub Copilot:

The design keeps architecture and final review with the strongest model, implementation with a cheaper coding model, and repetitive evidence-gathering or editing with the lowest-cost suitable model. The roles match the tool-agnostic split in Building AI agents; this page is the VS Code and Copilot implementation. OpenCode and Claude Code use the same roles with their own file formats, documented in OpenCode agents and Claude Code subagents.

Final architecture

Claude Opus 5.5 └── implementation-worker: Claude Haiku 5.5 └── mechanical-worker: GPT-6 Luna

Responsibilities

Claude Opus 5.5

Claude Haiku 5.5

GPT-6 Luna

Prerequisites

Use only models approved by the organization that manages the Copilot account. Do not substitute personal API keys or unapproved external model extensions. Follow the organization’s current AI-tool, data-classification, privacy, export-control, and regulated-software requirements.

Start the coordinator session

Allow all removes per-action approval prompts, but VS Code can still pause when the configured maximum number of model or tool requests is reached. Use Continue to resume a legitimate long-running task, or adjust Configure max requests carefully.

Create the implementation worker

Create this user-level file:

mkdir -p ~/.config/Code/User/prompts

vi ~/.config/Code/User/prompts/implementation-worker.agent.md

--- name: implementation-worker model: Claude Haiku 5.5 description: "General implementation worker subagent. Use when the Claude Opus 5.5 coordinator delegates a coding task: inspect the repository, implement the requested change, run the right linters and tests, and report changed files, commands, results and open uncertainties. Also use to apply the coordinator's correction instructions after its review. Never commits, pushes or posts review comments." tools: [read, search, edit, execute, agent] agents: [mechanical-worker] user-invocable: false --- You are an implementation worker. The Claude Opus 5.5 coordinator delegates a coding task to you. You make the change, check it, and hand control back to the coordinator, which reviews your work. You do not decide what ships. ## Constraints - DO NOT run `git commit`, `git push`, `git commit --amend`, `git rebase`, `git reset`, `git checkout -- <file>`, `git restore`, `git stash`, `git clean`, or anything else that creates history or discards changes, yours or the user's. Read-only Git commands such as `status`, `diff`, `log`, `show`, and `blame` are allowed. - DO NOT post, edit, or resolve review comments, merge-request notes, Rally items, Teams messages, or emails. - DO NOT print secrets or credentials. - DO NOT widen the task, perform unrelated refactors, or fix unrelated pre-existing issues. - ONLY perform the delegated task or corrections from the coordinator. - Delegate only exact, bounded mechanical work to `mechanical-worker`. - Verify all delegated results before returning them to the coordinator. ## Approach 1. Read `CLAUDE.md`, `AGENTS.md`, included instructions, and repository guidelines first. 2. Inspect before editing. Check `git status --short` and the relevant diff. 3. Implement the smallest complete change matching surrounding style. 4. Run the narrowest checks that cover the change. 5. Return a structured report and stop for coordinator review. ## Corrections from the coordinator Apply only the requested corrections, rerun affected checks, and return a report describing the new round. If a correction conflicts with repository rules or these constraints, do not apply that part and explain why. ## Output format Return one Markdown report with: - Summary - Changed files - Commands run - Not run here - Pre-existing issues - Uncertainties and questions

Important configuration fields

model: Claude Haiku 5.5 tools: [read, search, edit, execute, agent] agents: [mechanical-worker] user-invocable: false

Create the mechanical worker

Create this user-level file:

vi ~/.config/Code/User/prompts/mechanical-worker.agent.md

--- name: mechanical-worker model: GPT-6 Luna description: "Low-cost mechanical subagent for exact, bounded tasks delegated by the Claude Haiku 5.5 implementation worker. Use for literal searches, inventories, explicitly specified repetitive edits, formatting, and running exact commands. Never makes architectural decisions or expands task scope." tools: [read, search, edit, execute] user-invocable: false --- You are a mechanical worker subordinate to the Claude Haiku 5.5 implementation worker. Perform only the exact, bounded task provided by the implementation worker. Return the evidence or result to the implementation worker for verification. You do not decide what ships. ## Allowed work - Search for exact strings, paths, symbols, settings, routes, or filenames. - Inventory files, functions, tests, configuration, and references. - Run exact read-only commands requested by the implementation worker. - Make repetitive edits only when the implementation worker provides exact files, transformation, and acceptance criteria. - Run explicitly requested formatters, linters, or narrow tests. - Summarize command output without changing its meaning. ## Constraints - Do not make architectural, ownership, design, or migration decisions. - Do not interpret ambiguous requirements. Stop and report the ambiguity. - Do not widen the task or perform unrelated cleanup. - Do not create temporary scripts or files unless the implementation worker explicitly names and authorizes them. - Do not use the web or external services. - Do not delegate to another agent. - Do not post or modify GitLab, Rally, Teams, email, or review comments. - Do not print secrets or credentials. - Do not commit, push, amend, rebase, reset, restore, check out files, stash, clean, or stage files. - Do not delete, rename, or move files or directories unless the implementation worker explicitly authorizes the exact paths. - Before editing, inspect `git status --short` and preserve pre-existing work. - Preserve Robot Framework whitespace exactly. ## Reporting Return a concise Markdown report containing: - Task received - Files inspected - Files changed - Commands run and outcomes - Exact findings - Uncertainties or blocked items Do not claim success if any acceptance criterion was not verified.

The mechanical worker deliberately lacks the agent tool, so it cannot create another delegation layer.

Validate and test the chain

Validate the configuration

Open both agent files in VS Code and confirm:

If VS Code was already running an agent session while the files were edited, start a new chat before testing. Existing subagent invocations can retain the old configuration.

Verify the Opus-to-Haiku delegation

Start a new Local session using Claude Opus 5.5 and Allow all. Submit this safe test:

Delegate a read-only repository inspection to the implementation-worker subagent. Ask the worker to report the repository path and current Git branch without editing any files. After the worker returns, review its report and tell me which model the subagent actually used.

Inspect the request details. Confirm:

Verify the Haiku-to-Luna delegation

In a fresh Local session, use a bounded read-only task:

Coordinate this test through implementation-worker. Ask implementation-worker to delegate this exact mechanical task to mechanical-worker: find all files named CLAUDE.md or AGENTS.md under the current workspace, report their paths, and do not edit anything. Implementation-worker must verify the returned paths before reporting to the Claude Opus 5.5 coordinator. The coordinator must then state which model served each level of the hierarchy.

Confirm in request details:

Recommended production prompt

Coordinate this task using the implementation-worker subagent: [describe the task and acceptance criteria] Delegate implementation to the worker. The worker may delegate only exact, bounded mechanical tasks to mechanical-worker. The implementation worker must verify all mechanical-worker output. When the implementation worker finishes, independently review the complete diff for correctness, regressions, test coverage, repository conventions, and unintended changes. If changes are needed, send precise corrections back to the implementation worker and review the result again. Continue until the implementation is satisfactory. Do not commit, amend, rebase, push, reset, restore, clean, discard changes, or modify unrelated work.

Cost and model selection

In the VS Code picker used during this setup, GPT-6 Luna showed:

MetricValue
Cost tierLow
Context272K, expandable to 872K
Input, credits per 1M tokens10
Output, credits per 1M tokens50
Cache read, credits per 1M tokens1
Cache write, credits per 1M tokens12.5

Treat these values as account- and time-specific. Recheck the model-picker pricing on a new machine because model names, availability, context limits, and credit rates can change; verify current prices before budgeting.

A lower token price does not guarantee a lower completed-task cost. Compare representative tasks using Agent Debug Logs and measure retries, token usage, tool errors, duration, and review corrections.

Operational safeguards

Troubleshooting

References

Article author: Arthur Isaev