Why Worktrees Matter
Traditional AI coding workflows are sequential: give an AI a task, wait for it to finish, review, then start the next. This wastes time. With worktrees, while one AI builds a feature, you can have others tackling different tasks in parallel.Worktrees share the same git history, but file changes are isolated until you merge.
Prerequisites
- A project added to Termpad
- Understanding of what you want the worktree to accomplish
Creating a New Worktree
1
Select your project
Click on the project in the sidebar where you want to create a worktree.
2
Click Add Worktree
Click the Add Worktree button.
3
Enter a branch name
Type a descriptive branch name. Good naming conventions:
feature/login-pagefix/null-pointer-errorrefactor/api-clientexperiment/new-caching
4
Choose a base branch
By default, new branches are based on
origin/main. Select a different base if needed.5
Wait for setup
Termpad creates the worktree and runs your setup script. This may take a moment depending on your script.
Worktree Anatomy
Each worktree includes:Using an Existing Worktree
If you want to import worktrees that already exist:1
Open Add Worktree
Click the Add Worktree button.
2
Click the Import tab
Select the Import tab in the dialog.
3
Select worktrees to import
Termpad auto-detects all existing worktrees. Choose which ones to import/add.
Worktree Workflow
A typical worktree workflow:1
Create worktree
Create a new worktree with a clear purpose.
2
Launch AI agent
Start Claude Code, Gemini, or your preferred tool:
3
Give the AI a task
Describe what you want to build or fix.
4
Monitor and assist
Answer questions, review progress, redirect as needed.
5
Review changes
Use the diff viewer to review what the AI created.
6
Commit and push
Stage, commit, and push your changes.
7
Create PR
Open a pull request for code review.
8
Delete worktree
Clean up the worktree when you’re done.
Managing Multiple Worktrees
Create additional worktrees to work in parallel:1
Create more worktrees
Repeat the worktree creation process for each task.
2
Switch between worktrees
Click any worktree in the sidebar to switch to it.
3
Monitor status
The sidebar shows status indicators:
- Active (running processes)
- Waiting (needs input)
- Idle (no activity)
Deleting a Worktree
When a worktree’s work is complete:1
Commit your work
Make sure all changes are committed and pushed.
2
Delete the worktree
Click the options icon on the worktree, then click Remove worktree.
3
Cleanup
Termpad runs cleanup scripts and removes the worktree.
Best Practices
Choose independent tasks
For best results, choose tasks that don’t overlap:- Good
- Avoid
- Worktree 1: Build login page
- Worktree 2: Build settings page
- Worktree 3: Add API rate limiting
One task per worktree
Keep worktrees focused on a single task. This makes:- Progress easier to track
- Changes easier to review
Use descriptive branch names
Your branch name should describe the work:Clean up finished worktrees
Don’t let old worktrees accumulate. Delete them when:- The PR is merged
- You’ve decided not to pursue the work
- The experiment is complete