Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

configure-worktreeinclude

БесплатноБез исполняемых скриптовНе проверен

Generate a .worktreeinclude so Claude Code copies gitignored env/secret/config files into new worktrees. Use when worktrees miss .env or local config.

laurigatesот laurigates★ 61 звезда на GitHub

Об этом скилле

/configure:worktreeinclude

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.

When to Use This Skill

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

What .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:

  • Only gitignored files are copied. A pattern that matches a tracked file is a no-op — tracked files are already in the worktree, never duplicated.
  • You choose the inputs, not the bulk. The right entries are small per-environment inputs (env files, local secrets, local config). Large regenerable trees (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.

Context

  • Existing worktreeinclude: !find . -maxdepth 1 -name .worktreeinclude -type f
  • Gitignore present: !find . -maxdepth 1 -name .gitignore -type f
  • Ignored entries present (collapsed): !git status --ignored --porcelain=v1

Parameters

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).

Execution

Execute this .worktreeinclude configuration workflow:

Step 1: Read existing state

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.

Step 2: Classify the gitignored entries

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.

Step 3: Confirm the set

  • --check-only: print the proposed patterns as a diff-style block; write nothing.
  • --fix: skip confirmation; use the proposed include set as-is.
  • Default: present the proposed patterns with AskUserQuestion, letting the user drop any pattern or add one you skip
Полный SKILL.md на GitHub

Установить configure-worktreeinclude в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Glob
Grep
Read
Write
Edit
Bash(git add *)
Bash(git status *)
Bash(git check-ignore *)
Bash(git ls-files *)
Bash(find *)
AskUserQuestion
TodoWrite

Вложенные файлы

references/scope-and-caveats.md

FAQ

Что делает скилл configure-worktreeinclude?

Generate a .worktreeinclude so Claude Code copies gitignored env/secret/config files into new worktrees. Use when worktrees miss .env or local config.

Как установить скилл configure-worktreeinclude?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл configure-worktreeinclude запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить configure-worktreeinclude с