create Command
What It’s For
Section titled “What It’s For”Start feature work across multiple repositories from a single command.
What It Does
Section titled “What It Does”- Creates a worktree for the target branch in each configured repository.
- Ensures repositories are aligned to the same branch name.
- In interactive mode, always creates the parent/meta worktree and prompts only for optional child repositories.
- Reconciles managed ignore rules before creating any parent or child worktree.
- Runs configured lifecycle hooks when present.
arashi create <branch> [options]Key Options
Section titled “Key Options”-o, --only <repos>limit creation to repository names; repeat it, use commas, or mix both forms.-g, --group <group>create worktrees only for requested groups; repeat it, use commas, or mix both forms.-i, --interactivepick repositories interactively.--switchswitch to the created parent worktree after create.--no-switchdisable configured create switch defaults for one invocation.--launchopen a terminal/editor context after create.--no-launchdisable configured create launch defaults for one invocation.--tablaunch the primary created worktree as a tab in the selected supported context (implies launch and switch).--tmuxforce a new plain tmux window after creation (implies launch and target selection).--seshforce sesh launch mode (implies launch behavior).--herdropen or focus the primary created worktree in Herdr (implies launch behavior).--conflict <strategy>preselect conflict handling (ABORT,REUSE_EXISTING).--base <branch>start newly created target branches from this branch in each selected repository.--no-hook-inputexecute hooks with immediate EOF on stdin for this invocation only.--no-hooksdisable hook execution.--no-progresshide progress indicators.-n, --dry-rungenerate a plan without creating worktrees.--move-changesmove compatible uncommitted changes from the current workspace into the new worktree after create.-j, --jsonoutput machine-readable create results or structured unsupported-mode errors.
Examples
Section titled “Examples”# Create branch worktrees across the workspacearashi create feature-auth-refresh
# Create in specific repositories onlyarashi create feature-auth-refresh --only api,web
# Create worktrees for the core repository grouparashi create feature-auth-refresh --group core
# Pick child repositories interactively while always creating the parent worktreearashi create feature-auth-refresh --interactive
# Force launch for this runarashi create feature-auth-refresh --launch
# Create worktrees and open the primary worktree in a new plain tmux windowarashi create feature-auth-refresh --tmux
# Create worktrees and open the primary worktree as a supported tabarashi create feature-auth-refresh --tab
# Create worktrees and open the primary worktree in Herdrarashi create feature-auth-refresh --herdr
# Disable configured launch default for this runarashi create feature-auth-refresh --no-launch
# Review the plan firstarashi create feature-auth-refresh --dry-run
# Create a task branch from a long-running feature brancharashi create feature/FEAT-1234/docs --base feature/FEAT-1234
# Preview the same selected repositories and resolved basesarashi create feature/FEAT-1234/docs --base feature/FEAT-1234 --group docs --dry-run
# Create worktrees and emit JSON for automationarashi create feature/FEAT-1234/docs --base feature/FEAT-1234 --no-launch --no-switch --json
# Create worktrees and move current uncommitted work into themarashi create feature-auth-refresh --move-changes
# Run hooks without allowing them to read from the terminalarashi create feature-auth-refresh --no-hook-inputChoosing a base branch
Section titled “Choosing a base branch”Use --base <branch> when a task branch must descend from a long-running branch such as feature/FEAT-1234. The precedence is CLI > configuration > legacy behavior: --base overrides defaults.create.baseBranch; with neither, the parent starts from the current parent branch and each child starts from its detected default branch.
Arashi resolves an effective base independently in every effective selected repository, including repositories whose target branch will be reused. Selection by --only, --group, their intersection, or the interactive picker constrains that set. Resolution prefers the local branch first, then origin/<branch>. If any selected repository cannot resolve the base, Arashi aggregates all repository resolution errors and fails with CREATE_BASE_RESOLUTION_FAILED before hooks or any workspace mutation. It never falls back to another branch.
Preflight records both the reporting ref and its captured commit OID. New targets use that OID even if the local or remote base ref moves after preflight. A target accepted with --conflict REUSE_EXISTING is only materialized: the requested base is still validated, but Arashi does not reset, rebase, recreate, or otherwise change its ancestry.
Human --dry-run output names the requested base and each repository’s resolved ref/OID and planned create-or-reuse action. With --json, the same optional high-level base data is structured for automation; resolution failures use CREATE_BASE_RESOLUTION_FAILED. Arashi keeps ARASHI_BRANCH_NAME target-oriented and deliberately does not provide an ARASHI_BASE_BRANCH hook or environment variable.
Workaround for older Arashi versions
Section titled “Workaround for older Arashi versions”Before native base selection, pre-create the target branch from the desired base in every repository, then let create reuse it:
BASE=feature/FEAT-1234TARGET=feature/FEAT-1234/docs
# arashi exec reaches managed children, not the parent.arashi exec -- git branch "$TARGET" "$BASE"git branch "$TARGET" "$BASE"arashi create "$TARGET" --conflict REUSE_EXISTINGThis workaround requires the base in every selected repository and an absent target, unless you have independently verified an existing target’s ancestry. Filters can narrow the managed children, but arashi exec covers managed children, not the parent, so create the parent target separately. REUSE_EXISTING does not repair or validate ancestry.
Configured file materialization
Section titled “Configured file materialization”For each selected configured child repository, the construction order is pre-create, copy, symlink, then post-create. Copy and symlink entries retain their configured array order, so post-create hooks can rely on materialized paths being ready. --no-hooks does not disable copy, symlink, or other materialization.
Missing sources are skipped with a visible non-fatal outcome. Arashi never overwrites an existing destination, and every destination must remain inside the new worktree; unsafe paths or an existing destination fail that repository’s materialization. A native symlink fails when platform policy or the filesystem rejects it, with no copy, hard-link, or junction fallback. Materialization does not fall back to the caller’s checkout or another source repository: it always reads from the Git-primary child checkout.
arashi create --dry-run previews the ordered materialization plan in declaration order before any worktree or file mutation. See the Config workflow to choose between isolated copies and intentionally shared symlinks.
- In standalone mode,
createmakes one worktree at the main root’s.worktrees/<branch>path from either the main or a linked worktree. Before any mutation, Git must report the exact destination as effectively ignored; repository/group filters and interactive multi-repository selection are rejected. See the Standalone Repository workflow. createvalidates branch names and repository readiness.- Configured create runs workspace
pre-createonce before branch/worktree mutation, then each repository’s retained-namepre-create.<repo>after Git worktree creation and before configured file materialization/setup, followed bypost-create.<repo>. Workspacepost-createruns once after coordinated Git creation and before move-changes or switch/launch handling. Repository hooks run in the new child worktree; workspace hooks run at the workspace root. - Any create-hook validation failure, timeout, or nonzero exit fails create and enters the owned Git rollback boundary. Human and JSON results preserve the complete hook outcome ledger and any rollback warning. See the Hooks workflow for scope, environment, platform, timeout, and outcome details.
- Inline configured hooks use the same lifecycle timing as native files. Results identify them with
sourceKind: "inline-config",sourceOwnerKind, andsourceOwnerName; outcomes, previews, diagnostics, and logs do not reveal snippet text. - A normal terminal run exposes
ARASHI_HOOK_INPUT=tty;--no-hook-inputor JSON usesdisabled, and non-TTY automation usesunavailable. Disabled and unavailable hooks receive immediate EOF.--no-hook-inputdoes not skip hooks; it is distinct from--no-hooks, which skips hook execution, and--interactive, which continues to control configured repository selection. The input opt-out is invocation only and is not persisted. --no-hooksis create-only;--no-hook-inputis shared by create and remove. Configured-create dry-run performs no hook discovery, returns an empty hook ledger, and has no hook preview. See the Hooks workflow for choosing inline configuration or native files.- On other failures, coordinated operations can roll back to keep repos consistent.
- Reconciliation honors existing effective tracked, repository-local, or global rules before using the clone’s stored scope or repository-local default. Scope
nonecreates no ignore-file changes and warns for safe paths that remain unignored. --dry-runpreviews managed ignore scope, effective sources, planned rules, warnings, and unsafe skips without changing ignore files or clone-local preference state.- If worktree creation is fully rolled back, reconciliation is restored too. If a worktree survives a partial failure, Arashi retains the ignore state needed for that final filesystem state and reports it.
- Interactive
createtreats the parent/meta repository as the required anchor for the coordinated worktree; the selection prompt only controls child repositories. --grouptargets configured semantic sets such ascore,docs,extensions,agents, orinfra.- When combined with
--only,--groupnarrows the explicit repository list by intersection. Empty intersections fail before creating worktrees. - A partial coordinated worktree is valid. Add omitted child repositories later with
arashi clonefrom inside that worktree. - Configure one post-create choice in
.arashi/config.jsonatdefaults.create.launch:none | auto | sesh | herdr. The independentswitchboolean can still select the new primary worktree without launching; every launch mode exceptnoneselects it too, so launch implies switch. --tmuxis a per-invocation-only override and is not persisted in the generic or editor-scoped create configuration. Configuredautocan still choose tmux contextually when launch runs inside tmux.--tabis a CLI-only, one-invocation disposition. It implies launch and switch, bypasses configured generic or editor-scoped launch defaults, and wins over--no-launchand--no-switch; automatic contextual launcher resolution applies unless--tmux,--sesh, or--herdrexplicitly chooses the adapter. Knowable unsupported requests fail before mutation, while runtime failures after creation preserve the worktrees and never fall back to a window. See the launch disposition workflow for the complete matrix and JSON exit behavior.- Explicit
--tmuxtakes precedence over generic and editor-scoped create defaults and automatic Herdr, cmux, or IDE detection.--tmux+--no-launchstill implies post-create launch, and--tmux+--no-switchstill selects and launches the primary created worktree. --tmuxconflicts with--seshand--herdr. Arashi reports the complete explicit-launcher conflict set before repository mutation.- Launch precedence is deliberate. Otherwise
--seshor--herdrselects that explicit launcher even beside--launchor--no-launch;--launchselectsauto;--no-launchselectsnone; then configured launch applies; an absent choice is built-innone. - Terminal and editor-hosted defaults are isolated. See the Config workflow for matching-host scope and legacy migration rules.
- Explicit tmux requires a non-empty
TMUXvalue after trimming. A missing or blank value is an actionable usage error before creating worktrees or running create hooks, so no create rollback is needed. - After successful preflight, Arashi invokes
tmux new-window -c <primary-worktree-path>without a shell. Paths containing spaces, quotes, or shell-significant characters remain the exact single argument aftertmux new-window -c. - If
tmux new-windowfails after creation, Arashi reports the launch failure, preserves the successfully created worktrees, and does not fall back to another launcher or roll back Git creation. - Explicit tmux works the same way in a zero-config standalone repository and does not create or persist
.arashiconfiguration. The standalone destination and effective-ignore safety checks still apply. - Explicit
--herdrimplies launch and takes precedence over--no-launch, matching explicit--sesh. Combining--herdrwith--seshis rejected before worktree creation; without explicit--herdr,--no-launchsuppresses configured Herdr. create --launchautomatically selects Herdr only whenHERDR_ENVtrims to exactly1and no explicit or configured launcher wins. Automatic tmux keeps precedence over automatic Herdr.- Herdr v0.7.4 requires a reachable default session/socket and a non-bare main checkout for the primary repository. It opens the already-created target, reuses an existing workspace, and applies the
<repo-name>: <branch-name>label. - If Herdr is missing, cannot reach its socket, returns an error or invalid response, or cannot use a bare-only source, Arashi reports
LAUNCH_FAILED, preserves every successfully created worktree, and does not try another launcher or roll back Git creation. - When post-create launch runs inside a cmux-managed terminal, Arashi creates and focuses a cmux workspace rooted at the new primary worktree. This requires cmux v0.64.18 or newer and local socket access.
- If cmux launch fails after worktree creation, the created worktrees remain available and Arashi reports the launch failure without falling back to standalone Ghostty.
- An active tmux session nested inside cmux keeps the existing tmux/sesh launch behavior.
- In an automatically detected Kitty 0.43+ context, post-create launch uses the same managed Kitty reuse-or-launch flow as
arashi switch. If remote control, focus, launch, or validation fails after creation, the created worktrees remain available and Arashi reportsLAUNCH_FAILEDwithout another launcher or Git rollback. See the Kitty workflow guide for setup and ownership boundaries. - JSON mode is intended for non-interactive automation.
create --json --tmuxreturns exactly one JSON document withJSON_UNSUPPORTED_FOR_MODEand the existinginteractive-or-launchmode label before worktree creation, hooks, launcher-conflict checks, or tmux-context validation. The same rejection wins for--json --tmux --seshand blankTMUXinput. - Switch flags and defaults resolve independently from launch, but requested launch cannot be suppressed by
--no-switch. - Other explicit or configured launch resolving to
auto,sesh, orherdrlikewise returns one structured unsupported-mode error before worktree creation; resolvednonemay continue. Legacy migration warnings remain on stderr rather than contaminating JSON stdout. - JSON results include structured managed ignore details and final changed/restored state without mixing human reconciliation output into stdout.
- When the source workspace has uncommitted changes, create output includes guidance for moving compatible changes with
arashi move. In JSON mode, that guidance is returned as structured data instead of human text.
Agent Notes
Section titled “Agent Notes”- Check
arashi statusandarashi listbefore creating a branch so you do not duplicate an existing coordinated worktree. - Use
--no-launch --no-switchfor unattended agent runs unless the user explicitly wants an editor or shell session opened. - Prefer
--jsonwith explicit non-interactive flags when automation needs to verify created worktree paths. - Use
--interactivewhen a task only needs some child repositories; the parent worktree is still present, so shared metadata and coordination remain available. - Prefer
--group <group>over a long--onlylist when a known semantic group matches the task scope. - Treat managed ignore warnings as actionable workspace state; do not compensate by writing global Git configuration.