corgi worktree add
corgi worktree add
Make a worktree for each service inside the workspace, so its CLAUDE.md still loads
Synopsis
Makes the worktree under .corgi/corgi_services/.worktrees/, inside the workspace, not in /tmp: an agent reading files there still gets the repo's CLAUDE.md, and corgi worktree prune cleans it up. Prints one directory per service on stdout.
corgi worktree add api web --branch feature/ABC-1/limits --base main W=$(corgi worktree add api --branch feature/ABC-1/limits --base main) corgi worktree add api --detach FETCH_HEAD # read-only, for a review
An existing branch is reused as it is; --base only applies to a new one.
corgi worktree add <service>... [flags]
Options
--base string start a new branch from origin/<base> (fetched first) instead of the checkout's HEAD
--branch string branch to work on; made when it does not exist yet
--detach string check out this commit or ref read-only instead of a branch (e.g. FETCH_HEAD)
-h, --help help for add
Options inherited from parent commands
--describe Describe contents of corgi-compose file
--dockerContext string Specify docker context to use, can be default,orbctl,colima (default "default")
-l, --exampleList List examples to choose from. Click on any example to download it
-f, --filename string Custom filepath for for corgi-compose
--fromScratch Clean the .corgi/corgi_services folder before running
-t, --fromTemplate string Create corgi service from template url
--fromTemplateName string Create corgi service from template name and url
-g, --global Use global path to one of the services
--interactive Force interactive prompts even when no TTY/agent detected
--isolate string Run this workspace under a named lease: own port block, own database names, own containers
--json Emit machine-readable JSON output
--privateToken string Private token for private repositories to download files
-o, --runOnce Run corgi once and exit
--silent Hide all welcome messages
SEE ALSO
- corgi worktree - Manage worktrees corgi created for --service-branch and isolated sessions