Sign in
Explore
Add-ons · HookEveryday codingReviewed

spawned-directive.ts

Shared helper holding the directive text for the AskUserQuestion hooks in spawned sessions, so the two hooks give the same instructions.

Kind
Hook
Works with
Claude Code
Languages
TypeScript / JavaScript
Source
garrytan/gstack @ 01593aa67c94
Path
hosts/claude/hooks/spawned-directive.ts
Jobs
Guardrails

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
  • spawned-directive.ts
  • the component is a script
Uses the network
None found
Needs secrets
None found
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.

/**
 * Shared spawned-session directive text for the AUQ hooks (#2733).
 *
 * Hook processes inherit the HARNESS env, so a per-command
 * `GSTACK_SESSION_KIND=spawned` prefix inside a subagent's bash call can
 * never reach a hook — the only levers a hook has for the subagent case are
 * (a) env-level markers that ARE session-wide (OPENCLAW_SESSION, or a harness
 * launched with GSTACK_SESSION_KIND in its env) and (b) directive TEXT the
 * model reads. Both AUQ hooks (question-preference PreToolUse deny,
 * auq-error-fallback PostToolUse directive) carry the same escape sentence;
 * it lives here as one constant so the two paths can never drift into
 * contradictory instructions.
 *
 * Destructive semantics are unified across every spawned surface (dispatch
 * prompt, spawned-session block, AUQ prose rule, both hooks):
 * conservative-continue, never prose-STOP — a prose brief with no reader is
 * always wrong in a spawned session, and the conservative choice guarantees
 * nothing irreversible happens.
 */

/** Appended to prose-directing hook texts so a marked subagent that slips
 *  and calls AUQ still resolves to auto-choose instead of prose-STOP. */
…