Skip to content

source-control: worktree create.md emits a bare mktemp -d POSIX path that the native Write tool resolves to a phantom drive-root tmp #3496

Description

@kyle-sexton

What happens

plugins/source-control/skills/worktree/context/create.md step 1 instructs the model to run root_dir="$(mktemp -d)"; printf '%s\n' "$root_dir" and use the printed value as the Write tool file_path for the worktree-root / data-root files, and to substitute it into the later Bash block.

On Windows, Git Bash's GNU mktemp reads only TMPDIR (unset here), so it prints the POSIX literal /tmp/tmp.XXXXXXXXXX (MSYS mounts /tmp on %TEMP%). The printed string round-trips through the model and reaches the Write tool — native node.exe — where Win32 resolves the leading / against the current drive. The file lands in a phantom <drive>:\tmp\tmp.XXXXXXXXXX at the drive root while the real mktemp directory sits in %TEMP%.

Observed

Confirmed live on 2026-08-30: an empty tmp.rSFIkHm5DO directory created at the C drive root's tmp at 14:15:56 by exactly this path, while the real content went to %TEMP%. Same silent drive-root emit class as #2834; docs/conventions/windows-path-emit/README.md owns the rule (Rules 2–4) that prevents it.

Expected

The emitted path is converted at the boundary — cygpath -m -l, mixed form, fail-loud — on Windows, and passes through unchanged on POSIX hosts, preserving the snippet's load-bearing properties (mktemp -d directory-exists/file-absent; the deliberate Write-tool round-trip for the raw ${user_config.worktree_root} substitution).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions