Getting the Best Out of GitHub Copilot
Discover how GitHub Copilot can transform your coding workflow. From personalizing responses to leveraging extensions and best practices, this guide explores need to make the most of this powerful AI assistant

As my first in-editor AI coding partner, I started with Cursor. However, four months ago, I decided to switch to GitHub Copilot. While using Cursor, I was aware of Copilot and its features, but at the time, it felt unstable and not as polished as Cursor. Recently, I noticed that GitHub Copilot has been improving significantly, becoming a strong competitor to Cursor. This encouraged me to give Copilot a try, especially since it offers a larger quota for expensive LLM calls and has proven to be stable even in its preview version.
Another reason for the switch was my existing GitHub Pro subscription, which meant I could save $22 per month by not needing Cursor’s subscription if Copilot proved to be a good alternative.
In this article, we’ll explore some of unique Copilot’s features i found and best practices we can use to make the best out of copilot.
FYI:My primary focus is on Github copilot extension on VScode insider, even you can access copilot from web version.
Personalizing GitHub Copilot Responses
GitHub Copilot allows you to customize its responses to better suit your needs.Its difficult and irritating to mention stick to functional programming, use early return etc in every chat completion. These custom instructions help Copilot understand your preferences, project requirements, or even organization-wide standards. There are three types of custom instructions you can use:
- Personal Custom Instructions: Copilot’s responses to your individual preferences across all conversations.
- Repository Custom Instructions: Define project-specific guidelines, frameworks, or coding standards for a particular repository.
- Organization Custom Instructions: Apply organization-wide preferences, managed by organization owners, to ensure consistency across all repositories.
Let’s start with personal custom instructions.
Adding Personal Custom Instructions
Personal custom instructions let you customize how GitHub Copilot responds to you, making it more aligned with your preferences. Setting them up is straightforward and can be done either in the Copilot Chat panel or immersive mode.
How to Add Personal Instructions
-
Open the Copilot Chat panel or immersive mode:
- Click the Copilot Chat icon in the top-right corner of any GitHub page to open the panel.
- If you prefer a full-page view, click the dropdown next to the Copilot Chat icon and select "Immersive." You can also go directly to https://github.com/copilot.
-
Access Personal Instructions:
- In the Chat panel or immersive page, click the dropdown menu at the top-right corner and select "Personal instructions."
-
Add Your Preferences:
- Write your preferences in the text box using natural language. You can format them however you like—either as a single block of text, line by line, or separated by blank lines.
- If you’re unsure where to start, click the templates button to see examples of common instructions. For instance, selecting "Communication" will add placeholders like
{format}
that you can customize.
-
Save Your Instructions:
- Click "Save" to activate your instructions. They’ll stay active until you decide to change or remove them.
Example
Let’s say you want Copilot to respond in Portuguese and keep explanations short and simple. Here’s how you can set it up:
- Open the Copilot Chat panel.
- In the "Personal instructions" section, add the following:
Always respond in Portuguese. Keep explanations concise and break them down step by step. - Save your instructions.
Now, whenever you interact with Copilot, it will respond in Portuguese and provide clear, concise explanations tailored to your preferences.
Repository-Level Custom Instructions
Maintaining good coding standards in a team can be a challenging task, especially when working collaboratively on a large project. Code reviews help identify issues, but as the repository grows, it becomes harder to ensure consistency across the codebase. This is where repository-level custom instructions in GitHub Copilot can make a big difference.
Repository custom instructions allow you to define project-specific guidelines and standards in a single place. These instructions ensure that Copilot generates code that adheres to your team’s coding practices, making it easier to maintain consistency and quality.
How Repository Custom Instructions Help
For example, you can set instructions like:
- Use
camelCase
for variable names. - Prefer early returns in functions.
- Stick to functional programming principles.
- Add only one-line comments for clarity.
By defining these standards, Copilot will follow them whenever it generates code for your repository. This ensures that all contributors are aligned with the project’s coding practices, reducing the need for repetitive corrections during code reviews.
Example
Imagine you’re working on a TypeScript project with a team, and you want to enforce the following guidelines:
- Use
camelCase
for all variable names. - Avoid nested conditionals; use early returns instead.
- Stick to functional programming principles—no classes or object-oriented patterns.
Here’s how you can set it up:
- Open the repository on GitHub.
- Go to the repository settings and navigate to the "Copilot" section.
- Add instructions.
Instead of adding instructions through the GitHub settings, you can create a dedicated file in your repository to store these guidelines. In the root of your repository, create a file named .github/copilot-instructions.md
.and add your instructions.
// Quick sort algorithm in TypeScript
export function quickSort<T>(arr: T[]): T[] {
if (arr.length < 2) return arr;
const [pivot, ...rest] = arr;
const left = rest.filter((x) => x < pivot);
const right = rest.filter((x) => x >= pivot);
return [...quickSort(left), pivot, ...quickSort(right)];
}
Organizing Context with Copilot Spaces
Another feature I came across is Copilot Spaces. Copilot Spaces lets you organize and share context, making Copilot’s responses more accurate and grounded in the information you provide.
Why Copilot Spaces Stood Out to Me
One of the challenges I often face is keeping track of all the relevant code, notes, and documentation for a task. Switching between tools or asking teammates for background information can disrupt my workflow. Copilot Spaces solves this problem by letting you group everything you need—code, specs, notes, or even Slack threads—in one place. This way, Copilot can give more specific and relevant answers based on the context you’ve added.
How To Use Copilot Spaces
Here’s an example of how to use Copilot Spaces while developing a new feature. Consider you are workig on a user registration form for a healthcare nonprofit, and you needed to add support for two-factor authentication (2FA). Instead of juggling multiple tools, create a Space and added:
- The relevant React and Tailwind code.
- Notes from a design review.
- A product spec outlining the requirements.
With this setup, if you ask Copilot, “How should I add support for 2FA?” Copilot summarized the current implementation, suggested changes, and even flagged missing elements in the design. It felt like having a coding assistant who truly understood the task.
How to Set Up Copilot Spaces
Setting up a Space is simple:
- Go to https://github.com/copilot/spaces and click Create space.
- Name your Space and choose whether it’s owned by you or your organization.
- Optionally, add a description to explain the purpose of the Space.
- Add context to the Space:
- Instructions: Write free-text instructions to guide Copilot’s responses. For example: "You are a SQL generator. Use the attached schemas to create queries."
- References: Add code from repositories or free-text content like notes or transcripts.
Once your Space is ready, you can ask Copilot questions directly within the Space, and its responses will be grounded in the context you’ve provided.
Enhancing Copilot with External Extensions
External extensions can significantly improve its functionality and make it even more powerful. These extensions integrate external tools directly into Copilot Chat, allowing you to access specialized knowledge and resources without leaving your coding environment. Let’s explore a few extensions that stood out to me.
Stack Overflow Extension
As developers, we often turn to Stack Overflow for answers to complex coding questions. With this extension, you can access 16 years of community-validated technical knowledge directly within Copilot Chat.
How It Works:
- Use
@askstackoverflow
in Copilot Chat to ask your coding question. - Copilot provides a summarized response based on over 58 million technical questions and answers from Stack Overflow.
- You can also access links to the original Stack Overflow content for additional context.
Prisma Extension
It integrates Prisma’s official documentation into Copilot Chat, giving you instant access to resources on schema modeling, queries, migrations, and Prisma Postgres databases.
How It Works:
- Use
@prisma-for-github-copilot
to ask questions about Prisma products. - Get fast, accurate answers from the Prisma docs directly in your IDE.
PerplexityAI Extension
PerplexityAI brings real-time web search functionality into Copilot Chat, providing up-to-date answers backed by reliable sources. Whether you need the latest documentation or insights into emerging technologies, this extension has you covered.
How It Works:
- Use PerplexityAI to search the web directly within your IDE.
- Verify answers in real time by checking live references.
Why External Extensions Matter
These extensions enhance Copilot’s capabilities by integrating specialized tools and knowledge sources. Whether you’re solving coding challenges, working with databases, or staying updated
Best Practices for Using GitHub Copilot
Over time, I’ve learned a few techniques to get the most out of Copilot, and I’m sharing them here to help you improve your experience.
Start with a Broad Description, Then Add Details
When asking Copilot to perform a task, begin by describing the overall goal. Once the general objective is clear, follow up with specific requirements or conditions. This two-step approach helps Copilot understand the context before narrowing down to the specifics.
Example:
If you need a function to calculate the area of a rectangle, start with:
“Write a function to calculate the area of a rectangle.”
Then add:
“The function should take width and height as inputs and return the result in square meters.”
Support Your Prompt with Examples
Including sample inputs and outputs or partial code snippets can make your request clearer. Examples show Copilot what kind of result you’re expecting. Unit tests are also helpful — providing tests first allows Copilot to write functions that satisfy those conditions.
Example:
Provide this prompt:
“Write a function that converts Celsius to Fahrenheit. For example:
Input: 0
Output: 32.”
This reduces misinterpretation and increases the likelihood of Copilot producing accurate results.
Break Large Tasks into Smaller Steps
Complex tasks are easier to handle when broken down into smaller, manageable parts. Instead of asking Copilot to do everything at once, guide it step by step. Start with one part of the task, then build on the previous results.
Example:
If you’re building a login system, start with:
“Write a function to validate email addresses.”
Then move to:
“Write a function to hash passwords.”
This approach keeps Copilot focused and avoids overwhelming it with too many instructions.
Be Specific to Avoid Misunderstanding
Ambiguous phrasing can lead to confusion. Instead of using vague references like “this,” directly name the function, code block, or concept you’re referring to. If you’re working with custom libraries or code, provide background information or mention relevant imports.
Example:
Instead of saying:
“Write a function for this,”
Say:
“Write a function to sort an array of integers in ascending order.”
Share Relevant Code and Keep the Context Clear
Copilot generates output based on your prompt and the surrounding code. To ensure it has the right information, close unrelated files and keep open the ones you’re actively working on. Highlight or select the code you want Copilot to consider in chat-based interactions.
Example:
If you’re asking Copilot to refactor a function, make sure the function is visible and selected in your editor.
Don’t Be Afraid to Retry and Refine
If Copilot’s response doesn’t meet your expectations, adjust your prompt and try again. You can revise the original request, build upon the previous reply, or start fresh. Prompting is an iterative process — small changes often lead to better results.
Example:
If Copilot generates a function that’s too complex, simplify your prompt:
“Write a basic function to calculate the sum of an array.”
Keep the Conversation Clean and Focused
Copilot Chat uses the ongoing chat history to guide its answers. Start new threads for different tasks and remove older or irrelevant messages. This keeps Copilot focused on the current topic without being distracted by outdated information.
Maintain Good Coding Habits
The quality of Copilot’s output is influenced by the quality of your existing code. Clear, well-structured, and readable code provides better context for Copilot to understand and respond effectively.
Example:
Use consistent naming conventions, avoid deeply nested logic, and write comments where necessary. This helps Copilot generate code that aligns with your style and standards.
We’ve explored just a few of the features GitHub Copilot offers, but it’s constantly evolving with new collaborative tools to reduce repetitive tasks and improve team workflows. Whether you’re coding solo or with a team, Copilot can help make your development faster and more efficient.
LiveAPI helps you get all your backend APIs documented in a few minutes
With LiveAPI, you can quickly generate interactive API documentation that allows users to search and execute APIs directly from the browser.
If you’re tired of manually creating docs for your APIs, this tool might just make your life easier.