Engineering
create-worktree avatar

create-worktree

Automates the creation of isolated git worktree environments for parallel feature development and environment setup.

Introduction

The create-worktree skill is an engineering productivity tool designed for developers who manage multiple feature branches simultaneously within a single repository. By leveraging git worktree functionality, this skill allows users to maintain multiple isolated development environments without the constant need for switching branches and reinstalling dependencies. It is specifically intended for developers working in complex projects involving multiple modules, such as frontend, backend, and agent services, where environment variable management is critical.

Upon triggering the skill, it automatically generates a new subdirectory within the .worktrees/ path, initializes a new feature branch, propagates necessary environment configuration files (such as .env, .envrc, and module-specific configuration files), and invokes make setup to prepare the local environment. This eliminates manual setup fatigue and ensures consistency across different feature development workflows.

  • Automatically creates isolated git worktrees for rapid context switching and parallel task execution.

  • Copies essential environment files including .env, .envrc, and various environment-specific variants for frontend and backend modules.

  • Integrates seamlessly with local development routines, allowing for the automation of make setup commands upon initialization.

  • Operates as a shell-based utility, making it compatible with any git-managed repository structure.

  • Compatible with the pr-and-cleanup skill for streamlined feature lifecycle management, covering everything from initialization to pull request submission.

  • Requires git to be installed and the repository to be properly initialized as a git project.

  • Best suited for teams or individuals using standardized environment file naming conventions to ensure automatic synchronization of configuration variables.

  • Works best when combined with the .claude/settings.json configuration, which prompts developers to run this tool immediately after the planning phase concludes.

  • Note that while the tool handles the initialization and synchronization of configuration, it does not manage external cloud secrets, so ensure that local files are properly handled according to your repository security policies.

  • If a branch already exists, the script will automatically attach the worktree to that existing branch rather than failing, enabling quick resumption of work on previous tasks.

Repository Stats

Stars
64
Forks
1
Open Issues
0
Language
Shell
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 04:19 PM
View on GitHub