Skip to content

Instantly share code, notes, and snippets.

View wgilman-ft's full-sized avatar

Will wgilman-ft

View GitHub Profile
import sys, json, os, re, shlex
data = json.load(sys.stdin)
cmd = data.get("tool_input", {}).get("command", "") or ""
cwd = data.get("cwd") or os.getcwd()
if not re.search(r"\bgit\b.*\bworktree\s+add\b", cmd):
sys.exit(0)
try: