GitHub Copilot Guide 2025: AI Pair Programming for Every Developer
GitHub Copilot brings AI autocomplete, multi-file edits, and chat directly into VS Code, JetBrains, and Neovim. Here is everything you need to get started and get the most out of it.
What Is GitHub Copilot?
GitHub Copilot is an AI coding assistant developed by GitHub (Microsoft) in partnership with OpenAI. Unlike Cursor — which is a full IDE fork — Copilot is an extension that integrates into your existing editor. Its four main modes are:
- Ghost Text — multi-line inline suggestions as you type; press Tab to accept
- Copilot Chat — context-aware AI chat panel with slash commands (/explain, /fix, /tests, /doc)
- Copilot Edits — propose and apply changes across multiple files simultaneously
- Copilot CLI —
gh copilot suggestandexplainterminal commands
Copilot launched in June 2022 and reached 1.8 million paid users by 2024. GitHub also launched a limited free tier in 2024 — 2,000 completions and 50 chat messages per month — making it accessible to nearly every developer.
Setting Up Copilot in VS Code
- Open VS Code and go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for GitHub Copilot and install it (also install GitHub Copilot Chat)
- Click the Copilot status bar icon and Sign in to GitHub via OAuth
- Open any file — Ghost Text suggestions appear inline as you type
- Press Ctrl+Alt+I (Windows/Linux) or Cmd+I (Mac) to open Copilot Chat
JetBrains users: Install the GitHub Copilot plugin from the JetBrains Marketplace under Settings → Plugins. The experience is nearly identical — Ghost Text appears in the editor, and Chat is available as a tool window.
Ghost Text vs Copilot Chat vs Copilot CLI
Ghost Text — Inline Autocomplete
As you type, Copilot suggests multi-line completions in grey text. The suggestion context includes your current file, open tabs, and language-specific patterns. Best for writing boilerplate, implementing known patterns, and filling in function bodies after a signature.
Tab (accept) | Escape (dismiss) | Alt+] / Alt+[ (cycle suggestions) | Ctrl+Enter (see all suggestions)
Copilot Chat — Slash Commands and Context
The chat panel (Ctrl+Alt+I) supports powerful slash commands: /explain (explain selected code), /fix (fix a bug in selection), /tests (generate unit tests), /doc (write JSDoc/docstrings). Reference specific files with #file: path/to/file.
Ctrl+Alt+I (panel) | Ctrl+I (inline edit within file) | Select code first for context
Copilot Edits — Multi-File Changes
Copilot Edits (available via the Chat panel → "Edit with Copilot") lets you describe a change that spans multiple files. Copilot proposes edits across your codebase and shows a diff you can accept or reject file by file. This is Copilot's answer to Cursor's Composer agent.
Best for: refactors, adding a feature across layers, renaming across files
Copilot CLI — Terminal AI
Install with npm install -g @githubnext/github-copilot-cli then run gh copilot suggest "find all files modified in the last 7 days" or gh copilot explain "git rebase -i HEAD~3".
Requires: GitHub CLI (gh) + Copilot subscription
Using .github/copilot-instructions.md
Create a .github/copilot-instructions.md file in your repository root to set a persistent system prompt for all Copilot Chat sessions in that repo. Copilot injects it automatically — you don't need to paste context every time.
Example: .github/copilot-instructions.md
# .github/copilot-instructions.md example # This file is automatically injected into every Copilot Chat session You are assisting with a TypeScript + React project. - Use functional components with typed props interfaces - Prefer named exports; default export only for pages - Use Tailwind CSS for all styling — no inline styles - Write tests with Vitest + React Testing Library - Never use the `any` type; prefer `unknown` with type guards - Keep functions under 40 lines; extract helpers when needed
Keep the file concise (under 400 words). Include: language/framework, code style rules, testing library, naming conventions, and any anti-patterns. Avoid duplicating what the IDE already knows (e.g., "we use TypeScript" when the file is .ts).
GitHub Copilot Pricing (2025)
| Plan | Price | Included |
|---|---|---|
| Free | $0 | 2,000 completions/mo, 50 chat messages, GPT-4o-mini |
| Individual | $10/mo | Unlimited completions + chat, all models, Copilot Workspace, CLI |
| Business | $19/user/mo | Everything in Individual + org policy, audit logs, no data training |
| Enterprise | $39/user/mo | Business + fine-tuned private model on your codebase, Copilot Autofix |
Students, teachers, and maintainers of popular open-source projects can apply for free Individual access at education.github.com. GitHub verifies eligibility with your .edu email or through the GitHub Student Developer Pack.
GitHub Copilot vs Cursor vs Windsurf
| Feature | Copilot Individual | Cursor Pro | Windsurf Pro |
|---|---|---|---|
| Price | $10/mo | $20/mo | $15/mo |
| IDE type | Extension (VS Code, JetBrains, Neovim) | VS Code fork | VS Code fork |
| Multi-file agent | ⚠ Copilot Edits (limited) | ✅ Composer (full agent) | ✅ Cascade (full agent) |
| Model choice | ❌ GPT-4o only | ✅ Claude/GPT-4o/Gemini | ✅ Claude/GPT-4o (via credits) |
| JetBrains support | ✅ | ❌ | ❌ |
| GitHub integration | ✅ Native (PR summaries, Copilot Workspace) | ❌ | ❌ |
| Context file | .github/copilot-instructions.md | .cursorrules | .windsurfrules |
Choose Copilot if you use JetBrains IDEs, are embedded in the GitHub ecosystem, or need the lower price point with solid single-file completions. Choose Cursor or Windsurf if you want a more powerful agentic experience with multi-file planning and model choice.
Pro Tips for Better Copilot Results
- Write descriptive comments before the function: Copilot uses comments as intent. Write "// Debounce fn calls, returns promise that resolves on final call" before the function signature for dramatically better suggestions.
- Keep related files open in tabs: Ghost Text draws context from all open editor tabs, not just the current file. Open your types file, related tests, and the API module before writing new code.
- Use /tests with a selected function: Highlight your function, open Copilot Chat, type /tests, and it generates unit tests that match your existing testing patterns. Works best when you have test files already open.
- Add #file references in chat: Instead of pasting code, type #file: src/components/Button.tsx to give Copilot Chat the exact context it needs without leaving the chat box.
- Check Copilot status when suggestions stop: If Ghost Text disappears, check GitHub Copilot status at Prismix before debugging your setup — outages do happen.
Monitor GitHub Copilot Availability
GitHub Copilot depends on GitHub's infrastructure and OpenAI's API. When either goes down, suggestions stop appearing. Track both in one place and get instant email alerts.
Monitor Copilot Status Free →Frequently Asked Questions
Does GitHub Copilot work offline?
No. All Copilot features require an active internet connection and a valid GitHub subscription. Code is sent to GitHub's servers for processing — this is why the Business and Enterprise plans include data privacy controls (no training on your code).
Does Copilot train on my private code?
On the free and Individual plans, GitHub may use your code snippets to improve Copilot models. Business and Enterprise plans include a "no training" option that prevents your code from being used to train future models. You can also opt out individually under GitHub account settings → Copilot.
What languages does Copilot support?
Copilot works in every language but performs best in Python, JavaScript, TypeScript, Ruby, Go, and C#. These languages dominate its training data. It also handles SQL, Bash, JSON, YAML, and Markdown well. For niche languages, suggestion quality drops but it still helps with structure and boilerplate.
Can I use Copilot with Neovim?
Yes. Install the official Neovim plugin at github.com/github/copilot.vim. Ghost Text completions work via the plugin's vim-based integration. Copilot Chat is not available in Neovim — you'll need VS Code or JetBrains for the full chat experience.
What is Copilot Autofix?
Copilot Autofix (Enterprise plan) automatically generates code fixes for security vulnerabilities found by GitHub Advanced Security's code scanning. It proposes a pull request with the fix, explaining what changed and why — going beyond just flagging issues to actually resolving them.