Skip to main content

Module include

Module include 

Source
Expand description

[worktree] include and .worktreeinclude (Claude Code’s file, .gitignore syntax): git-ignored files of the person’s checkout — a .env, a local config — copied into each worktree speccoder runs checks in, to the same relative path.

Only files git ignores in the checkout are copied, never a tracked one; regular files only, never through a symlink out of the checkout, never over a file the worktree tracks, and only inside the worktree. A copied secret file’s values are masked in everything speccoder shows or hands on (crate::secrets), a commit never holds a copied file, and an attempt whose diff adds one of those values is refused.

Structs§

Copied
What copying did.
Record
What a worktree holds copied from the checkout.

Constants§

FILE
Claude Code’s file of patterns, read beside [worktree] include.

Functions§

added_secret
The variable whose copied value a patch’s added lines hold.
check_staged
Refuses a commit in the worktree at top whose index holds a file copied from the checkout (unstaged then) or whose staged change adds a copied secret value. Nothing is committed then.
copy
Copies the files matched names from checkout (the project’s directory there) to the same paths under project (its directory in the worktree worktree): new ones, and again those whose content changed. Registers each copied secret file’s values for masking.
forget
Forgets a worktree’s record of copies (before the worktree is removed).
load
The worktree’s record of copies (none: nothing copied).
matched
The files the patterns name in the checkout’s project directory that git ignores there, project-relative: [worktree] include’s patterns and .worktreeinclude’s, together. Regular files only, inside the checkout.
pathspecs
The pathspecs keeping each copied file out of what git add stages in the worktree at top, whatever the ignore rules say: one for each that git does not ignore there now (an attempt can un-ignore one). An ignored one needs none — and naming it would make git add fail.
record_path
Where a worktree’s record of copies is kept: beside it, never inside.
register
Masks the worktree’s copied values from now on (values).
values
What the worktree’s copied secret files (.env* and the rest the model may not read) give to mask, as (NAME, value), read from the copies (crate::secrets::to_mask).