00Start here
Most Copilot tutorials — including GitHub's own older ones — teach the 2024 product: grey-text completions, a chat pane on the right, @workspace for questions, and a copilot-instructions.md if you are diligent.
That Copilot still exists, and it is still the one most people use. But it is now the smallest part of the product. Between the coding agent going GA in 2025 and the desktop app going GA in June 2026, Copilot became an agent runtime with five front ends — an editor, a terminal, a cloud worker, a desktop control room and an SDK — that all read the same configuration files. The people who built it changed how they talk about it accordingly.
Three statements from GitHub anchor the shift:
On why a desktop app was needed: "the agentic shift has made development faster, [but] it's also led to disjointed workflows, more context switching, and too much time spent reviewing agent-generated code."
GitHub Copilot app announcement, June 2026
On what supervising a fleet actually buys you: "The speed gain is not that each task finishes faster; it's that you unblock more work in the same timeframe."
GitHub blog, orchestrating agents with mission control
On where the human belongs: "Chat is where you instruct, discuss, and reason through ambiguity. Canvases are where that intent becomes visible work you can inspect, steer, and verify."
GitHub Copilot app announcement
Everything below follows from those three sentences: the unit of work is no longer a suggestion, the bottleneck is review, and your job is to make the work verifiable.
01Audit your own setup first
Before any technique, check what you have. Most people who feel Copilot is "handy but not transformative" have never written a file it reads. Every session starts from zero, every correction dies with the chat, and the tool cannot compound.
From a repository root, in pwsh:
copilot version # current? it updates weekly
copilot plugins list # every plugin, MCP server, skill — non-interactive
gci .github\agents, .github\skills, .github\instructions, .github\hooks
gci AGENTS.md, .github\copilot-instructions.md
gci ~\.copilot\agents, ~\.copilot\skills, ~\.copilot\hooks
gci .github\workflows\copilot-setup-steps.yml # can the cloud agent run your tests?
Then inside a session: /env (what loaded — instructions, MCP servers, skills, agents) and /instructions (each instruction file, separately, with a toggle). In VS Code: Chat → Diagnostics shows the same thing.
| If this is empty | What you are losing |
|---|---|
AGENTS.md | Every surface — editor, CLI, cloud agent, code review — meets your repo as a stranger, every time |
.github/instructions/ | Conventions for tests, migrations, UI are re-explained per prompt, or ignored |
.github/skills/ | Your repeatable procedures live in your head; every "do the release" is typed fresh |
.github/agents/ | No read-only reviewer, no pinned-model specialist — you rebuild the persona in prose each time |
.github/hooks/ | Every rule is advisory. Nothing is guaranteed |
copilot-setup-steps.yml | The cloud agent writes code it cannot run, then opens a plausible PR |
| All of them | Your setup does not compound. This is the single biggest gap |
AGENTS.md, an applyTo instruction, a skill or a hook fixes every future run on every surface at once — including the reviewer that reads your colleagues' PRs. Your error rate should trend down over months. If it isn't, you are re-teaching the same lessons daily.02The four shifts
Completions → delegation
The old loop: type, accept grey text, type. The new loop: write one complete brief, the agent works, you review the result. Completions and next-edit suggestions are still the right tool while you are typing — a rename that ripples, a signature change needing its call sites — but they are a typing aid, not the product. The product is the agent, and it is sized for tasks, not lines.
The corollary: if you find yourself steering the agent every few minutes, your brief was incomplete, not the model weak.
Prompting → instruction files
A good prompt helps once. A line in AGENTS.md helps every agent, on every surface, forever — and it is read by Claude Code, Cursor and Gemini CLI as well, so it outlives your choice of vendor. Re-explaining a convention weekly is a bug in your repository, not in the model.
One surface → the right surface
Copilot is five products sharing a brain. Each has a different latency, a different amount of autonomy and a different correct use, and reaching for the wrong one is the most common way to have a bad time. That is section 03.
Watching one agent → supervising several
Once a task takes twenty minutes unattended, the question stops being "how do I prompt" and becomes "how many can I run, and how do I know when one drifts". The Copilot app, /fleet, /delegate and mission control are all answers to that question. That is section 07.
03Five surfaces, one configuration layer
| Surface | You are | Latency | Use for |
|---|---|---|---|
| Completions / next edit | Typing | Instant | Finishing the line; refactor ripple through open files |
| IDE agent mode | Watching | Minutes | Work you want to see happen: debugging, UI, anything with the integrated browser or debugger |
| Copilot CLI | Watching or scripting | Minutes | The most capable single surface: plan, autopilot, subagents, fleet, scheduling, headless |
| Cloud coding agent | Away | Up to 59 min | A fully specified task that ends in a PR — assigned from an issue, /delegate, a @copilot comment, or a schedule |
| Copilot app | Supervising | — | More than two agents in flight: worktrees made for you, canvases, My Work, agent merge |
The leverage is the last column of the table you don't see: all five read the same files. AGENTS.md, path-scoped instructions, skills, custom agents, hooks and MCP configuration are the single place you invest, and every surface — including Copilot code review on your colleagues' pull requests — gets better at once.
Rules of thumb
- One agent you are watching → the IDE or the CLI. Prefer the CLI when the work is shell-heavy or you want autopilot, subagents, or scheduling; prefer the IDE for the debugger, the browser and visual diffs.
- A task you could write as a good issue → the cloud agent. If you cannot write it as an issue, it is not ready for the cloud agent.
- More than two things running → the app, or the worktree discipline it automates.
- Something you want to happen without you → automations (cloud, on a schedule or a GitHub event) or the CLI's
/every.
.agent.md can silently do nothing. The CLI has none of these gaps, which is the practical reason this page leans on it.04Verification — the primary lever
The logic is simple. An agent stops when the work looks done. Without a check it can run, "looks done" is the only signal available — and you become the verification loop, at review time, which is the most expensive moment to find out.
Give it something that returns pass or fail and the loop closes on its own: the agent does the work, runs the check, reads the result, iterates.
The ladder
| Rung | Mechanism | Use when |
|---|---|---|
| 1 · In the brief | "…then run dotnet test and fix any failures; paste the summary" | Any task, today, zero setup. The cheapest and most skipped |
| 2 · The environment | .github/workflows/copilot-setup-steps.yml installs what the suite needs, so the cloud agent can run it | Anything delegated to the cloud. Without it, rung 1 is a polite request the agent cannot honour |
| 3 · A hook | agentStop runs the suite every time the agent finishes; preToolUse guards what it may run | A rule that must hold in every session, for every developer |
| 4 · A fresh reviewer | A read-only custom agent, or Copilot code review, sees only the diff and the criteria and tries to refute the result | High-stakes changes; anything that ran unattended |
Rung 4 deserves its own note. The agent that did the work is the worst judge of the work — models prefer their own output. A reviewer with no editing tools and a fresh context sees the diff and your criteria but not the reasoning that produced them, so it evaluates on the merits. The kit's reviewer.agent.md is exactly that: tools: ['search', 'fetch'] means it cannot change code, which is a stronger guarantee than telling it not to.
Rewrite your prompts
✗ add validation to the signup form
✓ add server-side validation to SignupRequest: email must be RFC-5322
valid, password ≥ 12 chars. add tests for both failure cases and the
happy path. run `dotnet test --filter Signup` and paste the summary.
✗ the build is broken
✓ `dotnet build` fails with: [paste]. fix the root cause — do not
suppress the warning or pin the package. verify the build succeeds.
✗ make the report page faster
✓ /reports/monthly takes 4.2 s (trace attached). target < 1 s.
profile first, then change the query, not the caching. show me
before/after timings from the same trace harness.
And always: ask for evidence, not assertions. "Paste the test output" beats "confirm it works." Evidence is faster to review than a re-run, and it is the only thing you have for a session you were not watching — which is every cloud-agent run.
05Context is the budget
Performance degrades as the context window fills. Everything the agent reads, every command's output, every failed attempt lives there. Copilot auto-compacts near 95% of the limit, and VS Code spills large tool output to disk — but by the time those fire, the session has usually already dulled.
| Tool | What it does | Use when |
|---|---|---|
/clear · /new | Start a new conversation | Between unrelated tasks — almost certainly more often than you do |
/compact <focus> | Summarise history, steered: "keep only the Rust variant" | Mid-task and running long; always give it a focus |
/rewind | Restore conversation and files to an earlier point — no git needed, your own edits kept | A failed attempt happened |
/ask (CLI) · /btw (VS Code) | Side question whose answer never enters history | "What's the flag for X?" mid-task |
/context | What is consuming the window, visually | The session feels dull and you want to know why |
| Subagents · Explore | Research in a separate context, reporting back a summary | Any investigation that reads many files |
@file · #123 | Attach exactly one file, issue or PR | Instead of pasting — the agent pulls what it needs |
Two rules of thumb
- After two failed corrections on the same issue,
/clearand start over with a better brief that incorporates what you learned. A clean session with a good prompt beats a long session full of failed approaches. - Prefer
/rewindto correcting in chat. Correcting leaves the wrong approach in context, where it keeps influencing the model. Rewinding deletes it. VS Code's fork from checkpoint is the same move when you want to keep the original branch of the conversation.
AGENTS.md discipline
AGENTS.md loads on every request, on every surface. That makes it precious real estate, and the most common failure is bloat: GitHub's own best-practice page says it in one line — "lengthy instructions can dilute effectiveness." If Copilot keeps violating a rule you definitely wrote, the file is too long.
The test for every line: "would removing this cause the agent to make a mistake?" If not, cut it.
| Include | Exclude |
|---|---|
| Build, test, lint commands — and how to run one test | Anything readable from the code |
| Conventions that differ from the default | Style the linter already enforces |
| Architecture boundaries, with the reason | A tour of the directory tree |
| Where the real docs live | The docs themselves |
| Known traps, and the incident that proves each | Rules nobody follows |
AGENTS.md. Things that apply to some files go in .github/instructions/*.instructions.md with an applyTo glob — costing nothing until a matching file is in context. Things that apply sometimes go in a skill, loaded on demand. One enormous always-on file is the anti-pattern all three exist to avoid.06How to write a brief now
Delegation means full task context in turn one: goal, constraints, acceptance criteria. Think hard once rather than iterating fast. A cloud-agent task in particular is not a chat message — it is closer to a well-written issue, because nobody is watching.
GOAL what "done" looks like, in one sentence
CONTEXT which files; what pattern to follow; #issue or @file
("look at OrdersController — follow that pattern")
CONSTRAINTS what must not change; what is out of scope;
libraries you will and will not accept
VERIFY the exact command that proves it — and "paste the output"
Plan mode — still earns its place here
GitHub's guidance is explicit: "models achieve higher success rates when given a concrete plan to follow." Use plan mode (Shift+Tab in the CLI; the Plan agent in the IDE) for multi-file changes, refactors with many touch points and new features; skip it for single-file fixes. The modern form is plan, then hand the plan to autopilot:
copilot --plan --mode autopilot -p "…" # headless: produce a plan, then implement it
Shift+Tab # interactive: standard → plan → autopilot
The plan persists across turns and compaction, so it is also your cheapest defence against goal drift in a long session.
Let the agent interview you
For anything large, start minimal and make Copilot extract the spec:
I want to build [one line]. Interview me before writing anything.
Ask about the data model, the failure cases, the UI, what must not
change, and the tradeoffs I haven't considered. Don't ask obvious
questions. When we've covered everything, write SPEC.md and stop.
Then /clear and execute the spec in a fresh session — or hand SPEC.md to the cloud agent. Clean context, written reference.
Three more techniques
- Challenge the output. "Prove this works — show me the diff and the test output." The built-in Rubber duck agent exists to push back; use it before you ship, not after.
- Ask codebase questions like you would ask a senior engineer. The Explore and Research agents are the onboarding tool for unfamiliar code: "how does auth handle token refresh, and do we already have OAuth utilities?"
- Use voice. Ctrl+Space in the CLI toggles dictation; VS Code has on-device multilingual dictation. Roughly three times faster than typing for long briefs — and briefs should be long now.
07The parallelism ladder
This is where the leverage lives, and where most tutorials stop. Six rungs, each a different answer to "who holds the plan, and where does the work run?"
| Rung | Who decides what runs next | Where it runs | Use for |
|---|---|---|---|
| Worktrees | You | Your machine, isolated checkouts | Independent features in parallel, no collisions |
Subagents · /tasks | The main agent, turn by turn | Your session, separate contexts | Research, verification, anything context-hungry |
/fleet | The main agent as orchestrator | Your session, many subagents | A plan with independent steps: a test suite, a multi-module refactor |
/delegate · cloud agent | The brief; nobody watches | GitHub Actions, ephemeral | A fully specified task that ends in a PR |
| Copilot app | You, from one screen | Local or cloud sandboxes, one worktree each | Supervising several of the above at once |
| Mission control | You, from anywhere | github.com/copilot/agents, also mobile | Assign, steer and review cloud runs across repos |
Worktrees
An isolated checkout per task, so edits never collide. The CLI's /worktree (experimental) makes one for a separate conversation; the app does it for every session — "no manual setup, no cleanup, no branch juggling". If you are not in the app, do it by hand:
git worktree add ..\repo-oauth feature/oauth
cd ..\repo-oauth; copilot # its own session, its own files
copilot app # open the app in this directory instead
Name them by outcome ("oauth-tests-green"), and use the CLI's session sidebar (n new, x close) to keep them straight.
Subagents — the cheapest, most underused
Six built-in agents ship with the CLI — Explore, Task, General purpose, Code review, Research, Rubber duck — plus any .agent.md you write, and the main agent can hand work to them. /tasks shows what is running; Enter teleports into a subagent's session, B pushes a blocking one to the background. Two canonical uses: research ("use the Explore agent to find how we handle retries before you change anything") and adversarial verification ("when you are done, have @reviewer check the diff in a fresh context"). They read forty files in their context and hand back a paragraph.
Queue while it works. Ctrl+Enter queues a prompt, a shell command or a slash command during a turn; VS Code does the same and lets you reorder what is pending. Steering mid-run beats interrupting.
/fleet — the big one on your machine
Give /fleet a plan and the main agent breaks it into independent subtasks, runs them in parallel subagents — each with its own context window — and manages the dependencies between them. It is the right tool when the work is genuinely parallel and the wrong tool for anything sequential.
/fleet write unit tests for every public method in src/Billing/,
one test class per source file, following tests.instructions.md.
use @reviewer on each file when it is done.
Three things to know. Subagents default to a low-cost model — name a stronger one in the prompt, or reference a custom agent with @name that pins its own. It costs more requests than one agent would; save it for work wide enough to justify the fan-out. And there is no filesystem isolation between subagents — if two steps touch the same file, they are not independent, and you should say so.
/delegate and the cloud agent
/delegate hands the task to the cloud coding agent, which works in an ephemeral GitHub Actions environment and opens a pull request. The constraints are the design: 59 minutes, hard; one branch, one PR; one repository; and only what copilot-setup-steps.yml installed. Write the task to fit — scoped to something finishable, as one coherent change, with the verification step in the brief and the environment able to run it.
GitHub's own advice on which work to send where: delegate tangential tasks, documentation and separate-module refactors; keep core feature work, debugging and exploration local.
The app and mission control
Once three things are running you need a control plane, and "four terminal tabs" is not one. The app gives you My Work (every session, issue, PR and automation), a worktree per session, canvases (a plan, a PR, a browser, a terminal, that both you and the agent edit) and agent merge, which watches CI, fixes failing checks and merges under rules you set. Mission control at github.com/copilot/agents is the same idea for cloud runs — assign across repos, watch the session log, pause or restart, jump to the PR — and it works from your phone.
The signals that mean intervene now, from GitHub's own guide: failing tests, unexpected files, scope creep, circular behaviour. Batch similar reviews so inconsistencies across related PRs are visible.
08Making it permanent
| Mechanism | Where | Loads | Enforcement | Use for |
|---|---|---|---|---|
AGENTS.md | repo root | Every request, every surface | Advisory | Conventions that always apply |
*.instructions.md | .github/instructions/ | When applyTo matches | Advisory | Rules for tests, migrations, UI — by path |
*.prompt.md | .github/prompts/ | You type /name | Advisory | A repeatable task with arguments |
SKILL.md | .github/skills/<name>/ | Judged relevant, or /name | Advisory | A procedure with bundled scripts and references |
*.agent.md | .github/agents/ | Selected, or delegated to | Tool list is hard | A persona with its own tools and model |
| Hooks | .github/hooks/*.json | At lifecycle events | Deterministic | Things that must happen with zero exceptions |
| Plugins | marketplace | Installed as a unit | — | Distributing all of the above |
| Copilot memory | GitHub, per user | Across CLI, cloud agent, review | Advisory | What Copilot learned working with you |
User-level copies of each live under ~/.copilot/ (%USERPROFILE%\.copilot; relocate with COPILOT_HOME). Repository-level wins for anything a colleague should also get — an instructions file only on your machine helps exactly one person.
Skills
The rule of thumb: if you do something more than once a week, make it a skill. A skill is a folder, not a file — the instructions plus any scripts and references it needs — and its description is the matcher: it must say what the skill does and when to use it, or it never fires.
.github/skills/release-notes/SKILL.md
---
name: release-notes
description: Draft release notes from merged PRs since the last tag.
Use when asked for release notes or a changelog entry.
allowed-tools: shell
---
1. `git describe --tags --abbrev=0` for the last tag
2. `gh pr list --state merged --search "merged:>$TAG_DATE" --json ...`
3. Group by label; one line per PR; link each
4. Write to CHANGELOG.md under a new heading; do not commit
Keep SKILL.md under 500 lines; detail goes in references/, read only if the skill runs. That is progressive disclosure — the short file is loaded to judge relevance, and a skill that inlines everything defeats its own mechanism. /create-skill in VS Code, or "write me a skill that…" anywhere, drafts one from a description.
Custom agents
.github/agents/reviewer.agent.md
---
name: reviewer
description: Reviews a diff for correctness and security. Read-only.
tools: ['search', 'fetch']
model: claude-opus-4.8
handoffs:
- label: Fix the findings
agent: implementation
---
You are a senior engineer reviewing a diff. Report only findings that
affect correctness, security, or a stated requirement…
Two things make this worth copying. The tool list has no editor, so the reviewer cannot modify code. And the model is pinned, so the expensive model is spent here and nowhere else. handoffs turn agents into a workflow; user-invocable: false hides one from the picker so only other agents can call it; agents: lists who it may delegate to.
When not to write one: when instructions or a skill would do. An agent is a persona with a tool boundary. A checklist is a skill. A convention is a line in AGENTS.md. Having all three say the same thing in slightly different words is the most common way a setup becomes unexplainable.
Hooks
Hooks are deterministic; everything above is advisory. Anything you truly cannot tolerate being skipped belongs in a hook. They are JSON, live in .github/hooks/ (or ~/.copilot/hooks/), and carry both a bash and a powershell body so the same file works for the Windows and the Mac colleague:
{ "version": 1,
"hooks": {
"agentStop": [{
"type": "command",
"bash": "dotnet test --nologo -v q",
"powershell": "dotnet test --nologo -v q",
"timeoutSec": 300 }] } }
| Event | What to hang on it |
|---|---|
sessionStart | Print the branch, the open PR, the last log entry — orient the agent for free |
userPromptSubmitted | Log what was asked, for /chronicle and for the audit trail |
preToolUse | Guard a command: refuse git push --force, writes under migrations/. In VS Code this can block the call |
postToolUse | Auto-format after every edit — kills a whole class of review nitpicks |
agentStop | Run the suite every time the agent thinks it is done |
errorOccurred | Notify you; capture the log |
You do not have to hand-write these: /create-hook in VS Code, or "write a hook that runs the formatter after every edit". GitHub's framing for when to reach for each layer: add hooks when prompting is not enough; add plugins when distribution becomes the problem.
Plugins — Agent Plugins 1.0
An open standard (GitHub, AWS, Anysphere, Microsoft, OpenAI, Vercel, Google) that packages skills and MCP servers into one installable unit, GA across VS Code, the CLI, the app and the SDK since August 2026. skills/ and mcp.json are portable to any compliant client; Copilot-specific pieces — agents, commands, hooks, canvases — are quarantined in com.github.copilot/. Install from the Awesome Copilot marketplace built into each client; copilot plugins list shows what is live. The moment a second team wants your skills, this is how they travel.
Memory and sessions
Copilot memory is shared across the CLI, the cloud agent and code review — knowledge accumulates instead of being re-supplied. It is also where a wrong fact becomes durable, so correct mistakes deliberately ("forget that we use Moq; we use NSubstitute") rather than working around them. Sessions persist too: copilot --continue, /resume, and /chronicle standup for "what did I do this week", /chronicle tips for what the CLI noticed you could be doing better.
09Models and credits — where to spend
Copilot is a model marketplace. The picker in mid-2026 spans OpenAI's GPT-5.5 generation and GPT-5.3-Codex, Anthropic's Claude Sonnet 5 and Opus 4.8, Google's Gemini 3.1 Pro and 3.7 Flash, and cheaper tiers alongside — and they are not priced alike. Premium requests are consumed by a multiplier: an included model costs nothing, a frontier model up to 10× per request, against a monthly quota.
The single most expensive habit of advanced users is leaving the picker on a frontier model for everything, including renames. Spend judgement on judgement; spend nothing on reading.
| Put it on | Which tier |
|---|---|
| Architecture, a hard bug, security review, the decision you will live with | Frontier — Opus, the top GPT tier |
| Your main session, most days | Auto — GitHub routes it, shows which model ran, and rate-limits you less |
| Fleet subagents, scaffolding, mechanical migrations, formatting sweeps | Sonnet, Codex, Flash — or the subagent default |
| Triage, "does this file mention X" across a thousand files | The cheapest included model |
/model # switch the session (VS Code: per turn)
/usage # consumption and remaining premium requests
/limits set 2 # cap AI credits per turn — a budget, not a hope
/autopilot <objective> # with an optional credit cap for the run
copilot --usage-output-file # per-agent metrics as JSON, for the scripted runs
Pin the model per agent, not per moment. model: in an .agent.md decides once, correctly, then never again: a reviewer on a strong model, a scaffolder on a cheap one. A fleet with cheap finders and one strong judge costs a fraction of the all-frontier version and finds the same bugs.
10In the terminal
The CLI is the surface GitHub is shipping fastest — weekly releases, with plan mode, autopilot, subagents, fleet, scheduling and headless mode all arriving there first. It needs PowerShell 7 (winget install Microsoft.PowerShell; Windows 11 ships 5.1) and runs best in Windows Terminal.
copilot # interactive; trusts the directory first
copilot --agent reviewer # start on a named agent
copilot --cloud # the whole session in a cloud sandbox
copilot --continue # pick up the last session
!dotnet build # run a command yourself, bypassing the model
$ # hand the terminal to a real shell; Enter to come back
/diff # review the change; C comments a line, Enter submits
/pr # view, create or fix pull requests from here
Autopilot, safely
Autopilot keeps working through steps without waiting for you, and stops when the task is done, when it is blocked, when you press Ctrl+C, or when --max-autopilot-continues runs out. It consumes credits on its own, and it cannot do anything you have not permitted — so the two settings to make deliberately are permissions and sandboxing, in that order:
/sandbox enable # confine file access first…
/allow-all auto # …then stop approving (alias /yolo)
/allow-all show # the default: display actions, approve each
defaultMode and defaultPermissionMode in settings once you know what you want.Review, the new bottleneck
Output doubled; review did not. The CLI's Code review agent and the /diff viewer are for your own changes before they leave the machine. Copilot code review on the PR is the first pass for everyone else's — it reads the same instruction files, so its quality is downstream of your AGENTS.md. Set it to run automatically on open or on new commits; use Balanced effort for security-sensitive or cross-service changes and the default Lite for the rest. GitHub's own wording: it is "not guaranteed to spot all problems" — a first pass that clears the boring findings so human review can spend itself on design.
Copilot as a component
copilot -p "summarise the failing tests" < test.log
copilot --plan --mode autopilot --max-autopilot-continues 10 -p "…"
git diff main | copilot -p "list any change that alters a public API"
Programmatic mode (-p) turns Copilot into a filter — scriptable from a git hook, a build script, a CI step. The Copilot SDK (GA June 2026; TypeScript, Python, Go, .NET, Rust, Java) is the same runtime as a library — planning, tool calls, file edits, streaming, MCP — for when you want your own tools in front of it, and it is the harness Microsoft Agent Framework builds on. The test for reaching for either: is this a thing I want to happen without me?
MCP — tools beyond the shell
The GitHub MCP server is preconfigured. The high-value additions are systems that hold answers your repo cannot give: the issue tracker, the observability stack, the design system, Copilot Spaces. copilot mcp add --transport http NAME URL registers one. Two disciplines: every server costs context (its tool schemas load each session — /context shows the bill), and tool output is data, not instructions — a ticket comment or a web page can carry text that reads like a command. Use read-only credentials wherever the work is read-only; that is more reliable than asking an agent not to delete things.
11Beyond the repo — ops, documents, data
Step one — give it something to read
An agent is only as useful as the context it can reach, and neither of the two things that supply it is Copilot configuration. A plain-markdown wiki in git — hosts, decisions and why, runbooks for anything done less than monthly, where the dashboards and tickets live, traps and the incident that proves them — wired in with one line in AGENTS.md or /add-dir. And CLI access to live data, because pasting is the worst option available: stale, truncated, unrepeatable. Both are the subject of the work-wiki lesson; this page assumes they exist.
Step two — find the verification loop
| Discipline | The check the agent can run |
|---|---|
| Operations | Get-Service, Get-WinEvent, kubectl get, az … show — the state after the change, as JSON |
| Data | sqlcmd, duckdb, a script that prints a number; the row count before and after |
| Documents | pandoc builds the docx; pdftotext reads it back; the agent checks its own output against the spec |
| Infrastructure | terraform plan, bicep build, a lint — before apply, and the plan is the evidence |
| Reports | A PowerShell cmdlet piped to ConvertTo-Json: objects the model parses exactly, not scraped text |
PowerShell's edge over bash is the one people miss: cmdlets emit objects, so | ConvertTo-Json turns any system state into something the model reasons about precisely. "Use ourtool --help to learn it, then…" teaches it a bespoke CLI in one line.
Step three — write the domain knowledge down
Every team has conventions an agent cannot guess: the naming of environments, which tenant is which, the release calendar, the ticket that explains why the weird thing is weird. Each becomes an instruction line, a skill or a wiki page — written once. The most quietly valuable is a runbook skill: "deploy the service" as a SKILL.md with the exact commands, the check at each step, and the rollback. The next incident at 2 a.m., the agent runs it and you watch.
12Away from the keyboard
The longest runs happen when you are not at the terminal, and Copilot has more ways to work unattended than any other surface of the product.
| Tool | What it does | Use for |
|---|---|---|
| Cloud coding agent | Assign an issue, /delegate, @copilot in a PR, or Slack / Teams; a PR comes back | Anything you can write as an issue |
| Automations | The cloud agent on a schedule or a GitHub event, with permission gates before writes | Dependency bumps, issue triage, the weekly report, security-campaign fixes |
/every 30m <prompt> · /after 2h <prompt> | The CLI's lightweight scheduler; x removes one | Watch a deploy, a log, a long test run; tell you only when something changes |
/autopilot <objective> | Work until done, with a credit cap | The overnight run you want a morning report from |
| Mission control · GitHub Mobile | Steer a running cloud session from the phone: pause, refine, restart, open the PR | Catching drift before it costs the 59 minutes |
copilot --cloud | The whole session in a cloud sandbox | Work from a machine with nothing installed |
/keep-alive 4h | Stops the laptop sleeping under a run | The lid-closed overnight job on a Windows laptop |
| Canvases · shared sessions | A plan or a PR that the agent updates and a colleague can steer | Hand-off without a meeting |
The pattern that ties them together is the one from section 04: give the unattended run a way to know it is done. A cloud task without a verification step is an hour spent on a plausible wrong PR. An /every without a condition is noise; one with "report only if the deploy status is not Succeeded" is an instrument.
13Tools on the PATH
An agent is exactly as capable as the command-line tools it can call. Copilot cannot make a PDF, query a database or lint a template by wanting to — it needs a binary on the PATH that does it and returns an exit code. Installing the right fifteen is the cheapest upgrade on this page, and on Windows winget makes it one line each.
Three selection rules. Prefer tools with a non-interactive mode — an agent cannot answer a prompt. Prefer machine-readable output (--json, ConvertTo-Json, exit codes) over pretty output — it is the difference between a check and a report. Prefer one tool that does a thing well over a GUI app with a CLI bolted on.
| Tool | Install | What the agent gets |
|---|---|---|
pwsh | winget install Microsoft.PowerShell | Required for the CLI; objects instead of text on every pipe |
gh | winget install GitHub.cli | Issues, PRs, checks, releases from the shell; gh run watch is a verification loop for CI; gh pr checks is what agent merge watches |
rg, fd | winget install BurntSushi.ripgrep.MSVC sharkdp.fd | Fast search that respects .gitignore, so agents stop reading node_modules and bin\ |
jq, yq | winget install jqlang.jq MikeFarah.yq | Precise checks on any --json output and on YAML pipelines |
pandoc | winget install JohnMacFarlane.Pandoc | md → docx / pptx / html and back; --reference-doc for house Word styles; docx → md so the agent can read what a colleague sent |
typst | winget install Typst.Typst | The modern answer to "give me a PDF": source → PDF in milliseconds, real typography |
poppler (pdftotext) | winget install oschwartz10612.Poppler | Extract a spec or a datasheet with layout, so a table reads as a table |
sqlcmd, duckdb | winget install Microsoft.Sqlcmd DuckDB.cli | SQL questions of SQL Server, or of a CSV, without writing a program |
az, kubectl | winget install Microsoft.AzureCLI Kubernetes.kubectl | The actual cloud and cluster state — -o json on both |
delta / difft | winget install dandavison.delta | Structural diffs — a reviewer agent sees moved code as moved, not delete+add |
| Formatters | dotnet format ships; winget install Prettier.Prettier, astral-sh.ruff | The postToolUse hook needs something to call. No formatter, no hook |
uv | winget install astral-sh.uv | Python envs and tools without the venv dance: uv run, uvx |
watchexec | winget install watchexec.watchexec | Re-run the check on every save — the loop without the agent in it |
AGENTS.md — "available: pwsh 7, gh, rg, jq, pandoc, sqlcmd, az" — saves a probing Get-Command per tool per session and stops it proposing tools you do not have. Better: make the list a skill with the exact invocations that work on your machine, so it loads only when a document or a database is in play. And remember WSL is a separate home: tools and config on the Windows side are invisible inside it, and vice versa. Pick one side deliberately.14The starter kit
Four files that turn the ideas above into configuration. Copy them into a repository's .github/ and adapt. Nothing here is specific to one machine, and every one of them carries both a Windows and a Unix form where that matters.
/brief asks for each part and refuses to start without the last one.
Two more ship with the work-wiki lesson and are worth taking together: an AGENTS.md template and the read-only reviewer.agent.md.
agentStop hook reports it. Ask the agent to git push --force and check the preToolUse hook refuses. Delegate a trivial task to the cloud agent and read its session log to confirm the setup steps ran and the suite executed. A guard you have never seen fire is a guard you have.15What to do, in order
This week — thirty minutes
- Write
AGENTS.md— commands, conventions that differ from the default, traps — and commit it. Nothing else on this page pays off faster. winget install Microsoft.PowerShell GitHub.Copilot GitHub.cli; runcopilotfrompwshin Windows Terminal; press Shift+Tab into plan mode on a real task.- Next time you correct Copilot, stop and ask: should this be a rule instead? Then write it.
- Add "run the tests and paste the summary" to the end of every brief.
- Run
/usageat the end of the week and see where the premium requests went.
Next week
- Add
copilot-setup-steps.yml, then/delegateone well-specified task with a verification step. Read the session log. - One
applyToinstructions file for your tests. One skill for the thing you do every Friday. - Install the kit's
hooks.json; break a test and watchagentStopcatch it. - On the next multi-module task, put it through
/fleetand watch/tasks. - Turn on Copilot code review for your repo, Lite effort, on PR open.
The month after
- Copy in the read-only reviewer agent, pin it to a strong model, and make "have
@reviewercheck it" the last line of every brief. /sandbox enable, watch a few runs, then/allow-all auto. Try/autopiloton something substantial and walk away.- Install the Copilot app and run three sessions in parallel on three worktrees it made for you.
- Put one automation on a schedule — dependency bumps, or the weekly report — and see whether you read it.
- Write the runbook skill for the thing that pages you.
16Anti-patterns
| Pattern | Symptom | Fix |
|---|---|---|
| Autocomplete-only | Paying for five surfaces, using one | Write an AGENTS.md today; try the CLI in plan mode |
| Correcting instead of ruling | The same mistake, every session, on every surface | Write the rule. This is the one that matters |
| The undocumented repo | Re-explaining a convention weekly | That is a repo bug, not a model failure |
| One giant instructions file | Copilot ignores rules you definitely wrote | Prune; move path rules to applyTo, sometimes-rules to skills |
| Uncommitted instructions | Works for you, not for the team or the reviewer | Commit them. The repo teaches every agent |
| Vague skill descriptions | The skill never fires | The description is the matcher: what and when |
| The vague cloud task | An hour spent on a plausible wrong PR | Scope, files, what must not change, how to verify |
| Unscripted test setup | The agent writes code it cannot run, then stops | copilot-setup-steps.yml |
| Auto-approve, no sandbox | Removing your brakes | /sandbox enable first, then /allow-all |
| Frontier model on everything | Quota gone by the 10th | Auto for the session; pin strong models in the agents that need them |
| Reviewing with the same agent | The reviewer agrees with everything | A read-only agent in a fresh context that sees only the diff |
| The kitchen-sink session | Task, unrelated task, back again | /clear between unrelated tasks |
| Interrupting constantly | Steering every few minutes | The brief was incomplete — write the full brief; queue, don't interrupt |
/fleet for sequential work | Subagents waiting on each other; triple the requests | Fleet is for genuinely independent steps |
| Four terminal tabs | Lost track of which agent is where | The app, or worktrees named by outcome |
The one-paragraph version
Give the agent a way to check its own work — in the brief, in the environment, in a hook, and in a reviewer that cannot edit — because that is the difference between a mergeable pull request and a plausible one. Write one complete brief up front instead of steering turn by turn. Guard your context like a budget: clear often, rewind past failures, delegate reading to subagents. When Copilot gets something wrong, write a rule in a committed file rather than a correction in chat, so every surface — editor, terminal, cloud and reviewer — improves at once and your setup compounds. Pick the surface by how much you intend to watch. And when the work is bigger than one agent, don't hold it in one conversation: worktrees for independent work, /fleet for parallel steps, /delegate for anything you can write as an issue, and the app when you are supervising rather than typing.