title: ‘Worktrees’
description: ‘Run agents in isolated Git worktrees for parallel development’
The Worktrees feature lets you run multiple agents simultaneously, each in its own isolated, local environment.Each agent works in its own local worktree, enabling them to write code, run tests, and build your applications without conflicting each other. Firebender automatically manages worktrees for you.
A worktree is a Git feature that creates multiple working directories from a single repository. Each worktree has its own set of files and changes.
Clicking Review opens the review interface with IntelliJ’s native diff viewer:Run ConfigurationsYou can run configurations for the worktree directory directly from the review panel:Click the play button to build, test, and run the worktree without opening a new IDE window.
Run configurations in the review panel let you validate changes instantly without switching projects.
Click Create PR and the agent will create the pull request for you:The agent analyzes the changes, writes a comprehensive PR title and description, creates the pull request on your remote repository, and returns the PR link in chat.
We do not recommend symlinking dependencies into the worktree, as this can cause issues in the main worktree. Instead, we recommend using fast package managers such as bun, pnpm or uv in the Python ecosystem to install dependencies.Python project with virtual environment
Simple, verifiable tasksWorktrees excel for straightforward tasks you can easily validate. Bug fixes, writing tests, or fixing failing tests are perfect examples. Use the integrated run configurations to quickly verify the fix works as expected without opening a new project.Long-running isolated tasksMajor refactors that deserve their own PR work great in worktrees. Examples include:
Migrating from View-based UI to Jetpack Compose
Updating to Android 14 with the new permissions model
Converting a large module from Java to Kotlin
Migrating build scripts from Groovy to Kotlin DSL
These tasks can take hours or days, and worktrees let the agent work independently while you continue on other work.Multiple features in parallelWork on multiple features simultaneously without waiting for agents to complete. This requires some context switching but is powerful for developers who can juggle multiple threads. Start an agent in a worktree for one feature, then continue working on something else in your main project.