# pick one npm install -g @github/copilot # Node 22+ winget install GitHub.Copilot # Windows brew install --cask copilot-cli # mac/Linux cd my-project && copilot copilot -sp "..." # one-shot, response only copilot --continue # resume last session
| /login | OAuth device flow — first run only |
| trust | Confirm you trust this folder (opt 2 remembers) |
| /init | Write .github/copilot-instructions.md |
| explore | “Read the auth files but don't write code yet” |
| plan | /plan Add OAuth2 with Google + GitHub |
| review | Push back on the plan · Ctrl+Y to edit it |
| build | “Proceed with the plan” / /fleet |
| verify | /diff — read it yourself — then run the tests |
| accept | Use the feature by hand. Green tests ≠ working demo |
| commit | “Commit with a descriptive message” |
Don't skip verify. The agent that wrote the code will happily weaken a test to make it pass. Keep this line handy:
Don't weaken tests or change the acceptance criteria to make things pass. Separate pre-existing failures from ones you introduced. Show the diff, then stop.
/clear between unrelated tasks. Attach reality: @file, #123, screenshots (Ctrl+V)./init analyses the codebase and writes .github/copilot-instructions.md: build/test/lint commands, architecture, conventions. If it exists, it proposes improvements.
All merged: .github/copilot-instructions.md (repo) · .github/instructions/**/*.instructions.md + applyTo: glob (path-scoped) · AGENTS.md · ~/.copilot/copilot-instructions.md (you).
/instructions lists & toggles them. Keep them short and non-conflicting — edits apply on the next session.
Shift+Tab cycles standard → plan → autopilot, or run /plan GOAL.
In plan mode Copilot analyses the repo, asks clarifying questions, writes a checklist to plan.md, and waits for your approval before touching code.
Plan it: multi-file changes, refactors, new features. Skip it: quick bug fixes, single-file edits, questions.
/session plan shows the current plan · Ctrl+Y opens it in your editor.
/undo (/rewind) rewinds the last turn and reverts file changes. It restores your whole workspace to the snapshot — your own manual edits are reverted too, and files created since are deleted whatever their Git status. Commit first./compact focus on the auth module steers what survives summarisation.The GitHub MCP server is built in. Add others to reach browsers, APIs, DBs, docs.
copilot mcp add playwright -- npx @playwright/mcp@latest copilot mcp add --transport http notion https://mcp.notion.com/mcp
In-session /mcp add opens a form — Ctrl+S to save, live immediately. Then /mcp list|edit|delete|enable|disable|auth.
Config: ~/.copilot/mcp-config.json (personal) · .mcp.json (local, closest wins) · .github/mcp.json (commit this one).
.vscode/mcp.json is not read by the CLI. Project servers load only after folder trust. Find servers at github.com/mcp
A folder with a SKILL.md (+ optional scripts) loaded only when relevant, so it doesn't burn context every turn.
.github/skills/pr-review/SKILL.md --- name: pr-review description: Review checklist. Use when asked to review changes before opening a PR. ---
Project .github/skills/ · Personal ~/.copilot/skills/ · /skills list|info|add|reload|remove. Invoke explicitly: Use the /pr-review skill. Ready-made: awesome-copilot.github.com/skills
Instructions = always-on conventions. Skills = situational playbooks.
Markdown profiles in .github/agents/NAME.agent.md. Fastest route: /agent → Create new agent → describe it in plain English → restart the CLI. Use via the picker, by name, or copilot --agent NAME.
The main agent hands work to another agent — built-in or one of yours. Each gets a separate context window, so the subtask's noise never reaches your thread; only the result does. Copilot picks one from your prompt, or name it: Use the explore agent to map how auth flows.
| explore | Read-only search. Changes nothing → runs in parallel |
| task | Tests, builds, linters — full output only on failure |
| general-purpose | Anything the main agent does, in its own context |
| code-review | Bugs & security in diffs, never style |
| research | Deep research — only via /research |
| rubber-duck | Second opinion, different model |
Context is your scarcest resource — subagents protect it.
/fleet [PROMPT] runs many subagents at once. Only worth it on an approved plan with genuinely independent steps: plan mode → iterate → pick “Accept plan and build on autopilot + /fleet”, or type /fleet implement the plan.
/tasks monitors subagents & shell jobs: ↑↓ navigate · Enter details · k kill · r remove · Esc back.
Autopilot keeps going without asking after each step. Stops when done, blocked, on Ctrl+C, or at --max-autopilot-continues. Works best with full permissions; with limited ones it auto-denies anything needing approval and may stall. It's sticky: /settings stayInAutopilot false.
Critiques Copilot's own plans, code and tests on a different model family, so it's less likely to share the same blind spots. It never edits. Reports blocking / non-blocking / suggestions, silent on style. Auto-consulted after planning, mid-build, after tests, and after repeated failures.
Rubber duck your plan. /rubber-duck What edge cases are missing?
Needs your session model to be Claude or GPT. Separate from /review and /security-review, which have no such restriction.
| /chronicle standup | Report of the last 24h (“for the last 3 days”) |
| /chronicle tips | Tips from how you work · cost tips for spend |
| /chronicle improve | Upgrade your copilot-instructions.md |
Also /chronicle search across all history · /resume · /share.
Desktop app for macOS, Windows and Linux, built on Copilot CLI. Type /app to launch it or get the download link.
Parallel workspaces (each its own worktree + branch) · mode, model and reasoning effort per session · GitHub native — issue → session, open/review/merge PRs, CI results · carries over your instructions, MCP servers and skills · adds automations and canvases.
All Copilot plans. Business/Enterprise: the separate Copilot app policy must stay enabled.
Infinite sessions — context compacts automatically. Compaction summarises, so old detail can be lost: re-state the goal after a long run.
| /context | Token usage breakdown |
| /usage | Session metrics, per-model totals |
| /clear · /new | Fresh start between tasks |
| /limits set | max-ai-credits VALUE per response |
Picking a model. Auto is the sane default; Opus-class for architecture and hard debugging, Sonnet-class for day-to-day speed. Run /model for your list — names change by plan.
Copilot asks before anything that modifies or executes. Choose: once, for the session, or no + tell it what to do instead.
copilot --allow-tool='shell(git:*)' \
--deny-tool='shell(git push)'
copilot --allow-all # --yolo: tools+paths+URLs
Non-negotiables: read the diff before you merge · never commit secrets · --allow-all can delete files · treat third-party skills and MCP servers as code you're installing.
| Shift+Tab | standard → plan → autopilot |
| Esc / EscEsc | cancel / interrupt the turn |
| Ctrl+C | cancel, clear; twice = exit |
@ FILE · # NUM | add a file · add an issue or PR |
! CMD | run shell directly (! alone = shell mode) |
| Ctrl+Y | edit the plan in your editor |
| Ctrl+Q | hold a message until the turn ends |
? · /help | quick help · full command list |
Hour two is where hackathons are lost. Work this top to bottom.
| what changed? | /diff · ! git status · ! git diff |
| mine or pre-existing? | ! git stash -u → re-run tests. Still failing = likely pre-existing. Say so. |
| wrong direction | Type the correction now, mid-turn. Don't wait. |
| gone too far | Esc Esc to interrupt → /undo |
| looping on a fix | Two strikes: after 2 failed attempts stop. /clear, reopen with the error, the file, and what you ruled out. |
| lost the plot | Context compacted — re-state goal + acceptance criteria in one message |
| nuke it | ! git reset --hard <last-good-sha> — only works if you committed |
Cut scope early. Not working 60% of the way through your budget? Drop it. Say it out loud to the agent: Drop the export feature. Dashboard renders real data.
Two people driving agents in one checkout = conflicts and lost work. Split the surface first.
| /worktree | New worktree off HEAD, switch to it (exp.) |
| /move | Move uncommitted changes into a new worktree (exp.) |
| /fork | Fork the session, keeping the conversation (exp.) |
| /delegate | Self-contained task → cloud agent opens a PR |
copilot-instructions.md so every agent sees it.Percentages of your budget — works for 4 hours or 2 days.
| before | Install · /login · check repo & API access · dependencies in · baseline build green. Not event time. |
| first 10% | Agree the demo: what's on screen at the end, 3 acceptance criteria, must-have vs. stretch. /init. Split worktrees. |
| next 10% | Walking skeleton — riskiest integration end-to-end, stubs elsewhere. Add only the MCP servers & skills it needs. Merge it. |
| middle 55% | Vertical slices: plan → rubber duck → build → /diff → test → commit. Interactive by default. Integrate hourly. |
| last 25% | Scope freeze. Integrate, /review, blockers only, rehearse the demo on the real build, /pr create |
| wrap | /chronicle standup · /chronicle improve |
Reach for /fleet + autopilot only when the plan's steps are genuinely independent.
@src/api.ts, #42, a mockup/diff before committing--allow-all without thinking