Reference
crab worktree
Manage Git linked worktrees while keeping Crab hydration state isolated per worktree.
Synopsis
crab worktree [OPTIONS] <COMMAND>Subcommands are add, list, lock, move, prune, remove, repair, and
unlock. Git-compatible worktree options are passed through where the installed
Git supports them.
Add a worktree
crab worktree add ../experiment feature/data-cleanup
crab worktree add -b experiment ../experiment main
crab worktree add --detach ../scratch HEADcrab worktree add also accepts Crab hydration controls:
| Option | Description |
|---|---|
--hydrate <lazy|pointer-only|full> | Set the new worktree's hydration policy |
--hydrate-include <PATTERN> | Hydrate selected patterns after creation |
--hydrate-exclude <PATTERN> | Exclude patterns from selective hydration |
--hydrate-manifest <PATH> | Use a newline-delimited hydration manifest |
--hydrate-manifest-ref <REF> | Read a manifest from Git |
--hydrate-profile <NAME> | Use a profile from crab.toml |
--prefetch | Warm selected content without materializing it |
--no-checkout | Create worktree metadata without populating files |
If post-create hydration fails, Crab preserves the new worktree so you can
retry from inside it with crab hydrate.
Inspect and repair
crab worktree list --json
crab worktree list --json --with-crab-state
crab worktree prune
crab worktree repair
crab worktree remove ../experimentThe normal listing is fast. --with-crab-state adds hydration, cache, pointer,
and speculation summaries.
Related commands
crab hydrate— materialize pointer files.crab dehydrate— replace content with pointers.crab clone— clone with Crab setup and hydration defaults.