GitHub Copilot
GitHub Copilot is the most widely deployed AI coding assistant: inline tab completions plus chat in editors you already use.
Last reviewed: June 2026
Pricing and feature names change. Check GitHub Copilot plans for current tiers.
Copilot Modes
| Feature | What it does | Best for |
|---|---|---|
| Inline completions | Tab to accept next lines as you type | Boilerplate, repetitive patterns |
| Copilot Chat | Q&A and edits in sidebar | Explaining code, small refactors |
| Copilot Edits / Agent | Multi-file changes from chat | Scoped features (verify diffs carefully) |
CLI (gh copilot) | Terminal suggestions | Shell commands, git operations |
Inline completions are low-risk because you accept line by line. Agent-style edits need the same verification checklist as any AI tool.
Effective Inline Use
Copilot learns from open files and nearby code. Help it help you:
- Write a comment or function signature first to describe intent before implementation
- Keep related files open so context improves suggestions
- Use descriptive names:
fetchUserOrdersWithRetrybeatsgetData - Tab only what you understand and reject suggestions that import unknown packages
// Fetch paginated orders for a user; handle 404 as empty array
async function fetchUserOrders(userId, page = 1) {
// Copilot completes from here. Review error handling.
}
Custom Instructions (.github/copilot-instructions.md)
Teach Copilot your stack and conventions with a repo-level instructions file. This is equivalent to Cursor's .cursor/rules/ — Copilot reads it automatically:
<!-- .github/copilot-instructions.md -->
# Project Conventions
## Stack
- Next.js 15 App Router, React 19, TypeScript strict
- Drizzle ORM with Postgres
- Tailwind CSS v4
- Zod for all input validation
## Code Style
- Named exports only (no default exports except page.tsx / layout.tsx)
- Server components by default; add "use client" only when state or browser APIs are needed
- Colocate tests: src/lib/foo.test.ts alongside src/lib/foo.ts
## Patterns to Follow
- Auth check on every API route: `const session = await auth()`
- Validate all external input with Zod before using it
- Use `Response.json()` for API route responses, not `NextResponse`
## Things to Avoid
- Do not add new npm packages without asking
- Do not modify drizzle/migrations/** or package-lock.json
- Do not use `any` in TypeScript
Copilot uses this file for both inline completions and chat suggestions. Keep it under ~500 tokens — long files get truncated. Docs: GitHub custom instructions.
Copilot Chat Prompts
Structure chat like a code review request:
In src/utils/date.ts, add a function formatRelativeTime(iso: string): string
using Intl.RelativeTimeFormat. Match existing error handling. Do not add dependencies.
Avoid: "make this better" or "fix everything."
For debugging, paste the full error:
This function throws "Cannot read properties of undefined (reading 'map')"
when orders is null. Fix with a null guard. Do not change the return type.
@src/components/OrderList.tsx
Learning New APIs
Copilot is useful for unfamiliar syntax, but it hallucinates APIs as often as other models. Always verify against official docs. The combination of Copilot suggestion + official docs check is faster than either alone.
Pricing Overview (2026)
Typical tiers (confirm on GitHub):
- Free: limited completions and chat
- Pro: unlimited completions, more premium requests
- Business / Enterprise: policy controls, IP indemnity options
Students, teachers, and maintainers of popular open-source projects often qualify for free access.
Copilot vs IDE Agents
Copilot optimizes for speed inside your editor. Cursor and Claude Code optimize for autonomous multi-step tasks. Many developers use Copilot for completions plus a separate agent for larger features.
See Choosing a Tool.