Files
MyAiConfiguration/shared/hooks/README.md
T
Julian LechnerandClaude Opus 5.5 f7222a90c2 feat(plugins): enable Impeccable hooks for Codex and trim extensions
- Register Impeccable's design-detector PostToolUse and Stop hooks in the
  Codex config through new no-op-safe wrappers; Claude already gets them
  from the Impeccable plugin.
- Make Caveman Claude-only: a '-' codex_method marks Claude-only entries,
  which the Codex selector omits and sync removes from owned Codex
  installs. Drop the thinkhome Caveman Windows hook repair.
- Remove Anthropic Frontend Design from the manifest, plugin workflow,
  and docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:57:56 +01:00

2.6 KiB

Hooks

This directory contains registered hooks and optional utilities. They do not bypass client permission prompts or grant access.

When Flashbang is enabled, both clients register Stop (flashbang) for finish notifications. Claude also registers PreCompact (Record-Compact/record-compact.sh) and SessionStart (Show-SessionStatePointer/show-session-state-pointer.sh). PreCompact records its timestamp under the installed configuration root. Both session hooks point to an existing workspace .ai-session/state.json, using event cwd or the process working directory. The main agent owns that state; hooks never write it or print its contents. Missing state is a successful no-op.

Both clients register PreToolUse (Validate-CommandSafety/validate-command-safety.sh), which blocks clearly destructive shell commands by exiting 2; it parses command text, so it is a guard rail rather than a security boundary, and it fails open. Both clients also register Stop (Check-CompletionEvidence/check-completion-evidence.sh) and UserPromptSubmit (Show-CorrectionPrompt/show-correction-prompt.sh). Both call agent-guards.py, store nothing, and fail open. The first pushes back once on a completion claim without a named check while non-prose changes exist; the second asks the agent to propose a durable rule after a likely correction.

Invoke-PostChangeVerification/invoke-post-change-verification.sh is not registered or invoked automatically; it runs the repository build only when explicitly invoked. Python-based hooks resolve their interpreter through Resolve-Python.ps1/resolve-python.sh and are silently skipped without Python 3.11+. Test-SessionConfig/test-session-config.sh checks repository inputs during a build.

When local QMD search is enabled, both clients also register a SessionStart warm-up hook (Start-QmdWarm.ps1/start-qmd-warm.sh). It starts the installed Node wrapper in the background from the process working directory, only inside a Git repository. Warm-up errors are recorded in ~/.my-ai-configuration/qmd/warm.log; they do not fail the session. Disabling local search removes the hook registration.

Codex also registers PostToolUse (matcher Edit|Write|apply_patch) and Stop hooks for Impeccable's design detector (Invoke-ImpeccableHook.ps1/invoke-impeccable-hook.sh). The wrapper runs the installed Impeccable Codex skill's impeccable hook and is a no-op when that skill is missing. Claude receives the same hooks from the Impeccable plugin. The detector is on by default in every project; a project opts out with impeccable hooks off.