Set up Copilot
GitHub Copilot requires a GitHub account and a Copilot subscription ($10/month for individuals). Install the GitHub Copilot and GitHub Copilot Chat extensions in VS Code, JetBrains IDEs, or Neovim. Sign in with your GitHub account when prompted.
Copilot Individual uses GPTGPTGenerative Pre-trained Transformer — the model architecture and family name behind OpenAI's most famous models, from GPT-2 to GPT-5.Learn more →-4o and Claude Sonnet as its underlying models (GitHub chooses which based on the task). Copilot Business and Enterprise add admin controls, audit logs, and the option to exclude specific files from being sent to GitHub.
Write better completions
Copilot generates suggestions based on your open files and recent edits. The quality of suggestions depends heavily on context. Write a descriptive comment immediately before the function you want to generate: `// Parse a CSV file and return an array of User objects, handling malformed rows gracefully`. Copilot will use this as a specification.
Keep related files open in your editor — Copilot indexes recently opened tabs as context. If you are writing a test, open both the source file and a similar test file. Copilot will follow the patterns it sees.
Copilot Chat for complex tasks
Open Copilot Chat with Ctrl+Shift+I. Use slash commands for common tasks: `/explain` to explain selected code, `/fix` to fix a bug or test failure, `/tests` to generate unit tests for a function, `/doc` to generate documentation.
Highlight a function and ask `/tests` to generate tests in the same style as your existing test files. Copilot looks at your testing framework (Jest, Pytest, etc.) and style and matches it. For best results, have a test file open as context.
Copilot in the terminal
Install the GitHub CLI: `gh copilot suggest` lets you describe what you want to do in plain English and Copilot will suggest the shell command. Example: `gh copilot suggest 'find all files larger than 100MB and delete them'`.
`gh copilot explain <command>` explains what a complex command does. This is invaluable for understanding legacy scripts or unfamiliar CLI tools. `gh copilot explain 'awk \'{sum+=$2} END {print sum}\' file.txt'` will explain the awk script in plain English.
Tips that actually improve output
Use explicit types and interfaces. Copilot produces much better completions when it can see the shape of your data. Define TypeScript interfaces or Python type hints before writing the functions that use them.
Accept and immediately edit rather than waiting for the perfect suggestion. Tab to accept a suggestion, then immediately modify it. This is usually faster than dismissing and waiting for a better one.
Create a `.github/copilot-instructions.md` file in your repository. GitHub Copilot reads this file and uses it as persistent instructions for all Copilot interactions in the repo — describe your conventions, preferred patterns, and things to avoid.