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.

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.

  • 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, reproduce a defect, and verify the fix against explicit acceptance criteria. Setup: sample web app, Copilot in the Chat view.

  • Practice test-driven development: write a failing test, implement behavior, and refactor with a review checkpoint between phases. Setup: your repository with working tests, Copilot in the Chat view. Custom agents are optional.

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

  • 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.

  • Find prompt examples: adapt prompts for exploring code, building features, debugging, and testing.

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:

  1. Open your repository as a workspace.

  2. Connect your existing account by following the setup for your agent harness, or connect a model with your own API key.

  3. 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