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 a feature and its first action, use the AI features cheat sheet.
Choose where to start
New to AI coding? Start by exploring your own code without changing it, or use a sample project to practice making and reviewing changes. If you're new to VS Code, install the editor and open a workspace first.
Explore your own code
Ask about a behavior and verify the explanation without changing files.
Your repository. Start with a question about code you know.
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, refine, and commit an app
Extended tutorial. Build a portfolio page in the Agents window, refine it in the Chat view, and review and commit your changes.
Sample project. Requires Git.
For a change to a single function, try a focused edit with inline chat. Compare the result with four expected outputs without starting an agent task.
Already use AI coding tools? Follow the experienced-agent fast track to bring your workflow to VS Code.
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.
-
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.
-
Debug a runtime failure: pair an agent in the Chat view with the debugger, stack traces, and logpoints to confirm a root cause and verify a fix. Setup: your repository with a reproducible failure and debugger extension, Copilot in the Chat view.
-
Add a feature: continue the bug tutorial by adding filtering to the same pagination API, or plan, implement, and test a feature in your own project. Setup: the fixed sample or your repository with working tests, Copilot in the Chat view.
-
Refactor safely: change code structure in reviewable steps while preserving existing behavior. Setup: your repository, Copilot in the Chat view.
-
Review a pull request: inspect a pull request diff, address review comments or failing CI checks in an isolated worktree, verify fixes, and sync the branch. Setup: your GitHub-backed repository, Copilot in the Agents window.
-
Work with Jupyter notebooks: create or edit a notebook, run cells, and review results. Setup: your data, the Jupyter extension, and a notebook kernel.
If the change is already written, review uncommitted changes with AI before you commit.
Test and validate
Choose the testing workflow that fits your starting point:
| Goal | Guide | Setup |
|---|---|---|
| Add tests to existing behavior | Add tests to existing code | Your project, Copilot in the Chat view. |
| Build new behavior test-first (red-green-refactor) | Practice test-driven development | Your repository with working tests, Copilot in the Chat view. |
| Validate interactive web UI flows | Validate a web app with browser tools | Sample web app, Copilot in the Chat view. |
| Reproduce a defect with a regression test | Fix an API bug | Sample project (or your own repository), Node.js 22 or later, and Git. |
Customize and coordinate agents
-
Adapt agents to your project: start with one project convention the agent keeps missing. Add instructions, then compare the result on the same task. Setup: your repository, Copilot, Claude, or Codex.
-
Set up a context engineering workflow: combine custom instructions, Agent Skills, and planning and TDD custom agents for repeatable feature delivery. Setup: your repository, Copilot in the Chat view or Agents window.
-
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
-
Compare and choose models: start with Fusion, Auto, or an individual model, then compare results when you need more evidence. Use your own repository with working tests.
-
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.
If you already know your task and need a prompt to adapt, browse the prompt examples.
Experienced-agent fast track
If you already use AI coding tools but are new to VS Code, bring your workflow to your own repository without completing the sample tutorials:
-
Connect your existing account by following the setup for your agent harness, or connect a model with your own API key.
-
Use the Chat view to work alongside your editor, tests, and debugger, or the Agents window to coordinate tasks across multiple projects.
Start with a bounded task: explore the codebase or add a feature. Check the guide's harness and interface requirements, and review and validate edits before you integrate them.
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.