Quick answer
Use inline suggestions for routine code, chat to understand and debug, agent mode for multi-file changes you can review, custom instructions to encode your team's conventions, and the coding agent for well-scoped issues. Treat every output as a pull request from a fast but fallible teammate: read it, test it, and check security.
The main ways to work with Copilot
| Mode | What it is | Good for |
|---|---|---|
| Inline suggestions | Completions as you type | Boilerplate, familiar patterns, tests |
| Chat (ask) | Q&A about code in your IDE or on GitHub | Explaining code, debugging, learning an API |
| Edit / plan / agent modes | Targeted edits, plans, or multi-step autonomous work in the editor | Refactors, features touching several files |
| Copilot CLI | Agent features in the terminal, reported as generally available since February 2026 | Command-line workflows |
| Code review | Copilot as a pull request reviewer | First-pass review comments |
| Coding agent | Assign an issue to Copilot; it works in a sandbox and opens a draft pull request | Well-defined tasks, backlog cleanup |
GitHub's documentation says chat, agent and plan interactions generally consume "premium requests" scaled by the model you pick, with allowances depending on your plan. Check the current rules to avoid surprises.
Give Copilot the context it needs
Prompt for chat and agent mode
In this repository's
ordersmodule, add pagination toGET /orderswithpageandpage_sizequery parameters (default 20, max 100). Follow the existing error-handling style incustomers. Update the OpenAPI spec and add unit tests for page boundaries. Don't change unrelated files.
This prompt names the location, behavior, limits, a style reference, related artifacts, and a scope boundary.
Practical tips
- Reference files and symbols rather than describing them.
- Include the exact error message, stack trace and versions when debugging.
- Ask for a plan first on larger changes, and approve it before edits.
- Request tests alongside the change.
- Choose the model deliberately: faster for simple edits, more capable for complex reasoning, keeping premium-request costs in mind.
Custom instructions
GitHub documents repository-wide instruction files, for example .github/copilot-instructions.md, that append conventions to every prompt. Useful contents include preferred frameworks, naming rules, testing requirements and things to avoid. Keep them short and specific; long vague files dilute the signal.
Workflows
Debug a failing test
- Paste the failure output and open the relevant files.
- Ask for likely causes ranked by probability, not just a fix.
- Apply the smallest fix, re-run tests, and ask Copilot to explain why it works.
Understand an unfamiliar codebase
- Ask for an overview of the request flow for a specific feature.
- Ask where a given behavior is implemented and what depends on it.
- Verify by reading the files it points to.
Delegate a small issue to the coding agent
- Write the issue with acceptance criteria, relevant files and constraints.
- Assign it to Copilot. Per third-party descriptions, it works in a sandboxed environment with restricted repository access and opens a draft pull request that requires human approval before CI workflows run.
- Review the diff, run tests locally, and request changes through comments.
Reviewing AI-generated code
- Read every line you are about to commit; do not accept large diffs unread.
- Run the tests and add new ones for edge cases.
- Check for hard-coded secrets, injection risks, unsafe dependencies and missing input validation.
- Confirm that APIs and libraries it uses actually exist in your versions.
- Watch for plausible but subtly wrong logic, off-by-one errors and unhandled failures.
- Use your normal code review and CI; do not lower the bar because a tool wrote it.
Common mistakes
- Asking for a huge feature in one prompt instead of iterating.
- Skipping tests because the code "looks right."
- Leaving conventions undocumented and then correcting the same style issues repeatedly.
- Pasting proprietary code or secrets into tools your organization has not approved.
- Ignoring plan limits until premium requests run out mid-task.
Limitations and when to use something else
- Copilot code review is GitHub-focused and can miss issues or vary in depth; use it alongside human review.
- Large or highly unconventional codebases can exceed what the tool understands at once.
- For architecture decisions and security-critical code, rely on experienced engineers.
- Other tools offer different trade-offs, such as editors built around agents; choose based on your workflow.
FAQ
What is the difference between Copilot chat and agent mode?
Chat answers and suggests; agent mode can plan multi-step work, edit several files and run commands, with you reviewing.
What are custom instructions in Copilot?
Repository-level instruction files, such as .github/copilot-instructions.md, that add conventions to your prompts.
What is the Copilot coding agent?
A feature where you assign an issue to Copilot and it opens a pull request for human review.
Do I still need to review Copilot's code?
Yes. Read it, test it and check security.