The Green on the endless

The Green on the endless, courtesy of Ruben Alves - Check more here

How does GitHub Copilot function

GitHub developed GitHub Copilot as a coding assistant. It integrates directly into popular code editors such as Visual Studio Code and IntelliJ IDEA providing real-time code suggestions, auto-completions, and even entire function or class implementations as you type. Copilot leverages a large language model trained on codebases of public code, enabling it to understand context, infer intent, and generate code snippets in dozens of programming languages.

What purpose does GitHub copilot agent mode serve

GitHub Copilot Agent Mode serves as an advanced feature that transforms Copilot from a passive code completion tool into an interactive, task-oriented coding assistant. In Agent Mode, Copilot can run multi-step instructions, manage files, generate and refactor code, write documentation, and even run tests. All within the context of your project. Instead of just suggesting code line-by-line, the agent can take on broader tasks, updating documentation, or implementing a set of unit tests based on your requirements.

Agent Mode works conversationally: you describe what you want to achieve in natural language, and the agent interprets your intent, plans the necessary steps, and executes them. It can reference your project files, follow architectural guidelines, and keep context across different actions. This makes it especially powerful for rapid prototyping, automating repetitive workflows, and managing project-wide changes.

How to get Agent mode working

Getting started with GitHub Copilot Agent Mode proves straightforward, but you have a few prerequisites and steps to ensure a smooth setup. Here, you can learn how to enable and start using Agent Mode in Visual Studio Code:

1. Prerequisites

Before you begin, make sure you have the following:

  • A GitHub Copilot Subscription: Available to users with an active Copilot subscription (individual or business).
  • Visual Studio Code Installed: Download and install Visual Studio Code if you have not already.
  • Latest GitHub Copilot Extension: Ensure you have the latest version of the GitHub Copilot extension installed in Visual Studio Code.

2. Enabling Agent Mode

After the earlier steps, follow these:

  1. Open Visual Studio Code and navigate to the Extensions sidebar.
  2. Search for “GitHub Copilot” and install or update the extension if needed.
  3. Sign in to GitHub within Visual Studio Code. You will need to authenticate using your GitHub account and verify your Copilot subscription.
  4. Access Copilot Chat:
    • Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac).
    • Type “Copilot: Chat” and select it. This opens the Copilot Chat panel.
  5. Activate Agent Mode:
    • You will see something such as this: Activate Agent Mode
    • Where you see “Ask” change to “Agent”

Use-case - basic toolset becomes easier

When it comes to building or extending a basic toolset, let’s say:

  • utility scripts
  • helper classes
  • basic automation

GitHub Copilot Agent Mode shines. For these straightforward tasks, the agent can often deliver results in minutes that might otherwise take you half a day or more. Especially for tasks such as boilerplate, repetitive code, or tedious setup.

Where Agent Mode excels:

If your requirements seem clear and the scope limited, example of this:

  • generating a file parser
  • scaffolding a CLI tool
  • creating a set of data transformation functions
  • and so on.

You can describe your intent in natural language and let the agent handle the heavy lifting. In my experience, for these “basic toolset” scenarios, Copilot Agent Mode not only excels in speed but also can answer exactly what you need. You can often skip the usual cycle of manual setup, copy-pasting from Stack Overflow, or reading the documentation of libraries to find the most appropriate solution for a particular case.

Tips for best results:

  • Explicit: Even for basic tools, give a clear description of what you want. For example, “Create a Python script that reads a CSV and outputs a JSON file” works better than “Make a CSV tool.”
  • Iterate conversationally: If the first result falls short, refine your prompt or ask the agent to tweak specific parts. The conversational flow makes it intuitive to adjust requirements immediately.
  • Review the output: While Agent Mode performs well in basic tasks, always review the generated code for correctness, security, and style. For anything that touches production or sensitive data, at least perform a quick manual check.

When to add more rigor
If your project starts to grow in complexity, maybe you need to handle edge cases, integrate with external APIs or enforce strict architectural patterns. Consider supplementing Agent Mode with automated tests and more detailed requirements. The more context you give (sample inputs or-and outputs, constraints, edge cases), the better the agent performs. For anything beyond “basic” you likely want to set up tests early to catch regressions as the agent makes changes.

Bottom line:
For basic, well-defined tools, Copilot Agent Mode delivers a genuine productivity boost. You can think of having a colleague developer who never gets tired of writing code or wiring up basic logic. Just remember: the simpler the task, the more likely you will get a near-perfect result on the first try.

Do not forget documentation

Let the agent draft docs, and review them thoroughly to avoid confusion. Missing docs cause problems; misleading, unclear, or overly complex docs might cause more problems.

Tests, tests, tests

Even without upfront tests, cover a few scenarios. You will not reach 100%, but you will establish a base, and writing tests now feels easier than ever.

What about instructions.md

GitHub Copilot .instructions.md feature, in essence, corresponds to a repository-level system prompt. By placing this file in your repo, you give Copilot a persistent, always-on set of instructions - such as Beck system prompt( check the references for more). This file can encode your team coding standards, preferred libraries, architectural patterns, and even project-specific quirks. The result: Copilot suggestions become more consistent, relevant, and tailored to your actual workflow.

Conclusion

GitHub Copilot Agent Mode presents a powerful leap forward for developer productivity, especially when paired with thoughtful workflows and a bit of discipline. The real magic happens when you treat the agent as a junior collaborator: give it clear instructions, set boundaries, and always review its work.

Following Kent Beck approach, creating a “system prompt” - a guiding document or set of instructions to include in the context throughout the session yields the most consistent results. Or if specifically using GitHub Copilot you might also find instructions.md interesting. For example, keeping a plan.md in the project that outlines requirements, edge cases, and test scenarios serves as a living reference for both your own thinking and for guiding Copilot actions. This method helps keeping clarity and context as the project evolves.

Embrace a test-driven approach whenever possible. Let the agent help you scaffold tests, then iterate on the implementation. While Copilot can generate both code and tests, always review and refine what it produces - especially for anything critical. Do not hesitate to restart the session or clarify your instructions if the agent starts to drift or lose context; a fresh start can often get things back on track.

In summary:

  • Always have tests whether you autogenerate or hand-write. Use tests to verify your use cases and catch regressions.
  • Agent Mode shines for small projects, prototypes, and utility scripts where speed and iteration matter more than perfect architecture.
  • A great way to explore new languages or frameworks, letting you see how different technologies fit together with minimal friction.

Used thoughtfully, Copilot Agent Mode improves the output and quality of your product. It will not replace your expertise or judgment, but it will free you from boilerplate and accelerates prototyping. This helps you focus on the creative, high-value parts of software development. Treat it as a partner, not a replacement, and you will benefit the improvements it gives.

References

Augmented Coding: Beyond the Vibes - by Kent Beck Adding repository custom instructions for GitHub Copilot - GitHub Docs