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.
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.
Explore your own code
Ask about a behavior in your repository and verify the explanation without changing files.
Complete your first agent task
Build and validate a small web app in a sample project with no runtime or build tools required.
Build, refine, and commit an app
Build a portfolio page across the Agents window and Chat view, then commit your changes.
- Already use AI coding tools: Follow the experienced-agent fast track to bring your workflow to your own repository.
- Need a quick single-function edit: Try a focused edit with inline chat without starting an agent task.
- Want a prompt to adapt: Browse the prompt examples for common coding tasks.
- Not sure which AI feature to use: Check the AI features cheat sheet to match a task to its feature and first action.
- New to VS Code: First install the editor and open a workspace.
Each guide below lists the project, agent harness, and interface it uses. Follow the steps in the specified harness and interface, because available tools and customization formats can differ even with the same model.
Work on a project
| Guide | What you'll do | Setup |
|---|---|---|
| Explore a codebase | Trace a behavior without editing files and verify explanations against source references. | Your repository, Copilot in the Chat view. |
| Fix an API bug | Reproduce a pagination bug, add a regression test, and review the fix. | Sample project (or your repository), Node.js 22 or later, Git, Copilot in the Chat view. |
| Debug a runtime failure | Pair an agent with the debugger, stack traces, and logpoints to confirm a root cause and verify a fix. | Your repository with a reproducible failure and debugger extension, Copilot in the Chat view. |
| Add a feature | Plan a feature with /plan, implement and approve tool calls, and review diffs and tests in your own project. |
Your repository with working tests, Copilot in the Chat view. |
| Refactor safely | Change code structure in reviewable steps while preserving existing behavior. | 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. | Your GitHub-backed repository, Copilot in the Agents window. |
| Work with Jupyter notebooks | Create or edit a notebook, run cells, and review results. | 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
| Guide | What you'll do | Setup |
|---|---|---|
| Add tests to existing code | Generate and verify tests for existing behavior. | Your repository, Copilot in the Chat view. |
| Practice test-driven development | Build new behavior test-first with a red-green-refactor loop. | Your repository with working tests, Copilot in the Chat view. |
| Validate a web app with browser tools | Test interactive web UI flows using browser tools. | Sample web app (no build step), Copilot in the Chat view. |
To reproduce a defect with a regression test, see Fix an API bug.
Customize and coordinate agents
| Guide | What you'll do | Setup |
|---|---|---|
| Adapt agents to your project | Add project instructions for a convention the agent keeps missing, then compare the result on the same task. | Your repository. Works with 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. | 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. Complete one agent task first. | Your Git repository with tests, Copilot in the Agents window. |
| 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. | Your private repository, cloud session access, and Copilot CLI. |
Improve results and recover
| Guide | What you'll do | Setup |
|---|---|---|
| Compare and choose models | Start with Fusion, Auto, or an individual model, then compare results side by side when you need more evidence. | Your repository with working tests, Copilot in the Chat view or Agents window. |
| Get an agent back on track | Decide whether to steer a request, recover unwanted changes, or reset conversation context. | Any workspace, Copilot in the Chat view or Agents window. |
| Reduce AI credit usage | Compare model costs and results, focus context, and scope tools to reduce unnecessary usage. | Any workspace, Copilot in the Chat view or Agents window. |
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.
-
Choose your starting surface: open the Agents window if you are bringing an existing Claude or Codex workflow (such as Claude Code) or want to coordinate tasks across multiple projects. Use the Chat view when you want to work beside your editor, tests, and debugger in a single workspace.
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.
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.