Skip to main content

Copy uncommitted local files into Claude Code worktrees automatically.

Project description

wrktreez

Copy uncommitted local files (.env, prompt files, API docs, sample JSONs, local config) into Claude Code worktrees automatically.

Why

Claude Code creates a fresh checkout for each worktree. Files you've intentionally never committed to Git (e.g. .env) don't get copied — you have to do it manually every time. wrktreez automates that.

Install

pip install wrktreez
# or
uv tool install wrktreez

Usage

cd your-project
wrktreez init              # creates wrktreez.yaml + installs the WorktreeCreate hook
wrktreez config show       # show effective config

Edit wrktreez.yaml:

copy:
  - .env
  - .env.example
  - prompts/**
  - docs/**
  # or:
  - all                    # copy every untracked + gitignored file (with safety skip-list)

When you run claude --worktree my-feature, the hook fires and copies your listed files into the new worktree.

Cleanup

wrktreez init registers two hooks in .claude/settings.json:

  • WorktreeCreate — runs git worktree add and copies your files
  • WorktreeRemove — runs git worktree remove and deletes the worktree-<name> branch

The WorktreeRemove hook fires when Claude Code explicitly removes a worktree (not on normal session exit — Claude Code keeps the worktree around so you can resume with claude --continue). To remove a stale worktree manually:

git worktree remove --force .claude/worktrees/my-feature
git branch -D worktree-my-feature

Manual sync

wrktreez sync .claude/worktrees/my-feature
# or, to preview:
wrktreez sync --dry-run --source . --dest /tmp/worktree

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wrktreez-0.1.0.tar.gz (36.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wrktreez-0.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file wrktreez-0.1.0.tar.gz.

File metadata

  • Download URL: wrktreez-0.1.0.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wrktreez-0.1.0.tar.gz
Algorithm Hash digest
SHA256 76387bcf3cbcf8e809d4e081d0e2f5025ae6fc07508f76217bcee67f1eb8ef6b
MD5 1ff1c22389de559626d2d4ac4dbf2bbb
BLAKE2b-256 83d0e0e3c858792f9546dad9ac1af7167a73693ab67a2d16dab5c94d7a3b22ae

See more details on using hashes here.

File details

Details for the file wrktreez-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wrktreez-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wrktreez-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd2f088565c74f1fd3fc23d8d139ef4e2ba4b711eddb83413da382ac231d6604
MD5 cb03b86861c15d7de7befbd10caaffa3
BLAKE2b-256 8a70d18ec3c8d387c3dd8034f9747a15adb30485492f4b8ca0663428ff89ae0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page