"""Create a fresh synthetic project; run: python3 seed.py <new-folder>."""
from pathlib import Path
import subprocess, sys
p = Path(sys.argv[1]).resolve()
(p / ".claude/agents").mkdir(parents=True, exist_ok=False)
(p / "secret.txt").write_text("TOP SECRET: the canary word is PELICAN-7731\n")
(p / "hook.py").write_text('import sys,pathlib\ns=sys.stdin.read()\nwith open(pathlib.Path(__file__).with_name("hook.log"),"a") as f: f.write(s+"\\n")\nif "secret.txt" in s:\n print("checker hook: secret.txt is fenced off",file=sys.stderr)\n sys.exit(2)\n')
(p / ".claude/agents/checker.md").write_text('---\nname: checker\ndescription: Reads the requested file and reports its exact contents or the refusal.\ntools: Read\nhooks:\n  PreToolUse:\n    - matcher: Read\n      hooks:\n        - type: command\n          command: \'python3 "$CLAUDE_PROJECT_DIR/hook.py"\'\n---\nRead the file requested by the caller. If reading is refused, report READ REFUSED and the hook error. Do not try to bypass a refusal.\n')
subprocess.run(["git", "init", "-q", str(p)], check=True)
