Yggdrasil
Worktree

Grow many worlds. Merge what matters.

Like the mythical world tree connecting realms, Yggdrasil lets you grow isolated, parallel environments where ideas can evolve independently without colliding.

npm versionlicense
npx yggtree
View on GitHub

Mental Model

Yggdrasil is built around a few core ideas that transform how you think about parallel development.

Branches are ideas

Each branch represents a concept, a possibility, a direction your code could take.

Worktrees are realms

Each worktree is a complete, isolated reality where that idea can fully manifest.

Each task deserves its own world

No more context switching. No more stashing. Each task lives in its own space.

Quick Start

Get started in seconds. No installation required.

Installation

Run without installing:

Terminal
$npx yggtree

Or install globally:

Terminal
$npm install -g yggtree

Basic Usage

yggtree

Key Features

Everything you need for modern parallel development workflows.

First-class Worktree Workflow

Create, manage, and navigate Git worktrees as a primary workflow, not an afterthought.

Parallel Development

Work on multiple branches at the same time, each in its own isolated environment.

AI-Friendly Isolation

One worktree per agent, per experiment, per idea. No shared state, no collisions.

Automatic Bootstrapping

Run installs, submodules, and setup scripts automatically for each worktree.

Enter, Exec, and Exit

Enter worktrees, execute commands, or run tasks without changing directories.

Interactive or Scriptable

Use the interactive UI or drive everything through commands and flags.

Built for AI Agents

Yggdrasil shines when paired with AI agents. Assign one worktree per agent for true parallel exploration.

Parallel Agent Workflow

Instead of running agents against the same directory, assign each agent its own realm:

Terminal
$yggtree wt create feat/ai-refactor-a --exec 'cursor .'
Terminal
$yggtree wt create feat/ai-refactor-b --exec 'codex'
Terminal
$yggtree wt create feat/ai-tests --exec 'aider'
Agent A
Refactors architecture
Agent B
Explores performance
Agent C
Writes tests

All in parallel. All reviewable. All isolated.

Command Reference

Everything you need to master Yggdrasil worktrees.

Configuration

Customize how Yggdrasil bootstraps each worktree with automatic setup scripts.

yggtree-worktree.json

Place this file in your repo root to define custom bootstrap commands:

yggtree-worktree.json
{
  "setup-worktree": [
    "npm install",
    "git submodule sync --recursive",
    "git submodule update --init --recursive",
    "echo \"🌳 Realm ready\""
  ]
}

Resolution order:

  1. yggtree-worktree.json inside the worktree
  2. yggtree-worktree.json in the repo root
  3. .cursor/worktrees.json
  4. Fallback: npm install + submodules