YGGDRASIL

Grow your worlds. Manifest your ideas.

Peaceful Village by Arthur Vyncke | arthurvost
Music promoted by free-stock-music.com
Creative Commons Attribution-ShareAlike 3.0 Unported

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.

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.

True Parallel Tasks

Run completely independent tasks at the same time β€” implement a new page while fixing a bug in a totally different flow. No stashing, no conflicts.

First-class Worktree Workflow

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

AI-Friendly Isolation

Assign each AI agent its own worktree β€” every task gets a dedicated, isolated environment.

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.

The Core

Run Independent Tasks in Parallel

This is the heart of Yggdrasil. Each worktree is a completely independent task β€” with its own branch, its own remote, its own environment. Implement a new page while fixing an unrelated bug in a different flow. Simultaneously.

Multiple Tasks, Zero Conflicts

Terminal
$yggtree wt create feat/new-dashboard --exec 'cursor .'
Terminal
$yggtree wt create fix/auth-bug --exec 'code .'
Terminal
$yggtree wt create chore/update-deps --exec 'aider'
Task 1
feat/new-dashboard
Building the new analytics page
Task 2
fix/auth-bug
Fixing a login edge case
Task 3
chore/update-deps
Upgrading outdated dependencies

Three unrelated tasks. Three isolated environments. All running at the same time.

πŸ€– Even Better with AI Agents

Assign each agent its own worktree. Different tasks, different agents, all in parallel β€” no collisions.

Terminal
$yggtree wt create feat/ai-refactor --exec 'cursor .'
Terminal
$yggtree wt create feat/ai-tests --exec 'codex'
Terminal
$yggtree wt create fix/ai-perf --exec 'aider'
Agent A Β· Cursor
Refactors architecture
Agent B Β· Codex
Writes test suite
Agent C Β· Aider
Optimizes performance

All in parallel. All reviewable. All isolated.

Extra Mode

πŸ§ͺ Sandbox Mode

Not every worktree needs to be a live task with its own remote branch. Sometimes you just need a local playground β€” a temporary, disposable space to experiment freely and bring back only what works.

When to Use Sandbox

The core workflow creates real, managed worktrees β€” each with its own branch and remote, perfect for independent tasks. But sometimes you don't need all that. You just want a quick, local-only space to try something without any Git footprint. That's where Sandbox comes in.

πŸ”¬ A/B Testing Approaches
Create 3 sandboxes. Try 3 completely different architectures for the same problem. Keep the winner, discard the rest. No branches left behind.
πŸš€ Risky Refactors
That massive refactor you're not sure about? Do it in a sandbox. If it breaks everything, just delete it β€” your main code is untouched.
πŸ€– Multi-Agent Experiments
Give the same task to different AI agents β€” Cursor in one sandbox, Codex in another, Aider in a third. Compare the results side by side. Pick the best one.
πŸ“ Multi-Prompt Testing
Same agent, different prompts. Spin up sandboxes to test how different instructions produce different outcomes for the very same task. Iterate faster.

The Workflow

Terminal
$yggtree wt create-sandbox --carry

Creates a temporary, local-only worktree with a random name. Carries your uncommitted changes. Never pushes to remote.

Terminal
$yggtree wt apply

Liked the result? Apply the file changes back to your origin directory.

Terminal
$yggtree wt unapply

Didn't work out? Revert to exactly how it was before.

Command Reference

Everything you need to master Yggdrasil worktrees.

Configuration

Customize how Yggdrasil bootstraps each worktree with automatic setup scripts.

.yggtree/worktree-setup.json

Create a .yggtree folder in your repo root with a worktree-setup.json file to define custom bootstrap commands:

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

Resolution order:

  1. .yggtree/worktree-setup.json in the repo root (primary)
  2. .yggtree/worktree-setup.json inside the worktree (per-worktree override)
  3. yggtree-worktree.json (legacy)
  4. .cursor/worktrees.json (legacy)
  5. Fallback: npm install + submodules
See it in Action

Watch Yggdrasil in Action

The story behind the tool + the real CLI running live.

The Yggdrasil Story

🌳 The core idea β€” how growing parallel worlds changes the way you develop.

yggtree β€” Live CLI Demo

🌿 The real CLI in action.

Support the Journey

If Yggdrasil has helped you grow your worlds, consider fueling the next realm.

Or choose your own amount on your preferred platform:

✨ Every contribution helps nurture the tree and grow new branches ✨