5 Keys to Agent-First Dev in VS Code
Master harness, model, prompts, tools, and context to run precise AI agent sessions in VS Code with GitHub Copilot, turning general models into codebase-specific developers.
The 5-Part Formula for Reliable Agent Results
Agents aren't magic—they follow a formula: harness + model + prompts + tools + context. Tune these to avoid vague outputs and achieve tasks matching your codebase standards. The harness (VS Code's GitHub Copilot Chat) wires the model to tools, files, and actions, like a car's wiring distributing engine power. Without specifics, agents fail; with this setup, they handle full software development lifecycles.
Start sessions in Copilot Chat: select a model (e.g., Sonnet, Codex), set thinking effort (low for boilerplate, medium for refactoring, high for architecture/debugging—high balances speed and reasoning), craft detailed-but-not-overwhelming prompts, enable relevant tools, and add context.
Model and Effort Selection Drives Reasoning Quality
Choose from developer-preferred models in Copilot Chat (e.g., Sonnet at high effort as default). Low effort suits quick tasks like formatting; medium handles straightforward refactors; high tackles complex architecture or debugging. This trades speed for depth—use high for non-trivial work to get accurate code generation and reasoning.
Prompts must specify tasks clearly: include details without minutiae, e.g., "create to-dos and run Z shell command" triggers tools automatically if enabled.
Curate Tools to Match Your Task, Avoid Overload
Agents execute via 100+ built-in and extension tools (e.g., from 152 to 55 by disabling irrelevant ones like Azure, Bicep, Mermaid). Key categories: delegate to sub-agents, browser interaction, file edits/reads/searches, terminal commands, to-do management, VS Code features, web search.
Granular control: enable only essentials (e.g., to-dos icon for task lists, terminal icon for shell runs). Over-enabling bloats sessions; under-enabling blocks actions—review tool picker per task. Demo: agent created to-dos and ran terminal commands because both were active.
Ground Agents with Codebase Context
Models lack niche expertise—provide files/folders via + icon (GitHub repos, MCP resources) or #filename in prompts. Agents auto-read directories (e.g., scanned project dir), incorporating specifics over general training data. This yields codebase-tailored results, e.g., reading dirs before commands.
VS Code Layout Tweaks for Agent Efficiency
Customize for visibility: right-click Explorer to swap primary sidebar (left/right), set activity bar to top (right-click > Activity Bar Position > Top). These position Copilot Chat, tools, and outputs optimally—default is left activity bar, but top aids multi-panel agent monitoring.
Next: approval levels (allow/skip commands) prevent unchecked runs.