auq-error-fallback-hook.ts
PostToolUse hook for AskUserQuestion. When that call fails, it reminds the model of the fallback rule for the session kind.
- Kind
- Hook
- Works with
- Claude Code
- Languages
- TypeScript / JavaScript
- Source
- garrytan/gstack @ 01593aa67c94
- Path
- hosts/claude/hooks/auq-error-fallback-hook.ts
- Jobs
- Guardrails
- Topics
- Debugging
Credit
- Made by
- garrytan
- Original
- github.com/garrytan/gstack/blob/01593aa67c94780528e8f5121e473…
- License
- MIT
Listed by Skill Manifest; not made by us.
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
- Adds
- Entries under `hooks` in .claude/settings.json
- Runs scripts
- Yes
- auq-error-fallback-hook.ts
- the component is a script
- Uses the network
- None found
- Needs secrets
- None found
- Reads environment variables
- GSTACK_STATE_ROOT
- GSTACK_HOME
- Reads outside the project
- /usr/bin/env (auq-error-fallback-hook.ts)
- ~/.claude/settings.json (auq-error-fallback-hook.ts)
- ~/.gstack/hook-errors.log (auq-error-fallback-hook.ts)
- Calls other skills
- /tool
- /ship
- Source revision
- 01593aa67c94
- Licence
- MIT
- Last activity
- 27 Nov 2026
- Source changed after the scan
- Yes
- Last push 27 Nov 2026, scanned 3 Nov 2026; read it again before you rely on this scan
- Review
- Reviewed
Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.
#!/usr/bin/env bun /** * PostToolUse hook for AskUserQuestion — runtime reliability layer for the * AUQ-failure prose fallback (OV3:B). * * When an AskUserQuestion call comes back as an ERROR / missing result (the * Conductor MCP bug returns `[Tool result missing due to internal error]`), this * hook injects `additionalContext` reminding the model of the failure-fallback * rule, tailored to the session kind. It does NOT render the prose itself — the * model still emits it. The hook only guarantees the reminder fires at the moment * of failure, instead of relying on the model noticing the error result and * recalling the echoed SESSION_KIND. * * DEFENSIVE / INERT-IF-UNSUPPORTED: it is unverified whether Claude Code invokes * PostToolUse hooks when an MCP tool returns a transport/missing-result error (we * could not force that Conductor-internal failure in a harness — see * docs/spikes/claude-code-hook-mutation.md §"PostToolUse on tool error"). If the * platform does NOT fire the hook on that path, this is simply never invoked — no * harm; the prompt-level fallback in generate-ask-user-format.ts still covers it. …