GitHub Copilot is installed on millions of developer machines, but most people only use it for basic autocomplete. These tips unlock its full potential — from faster coding to better suggestions.
Prompting Tricks
- Write comments first — Copilot generates much better code when it understands intent. Write a comment describing what you want, then let it complete.
- Be specific in comments — "// Sort users by last login date, most recent first, handle null dates" → better code than "// Sort users"
- Use function names as prompts — Name your function descriptively and Copilot will implement it:
function calculateShippingCostWithDiscountForPrimeMembers() - Provide examples — Write one example of the pattern you want, and Copilot will continue the pattern for all similar cases.
- Open relevant files — Copilot uses open tabs as context. Open related files to improve suggestions.
Keyboard Shortcuts
- Tab to accept — Accept the full suggestion
- Ctrl+→ (word accept) — Accept one word at a time when you want partial suggestions
- Alt+] / Alt+[ — Cycle through alternative suggestions
- Ctrl+Enter — Open Copilot panel to see all suggestions at once
- Esc — Dismiss a suggestion you don't want
Workflow Tricks
- Generate tests from code — Open your source file, then open a test file. Write "test" and Copilot will generate tests based on the source.
- Chat for complex tasks — Use Copilot Chat (Ctrl+I) for tasks that need explanation, not just code completion.
- Use /fix for errors — Select code with an error, open chat, type /fix. Copilot analyzes and suggests a fix.
- Use /explain for learning — Select unfamiliar code, type /explain. Great for onboarding onto new codebases.
- Workspace context — Use @workspace in chat to ask questions about your entire codebase, not just the current file.
When Copilot Isn't Enough
Copilot excels at line-by-line coding but has limitations:
- Complex refactors across multiple files → Use Cursor or Claude Code
- Architecture decisions → Use AI chat with full project context
- Debugging complex issues → Use AI with full error context and logs
For AI-assisted development workflows beyond Copilot, browse our Developer Tools prompts.