Repository navigation
Faster hooks on every agent tool call, and two recording fixes for the user-level Stop gate (H6, H7).
- Faster:
slopbrake-hookimports only what the common path needs;subprocess,tempfile,shutil,hashlibandargparseload only where git, the Stop gate or the installer use them. Median wall time per call on a busy 12-core host, Python 3.13: a Bash call outside managed repos 48 → 35 ms, an Edit outside 44 → 32 ms, an untouched Stop 44 → 31 ms. Peak RSS 18.7 → 14.8 MB. - Faster: a snapshot of a managed repo is one
git status --porcelain=v2 --branchinstead ofrev-parseplusstatus, and stats each path relative to the repo's directory. PreToolUse in a managed repo 67 → 56 ms; on a repo with 30,000 untracked files a snapshot takes 2.7x less time (546 → 202 ms; the status parser is now linear). - Faster: an Edit in a managed repo reads HEAD only the first time the session changes that repo, with
rev-parse, never a fullgit status: 64 → 32 ms per Edit. - Faster: the project guard (
.claude/hooks/block-dangerous-git.sh) importsgit_guard.pyinstead of running it as a script, so Python reuses its bytecode instead of compiling 900 lines per Bash call, and parses its one option by hand (argparse alone pulled in a dozen modules on Python 3.14): 67 → 31 ms per call with Python 3.14, 17.9 → 12.9 MB. The bytecode lives under${XDG_CACHE_HOME:-~/.cache}/slopbrake/pycache, never in the repo, and the guard runs withpython3 -I, so the session's cwd andPYTHON*variables stay out of its imports. It reads the hook JSON as UTF-8 whatever the locale. - Fixed: an edit made through a symlinked directory was recorded as
../link/...instead of the repo's own path, so the user-level Stop gate skipped a repo whose only change came that way. Edit andapply_patchtargets are now resolved like the repo itself. - Fixed: a worktree rename (
git add -Non the new name) made the snapshot record a garbage path (porcelain v1 puts theRin the second column); the v2 parser reads renames by entry type. slopbrake verifyand Slopbrake's own gate keep the guard's bytecode in their scratch directories.
Full Changelog: v0.2.2...v0.2.3