/configure-plugin:configure-worktreeinclude [--check-only] [--fix]from configure-plugin
Generates a .worktreeinclude file so Claude Code copies gitignored env/secret/config files into new git worktrees. Use when worktrees miss .env or local config.
Ships in configure-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate a .worktreeinclude file whose patterns tell Claude Code which
gitignored files to copy from the main checkout into a newly-created git
worktree. A worktree is a fresh checkout containing only git-tracked files, so
gitignored runtime inputs — .env, local secrets, local config — do not come
along by default; this skill builds the include list from the gitignored files
actually present in this repo, so the patterns match the project instead of
a generic template.
| Use this skill when... | Use another approach when... |
|---|---|
Worktrees / subagent worktrees start without .env or local config | Ignoring a build artifact — use /configure:gitignore |
Onboarding a repo to Claude Code (also reachable via /configure:repo) | Copying large regenerable dirs (node_modules/) — let the worktree's setup hook reinstall them |
| You want gitignored inputs reproduced per-worktree without committing them | A WorktreeCreate hook is configured (any VCS) — the hook replaces git creation, so .worktreeinclude is not processed; copy files in the hook script |
.worktreeinclude is.worktreeinclude lives at the repo root, alongside .gitignore, and uses
.gitignore glob syntax. When Claude Code creates a worktree (the
--worktree flag, subagent worktree isolation, or parallel desktop sessions),
every file that matches a pattern and is gitignored is copied into the new
worktree. The match is constrained two ways by design:
node_modules/, .venv/, build output) are better
rebuilt by the worktree's setup than copied — copying is slow and can carry
platform-specific binaries or absolute paths.Commit .worktreeinclude so the whole team (and every agent worktree) shares
the same include list.
Which creation paths apply it (and which skip it), how **/ patterns behave under wholly-ignored directories (2.1.239+), and what to leave out of the list: references/scope-and-caveats.md.
find . -maxdepth 1 -name .worktreeinclude -type ffind . -maxdepth 1 -name .gitignore -type fgit status --ignored --porcelain=v1| Parameter | Description |
|---|---|
--check-only | Report the proposed include patterns without writing any file |
--fix | Write the proposed patterns without prompting (headless) |
Default (no flag): propose the patterns, confirm the set with the user via
AskUserQuestion, write .worktreeinclude, and git add it (staged, not
committed).
Execute this .worktreeinclude configuration workflow:
Parse $ARGUMENTS for --check-only / --fix. From Context, note whether
.worktreeinclude already exists (Read it and record its current patterns if
so) and capture the ignored-entry list. If no .gitignore exists and no ignored
entries are present, report "nothing gitignored to include" and stop.
The ignored list comes from git status --ignored --porcelain=v1 — lines
prefixed !! are ignored paths, with directories collapsed to a single trailing
/ entry. Sort each entry into one of two buckets:
| Propose to include (small per-environment inputs) | Skip (regenerable / large / risky) |
|---|---|
.env, .env.local, .env.* (not a tracked .env.example) | node_modules/, .venv/, venv/, .direnv/ |
*.local config (config.local.*, settings.local.*) | dist/, build/, out/, target/, .next/, .nuxt/ |
local secrets / credentials present as files (secrets.*, gitignored *.pem/*.key) | __pycache__/, .pytest_cache/, .ruff_cache/, .mypy_cache/ |
gitignored tool config the build needs (.npmrc, .tool-versions) when present | coverage/, .coverage, *.log, .DS_Store, .git/ |
Only propose patterns for entries that actually appear in the ignored list — the include list must describe this repo. When in doubt about a file (it could be a needed input or just local cruft), surface it as a candidate rather than deciding silently.
--check-only: print the proposed patterns as a diff-style block; write nothing.--fix: skip confirmation; use the proposed include set as-is.AskUserQuestion, letting the
user drop any pattern or add one you skipped (the built-in "Other" option
covers additions). Keep the question self-contained — list each proposed
pattern and the file(s) it matches.Write the confirmed patterns to .worktreeinclude at the repo root, one pattern
per line, with a short header comment. If the file already exists, merge
additively — preserve existing lines verbatim and append only patterns not
already present (idempotent, safe to re-run). Then git add .worktreeinclude.
Confirm each written pattern targets a gitignored file (so it will actually be
copied): git check-ignore -v <path> should report a match for a representative
file behind each pattern. A pattern that matches no gitignored file is inert —
flag it so the user knows it does nothing. git check-ignore alone does not
catch the **/ case (references/scope-and-caveats.md): when the representative file lives under a
wholly-ignored directory (its !! entry is the collapsed dir/), check the
pattern names that directory or its first post-**/ segment is in the path,
and otherwise rewrite it as dir/**/<rest>.
Print a summary: patterns added vs already-present, the file path, and the
git diff --cached hint. If --check-only, prefix with "DRY RUN — no files
modified".
.worktreeinclude lines;
append missing patterns so the skill is idempotent.git check-ignore in Step 5 catches inert patterns.WorktreeCreate hook,
.worktreeinclude is never read — say so in the report and point the user at
the hook script instead.node_modules/, virtualenvs,
and build output out of the include list; let the worktree's setup hook
regenerate them..worktreeinclude is shared configuration — stage it and
let the user commit so every worktree (and teammate) uses the same list.git diff --cached.| Context | Command |
|---|---|
| Propose + write the include list | /configure:worktreeinclude |
| Dry-run, no file changes | /configure:worktreeinclude --check-only |
| Write headless (no prompt) | /configure:worktreeinclude --fix |
| List gitignored entries (collapsed) | git status --ignored --porcelain=v1 |
| Confirm a pattern matches a gitignored file | git check-ignore -v .env |
| Review staged change | git diff --cached |
/configure:gitignore — the sibling skill that keeps Claude Code runtime
state (incl. .claude/worktrees/) out of commits/configure:repo — full repo onboarding (offers this skill)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub laurigates/claude-plugins --plugin configure-plugin49 skills in this plugin
/ci-workflowsReference YAML for the canonical container-build, test, release-please and auto-fix workflow files. Use when another skill or a review needs the standard shape to cite or diff against./claude-security-settingsClaude Code security settings: permission wildcards, shell operator protections, project-level allowlists. Use when auditing or hardening .claude/settings.json permissions./config-syncConfig sync across FVH repos: extract, diff, propagate tooling improvements. Use when syncing workflows or configs across multiple repos./configure-allRun all infrastructure standards checks and fixes. Use when onboarding a new project, doing a full compliance audit, or batch-fixing with --fix./configure-api-testsAPI contract testing: Pact, OpenAPI validation, JSON Schema/Zod. Use when adding consumer/provider contract tests or detecting breaking API changes in CI./configure-argocd-automergeargocd-automerge.yml: auto-create and merge PRs from ArgoCD Image Updater's image-updater-** branches. Use when setting up that workflow or checking its PAT permissions.Other plugins' skills for the same job