]> git.ekhem.eu.org Git - guix.git/commit
[ai] Replace guard-commands with block-builds, block-worktrees, and create-worktree...
authorJakub Czajka <jakub@ekhem.eu.org>
Mon, 6 Jul 2026 10:23:44 +0000 (12:23 +0200)
committerJakub Czajka <jakub@ekhem.eu.org>
Tue, 7 Jul 2026 21:37:07 +0000 (23:37 +0200)
commitf8a4bd066159775772bad4a3d27d24c35def797e
treed92266d7f82e549130594713b387c5232b233821
parentbd309d49e31546a25e6fcfea469f6d8a5005e110
[ai] Replace guard-commands with block-builds, block-worktrees, and create-worktree hooks.

Splits the monolithic guard-commands hook into three single-purpose
hooks with more granular matchers in settings.json.

block-builds:
  Guards guix and make build/reconfigure commands. Asks on main,
  denies in worktrees for destructive operations (reconfigure,
  home-*, system-*).

block-worktrees:
  Denies git checkout/switch outright. Enforces EnterWorktree
  (must not already be in a worktree) and ExitWorktree (must not
  have unpushed commits diverging from main). Sends a desktop
  notification on EnterWorktree success.

create-worktree:
  Uses a universal matcher ("*") to deny all tool calls on main
  unless already inside the session's worktree. Allows
  EnterWorktree through to let the user enter an isolated session.
.claude/hooks/block-builds [new file with mode: 0755]
.claude/hooks/block-worktrees [new file with mode: 0755]
.claude/hooks/create-worktree [new file with mode: 0755]
.claude/hooks/guard-commands [deleted file]
.claude/settings.json
README