import json, pathlib, subprocess, sys
root = pathlib.Path(sys.argv[1])
root.mkdir(parents=True, exist_ok=True)
def git(*args):
    subprocess.run(['git', '-C', str(root), *args], check=True, capture_output=True)
git('init', '-q', '--initial-branch=main')
(root / 'README.md').write_text('Synthetic Unicode worktree proof.\n')
git('add', '.')
for message in ['Initial commit', 'Second commit']:
    git('-c', 'user.name=Proof', '-c', 'user.email=proof@example.invalid', 'commit', '-q', '--allow-empty', '-m', message)
for name in ['feature\u2028tools', 'control']:
    git('worktree', 'add', '--detach', '.claude/worktrees/' + name)
(root / '.claude/settings.local.json').write_text(json.dumps({'env': {'CLAUDE_CODE_AUTO_COMPACT_WINDOW': '200000'}}))
print('Created two-commit repository, U+2028 worktree, ordinary control, and main-checkout auto-compact settings.')
