https://youtu.be/l_XtUjVFRnY

I'm going to walk you through how I improved my productivity by four times using Claude's worktree feature (four times because i used for four agentic worktrees)

Typically when you're running an agent, you have to wait for one task to finish before you can kick off the next. You could try opening multiple terminal windows — but if you're working from a specific project folder and all those agents are making changes in the same place, you'll run into conflicting edits.

Worktrees solve this by giving each agent its own independent copy of the project. Once each agent is done, you bring everything back together. If you're familiar with git worktrees, this is exactly that.

I'll use a project I recently built to show you how this works in practice: YoutubeGPT — a web app that lets you index any YouTube channel and ask natural-language questions across all of its videos. The system pulls transcripts, generates embeddings, runs semantic search via pgvector, and streams a grounded Claude answer back with timestamp citations.

Step 1: Write the Feature Specification

The first step is passing in a prompt to create your feature specification plan. This prompt is not to build the project — it's to define the features.

You want one document with all key features clearly stated so you can review it and make sure they're mutually exclusive. That's the test: if two features might touch the same file, they're not independent enough for parallel worktrees.

Here's the prompt I used:

YoutubeGPT is a webapp that queries YouTube channels and helps people ask questions across the channel. Create a feature-plan-draft.md that specifies the features (how the site behaves, UX considerations), functionality (key technical choices, considerations and behaviours) and creates a development plan for what needs to be built, in what order, and what can be done in parallel. Break the implementation plan into the smallest possible MVPs — like really as small as possible. Each milestone should be 1–5 story points. Something that might take an engineer a week but Claude Code a few minutes.

That sizing constraint matters. Vague milestones produce vague agents. Small, concrete milestones keep each agent focused.

Writing the feature plan in VS Code alongside Claude

What the Feature Plan Does

The feature implementation plan does four main things.

1. Defines the product vision and overall objective.

For YoutubeGPT, the core flow is:

  1. User enters a YouTube channel URL or handle
  2. System checks if channel is already indexed; if not, begins ingestion