Metadata-Version: 2.4
Name: wrktreez
Version: 0.1.0
Summary: Copy uncommitted local files into Claude Code worktrees automatically.
Project-URL: Source, https://github.com/Sathya4683/wrktreez
Project-URL: Issues, https://github.com/Sathya4683/wrktreez/issues
Author: Sathya Narayanan
License: MIT
License-File: LICENSE
Keywords: claude-code,cli,git,productivity,worktree
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: pyyaml<7.0,>=6.0
Description-Content-Type: text/markdown

# 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

```bash
pip install wrktreez
# or
uv tool install wrktreez
```

## Usage

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

Edit `wrktreez.yaml`:

```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:

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

## Manual sync

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

## License

MIT
