Show HN: Agent workspace switcher for Git worktrees
1 points
1 hour ago
| 0 comments
| github.com
| HN
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.
No one has commented on this post.