BareWT

  • TypeScript
  • Node.js

What is BareWT?

BareWT (bwt) is a CLI tool that manages git worktrees using the bare clone pattern. Clone a repository once and work on multiple branches simultaneously, each in its own folder — no git checkout, no git stash.

Specifically designed for AI coding agents. barewt gives each AI session its own clean worktree with independent context, shared through linked paths like openspec/. The AI provisions worktrees, you switch between them, and bwt prune cleans up after merged PRs.


🚀 Key Features

  • Clone once, get one folder per branch — no switching, no stashing

  • Link folders across worktrees (openspec/, .opencode/) so all agents share the same context

  • Protect branches from accidental removal with prune and wipe

  • Prune orphan worktrees whose upstream branches were deleted

  • Interactive wipe selector to clean up manually

  • Full alias support — every command has a short form (bwt i, bwt a, bwt p)

  • Works with any git repo — no special server or configuration needed


🤖 Built for AI Agents

barewt is purpose-built for parallel AI agent workflows using Spec-Driven Development (SDD):

  • Global context: linked paths give every agent the same view of tasks, specs, and project rules — no matter which branch they're on

  • Isolated work: each agent works in its own worktree with its own branch, zero interference

  • Clean lifecycle: merge the PR → bwt prune removes the worktree and branch


📦 Installation

bash npm install -g barewt

Requirements: Node.js 22.12+


🛠️ Quick Start

bash bwt init git@github.com:user/repo.git cd repo/.git bwt add feature/my-feature