Beyond autocomplete: what Copilot actually does
GitHub Copilot is a generative AI coding assistant that draws context from your IDE, open tabs, and GitHub projects — including pull requests, issues, discussions, and your codebase. That context is what lets it do more than suggest the next line.
For example, you can ask Copilot Chat to summarize what a repository does or explain how specific pieces of your app work, and it will answer with knowledge of your actual project. You can use it to document, debug, and refactor code without switching apps or copying large sections of code somewhere else.
Copilot is free for anyone through GitHub Copilot Free, with Pro, Business, and Enterprise tiers available if you need more advanced capabilities. Developers commonly use it for:
- Code completion suggestions while typing in the IDE
- Explaining how a section of code works
- Generating tests and fixing code that fails a test
- Migrating code to a different language
- Refactoring existing code
- Explaining unfamiliar code you’re working with
- Working with other tools via Copilot Extensions
- Generating documentation for pull request changes
Choosing your model
With Copilot you pick the AI model that powers your session. Copilot Free gives you access to Anthropic’s Claude 3.5 Sonnet and OpenAI’s GPT-4o. Paid tiers add more model options so you can tailor the experience.
Code completion and generating new code
Copilot offers in-line suggestions that either complete what you’re typing or generate code from natural language prompts. Developers often use this for boilerplate and common snippets like getter and setter functions. But it’s not limited to repetitive code: in Copilot Chat you can describe what you want in plain language or use the /new slash command, and Copilot will suggest code to get you started.
Good prompts make a real difference here. GitHub’s documentation on prompt engineering covers how to get the most out of the tool.
Generating unit tests
Writing unit tests requires knowing your edge cases and what might break. Because Copilot knows about your project on GitHub and what’s open in your IDE, it can create tests for a selected block of code.
Select the code, then either right-click to use the context menu or enter the /tests slash command. Copilot analyzes the code and suggests tests covering valid inputs, edge cases, and invalid inputs. GitHub has sample prompts in its docs if you want examples to start from.
Explaining and documenting existing code
if you’re onboarding to a new project — especially one in a language you don’t know well — select some code and use the context menu or the /explain slash command. Copilot will walk you through what the code does, and you can follow up with a prompt to generate documentation for it.
The same capability also works for legacy codebases. You can use the understanding you gain as a starting point for other tasks, like translating code to a different language. GitHub’s docs include sample prompts for explaining legacy code and complex algorithms or logic.
Framework upgrades and error fixes
Upgrading to a new framework version is rarely a clean recompile — you usually end up chasing new errors. Copilot can help you understand why your code is failing under the new version and suggest fixes to make it compliant. You can also ask it how to update code to fit the new framework’s approach.
Repository-level questions and workflow debugging
To understand an unfamiliar codebase, click the Copilot icon in the top-right corner of your screen and ask what the repository does or to summarize key components. You can also prompt Copilot to debug GitHub Actions workflows. If you want to narrow the focus, highlight individual files or folders in the repository. Copilot also works as a chat assistant directly on github.com with a full natural-language interface.
Translating code between languages
For legacy migrations — say, moving COBOL to a modern language — Copilot can help even if you don’t know the source language well. Ask it to explain what a section does, then use that explanation to generate equivalent code in the destination language. It will also suggest how to approach the translation. The docs on explaining legacy code walk through the beginning of this exact scenario.
Documentation generation
Much like explaining code, you can ask Copilot to generate docs for sections of code or entire projects. In Copilot Free, the /docs slash command summarizes code blocks within your IDE. Paid versions can also generate documentation from issues and pull requests.
This is especially useful for legacy applications that have missing docs, like older COBOL systems — GitHub’s page on documenting legacy code shows how to start.
Debugging with /fix
When a section of code throws errors you can’t resolve, highlight it and either right-click and select “Copilot” or use the /fix slash command in Copilot Chat. You can also just ask why something isn’t working to start a conversation about the problem. The
Refactoring in place
To clean up code, highlight a specific block — or point Copilot at a file with the #file chat variable — and ask for improvement suggestions. Copilot will look for patterns and propose refactors, like breaking up a long method or simplifying nested logic for readability or performance. You review and accept the changes right in your IDE. GitHub’s docs cover refactoring, with separate examples for improving readability and optimizing performance.
Multi-file edits with Copilot Edits
Copilot Edits lets you modify multiple files at once from Copilot Chat. Instead of opening each file and making manual changes, you select Open Copilot Edits, describe what you want changed, and Copilot determines which files in your working set need updates. It provides a description of the recommended changes for each file, and you accept or reject them individually. This reduces manual errors and speeds up a common workflow — though right now it’s only available in VS Code.
Custom instructions for consistent behavior
When you know the details that make Copilot responses more relevant — like your team’s tools or workflow — you can put them in a file of custom instructions. Copilot includes those instructions in all queries, so you don’t retype the same context every time. This tailors responses for higher quality without extra prompt work. Currently this works with Copilot Chat through VS Code and Visual Studio only.
Copilot for everyone: Free tier and beyond
GitHub Copilot Free is now available to all users. To get started, authorize the Copilot extension in VS Code, or navigate to github.com and click the Copilot icon in the top right corner of the interface. For a detailed walkthrough of the setup process, refer to the official video guide on configuring GitHub Copilot Free.
For teams and individuals that need more than the free offering, GitHub provides three paid tiers: Pro, Business, and Enterprise. Each tier adds progressively advanced capabilities tailored to different workflows and organizational requirements. The Pro tier suits individual developers seeking enhanced assistance, while Business and Enterprise plans introduce administrative controls and policy management features for larger teams. To compare the specific features available at each level, consult the official GitHub Copilot plans page.
Where to go from here: Official documentation and prompt collections
For further guidance on maximizing Copilot's potential, the following official resources are worth bookmarking:
- GitHub Copilot plans: An overview of what each Copilot subscription includes, helping you decide which tier aligns with your development needs.
- GitHub Copilot docs: The central documentation hub for all Copilot features, covering everything from basic setup to advanced usage scenarios.
- Setting up GitHub Copilot: Step-by-step instructions for completing the necessary configuration to begin using Copilot in your environment.
- GitHub Copilot Chat Cookbook prompts: A curated collection of example prompts that demonstrate how to address specific coding challenges and workflows with Copilot Chat.



