Agent tutorials and guides
Find a tutorial or guide for the task you want to complete with agents in VS Code. Learn with a sample project or apply a workflow to your own codebase.
For help choosing an AI workflow, compare suggestions, collaboration alongside code, and agent orchestration.
Choose where to start
Choose a starting path. If you're new to VS Code, install the editor and open a workspace first.
Complete your first agent task
Quickstart. Build and validate a small web app, then review the changes.
Sample project. No runtime or build tools required.
Build an app step by step
Extended tutorial. Build a portfolio page in the Agents window, then continue the session in the Chat view to refine it.
Sample project. Requires Git.
Work in your own repository
Explore your codebase, add a feature, or refactor existing code with an agent.
Your repository. Check the guide's prerequisites.
Or jump to a task:
Work on a project
-
Explore a codebase: trace a behavior without editing files and verify explanations against source references. Setup: your repository, Copilot in the Chat view.
-
Add a feature: plan, implement, and test a change. Setup: your repository with a working development environment and tests, Copilot in the Chat view.
-
Fix an API bug: reproduce a pagination bug, add a regression test, and review the fix. Setup: sample project, Node.js 22 or later, and Git.
-
Refactor safely: change code structure in reviewable steps while preserving existing behavior. Setup: your repository, Copilot in the Chat view.
-
Work with Jupyter notebooks: create or edit a notebook, run cells, and review results. Setup: your data, the Jupyter extension, and a notebook kernel.
Test and validate
-
Add tests to existing code: generate and run tests, then review assertions, failures, and coverage. Setup: your project, Copilot in the Chat view.
-
Validate a web app with browser tools: build a calculator app and test it against acceptance criteria. Setup: sample web app.
-
Set up test-driven development: create custom agents and instructions for a repeatable test-first workflow. Setup: your repository with working tests, Local harness The Local harness is deprecated and will be removed in February 2027. Move your workflows to the Copilot harness before then. Learn more about Local harness deprecation. in the Chat view.
Customize and coordinate agents
-
Adapt agents to your project: share project instructions, then add skills or custom agents where needed. Setup: your repository.
-
Set up a context engineering workflow: connect project context, planning, and implementation with instructions, custom agents, and prompt files. Setup: your repository, Local harness The Local harness is deprecated and will be removed in February 2027. Move your workflows to the Copilot harness before then. Learn more about Local harness deprecation. in the Chat view.
-
Run independent tasks in parallel: work in separate Git worktrees, review each result, then integrate and retest. Setup: your Git repository, Copilot in the Agents window. Complete one agent task first.
-
Continue a cloud session in your terminal Cloud sessions is experimental and might change or be removed. : explore a repository in the cloud, then continue the same session in your terminal. Setup: your private repository, cloud session access, and Copilot CLI.
Improve results and recover
-
Get an agent back on track: choose whether to steer a request, recover unwanted changes, or reset conversation context.
-
Reduce AI credit usage: compare model costs and results, focus context, and scope tools to reduce unnecessary usage.
-
Find prompt examples: adapt prompts for exploring code, building features, debugging, and testing.
Experienced-agent fast track
To skip the sample projects, open your repository as a workspace, then explore the codebase or add a feature. Follow the guide's setup and review and validate edits before you integrate them.
To bring an existing setup, compare agent harnesses and supported accounts, or connect a model with your own API key. Check compatibility with the guide you choose.
Match a guide to your setup
- Project: check whether the guide uses a sample or your own repository, and which development tools it requires.
- Harness: use the specified harness. Tools and customization formats can differ, even with the same model.
- Interface: follow the steps in the specified Chat view or Agents window.
Background and help
-
How agents work: understand the agent loop and the role of models, context, and tools.
-
Best practices for using AI: scope tasks, provide relevant context, and verify results.
-
Troubleshoot AI features: diagnose setup, sign-in, connection, and other technical issues.