7 Agent Mode
Agent mode is one of the most powerful developments in AI coding tools. It goes beyond conversation and starts actually doing things.
In its simplest form, agent mode allows the AI to write code and test it. Instead of merely producing code that it “thinks” works, the agent can execute it, detect bugs, and iterate before returning a result.
Modern agents typically:
- Start with a plan
- Break the task into subtasks (sometimes using subagents)
- Implement the code
- Create synthetic data or test files
- Execute the code
- Revise if errors are detected
This dramatically improves reliability.
In GitHub Copilot (from within VS Code), you can ask the AI a question, provide additional context (such as specific files), and choose whether to run the agent in the foreground or background. The agent may modify code, generate tests, and attempt to validate its own output.
This is a major step forward compared to simple prompt-and-response coding.
7.1 Agent Mode (Cloud)
The cloud version of agent mode is even more powerful.
Instead of using your local computational resources, the AI submits the task to a cloud environment and creates a Pull Request (PR) for you. Watching the agent run code online is impressive. It saves local resources and encourages clearer problem formulation.
In GitHub’s cloud agent mode:
- A new compute session is created
- The environment can be preconfigured with required dependencies
- The entire process is visible to the user
- The final output is submitted as a Pull Request
Depending on complexity, agents typically take about ten minutes or less to complete a task and submit a PR.
There is, however, an important note of caution: it is tempting to run many agents simultaneously. But the human remains in the loop. Someone still needs to review the code carefully before merging it.
The review process is one of the strongest advantages of cloud agents. GitHub’s interface allows you to:
- Add line-by-line comments
- Provide an overall summary comment
- Tag the agent (e.g.,
\@copilot) with additional instructions
This structured review happens before the code is merged into the main branch, which is not always the case with local agents that directly modify files.
My usual workflow is:
- Add specific comments throughout the PR
- Provide a clear overall comment with guidelines
- Mention
\@copilotin the summary comment
- Optionally ask the AI to improve the
AGENTS.mdfile if recurring issues appear
This final step is important. Over time, improving AGENTS.md makes your agents better aligned with your expectations and reduces repeated mistakes.
AI for programming is not about replacing the developer. It is about redefining the workflow. The tools are powerful—but only when context is strong, instructions are clear, and the human remains actively engaged in the process.