Back to browse
GitHub Repository

Give your AI coding agents their own trees and manage parallel dev environments. 🌲🌲🌲

4 starsShell

Agent workspace switcher for Git worktrees

by prbdiasΒ·Feb 24, 2026Β·2 pointsΒ·0 comments

AI Analysis

●●SolidSolve My ProblemShip It

Worktree switcher for multi-agent AI, but git-worktree automation is still niche.

Strengths
  • β€’Eliminates tedious Docker/env-file context switching with single command; real pain point.
  • β€’Zero dependencies (Bash + git/docker/jq) means portable, auditable, no dependency hell.
  • β€’Smart branch parsing and issue number extraction adds polish without complexity.
Weaknesses
  • β€’Audience is narrow: requires already using git worktrees + Docker + multi-agent setup.
  • β€’No Windows support mentioned; niche use case (multi-agent) limits immediate adoption potential.
Target Audience

AI-assisted development teams, multi-agent workflow engineers

Similar To

Niri workspace management Β· Devenv.sh (environment orchestration)

Post Description

Hey HN, I've been exploring ways to make my engineering teams more productive in multi-agent AI coding workflows.

The most popular development tools (Cursor, Claude Code, etc.) leverage git worktrees to enable multiple agents to work in parallel, guaranteeing each runs in a semi-isolated workspace. The workflow is powerful, but switching between worktrees to test what each agent built is painful: take down the stack for agent X, cd to the right worktree, re-source .env files, bring up the stack for agent Y, run migrations, seed the database, start build tools... every single time.

forest solves this with a single command. It's a portable Bash script (~1200 lines, no dependencies beyond git/docker/jq) that bridges git worktrees, Docker Compose, and host services:

- forest list β€” shows all worktrees with branch context, dirty file counts, and issue numbers parsed from branch names - forest boot 2 β€” spins up the full dev stack (Docker + host services like Vite) for worktree #2 - forest switch 3 β€” tears down the current stack and boots another in seconds - forest status β€” shows exactly what's running and where

It also has a configurable hook system (pre, pre-services, post) so you can automate all the ceremony around booting an environment. Running migrations, seeding or resetting databases, installing dependencies, setting up k8s clusters, health checks, whatever your project needs. It auto-sources .env files, redirects host service logs to .forest/logs/, and remembers branch names even when worktrees end up in detached HEAD state (common during agent rebases).

Config is a single JSON block that lives alongside your editor config (auto-detects from .cursor/worktrees.json, .claude/settings.json, or .forest/config.json), and forest init walks through setup interactively.

Pure Bash 3.2+ (works on macOS out of the box), MIT licensed. Install with:

curl -fsSL https://raw.githubusercontent.com/prbdias/forest-cli/main/install.sh | bash

Would love feedback from anyone doing multi-worktree development, with or without AI agents.

Similar Projects

Developer Tools●●●Banger

AWF – run parallel AI coding agents, each in its own Docker workspace

Runs agent swarms without collisionsβ€”each task gets isolated Docker + auto-merge loops.

WizardryZero to OneSolve My Problem
dimileeh
503d ago
AI/ML●●Solid

I've implemented multi-repo workspace support in Agent of Empires

Git worktrees and Docker sandboxes let agents tackle multi-repo tasks without context collapse.

Niche GemShip It
seluj78
601mo ago