doordash-allergy-checkout-gate — Claude Code hook: setup and behavior
This hook checks a DoorDash cart before checkout and blocks the command if the vetted dump is stale, missing, or matches a listed allergen. It guards against agent mistakes, not medical risk.
npx claude-code-templates@latest --hook doordash/doordash-allergy-checkout-gateWhat doordash-allergy-checkout-gate does
Before dd-cli order checkout-url runs, the hook looks for a recent dump of the vetted cart. It scans that dump again for severe allergens in the user’s dietary profile, including hidden-source mappings such as satay to peanut and aioli to egg. The check also covers checkout calls made through dd-guard.
Claude Code runs the hook on Bash tool use. A missing dump, one older than the last cart change, or an allergen match stops the command with exit code 2. Cart changes are timestamped so the hook can detect stale checks. The doordash-allergy-shield skill writes the vetted dump, so this hook needs that output to verify the cart. It is an agent-error tripwire, not medical-grade protection.
What it helps with
- block checkout when a cart dump matches an allergen
- detect a vetted dump made before the latest cart change
- scan the dump for hidden allergen sources
- stop checkout when no vetted dump is available
Example prompts for the agent
- Check the cart for allergens before I run
dd-cli order checkout-url. - I changed the cart; try
dd-cli order checkout-urland check whether the dump is still fresh. - Check this order through
dd-guardbefore checkout.
How to install doordash-allergy-checkout-gate
1claude-code-templates
npx claude-code-templates@latest --hook doordash/doordash-allergy-checkout-gate2Manually: put the files in place
.claude/settings.jsonThe hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json
Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command
Questions about doordash-allergy-checkout-gate
How do I install doordash-allergy-checkout-gate in Claude Code?
Run npx claude-code-templates@latest --hook doordash/doordash-allergy-checkout-gate, then configure .claude/settings.json.
What does doordash-allergy-checkout-gate do?
Before DoorDash checkout, it checks that a vetted cart dump is current and scans it for allergens from the dietary profile. It blocks the command with exit code 2 if the dump is missing, stale, or has a match.
Which component creates the vetted cart dump?
The doordash-allergy-shield skill writes it after vetting the cart. The hook compares the dump’s freshness with the latest cart mutation.
Source text
doordash-allergy-checkout-gate.json · MIT
{
"description": "Deterministic allergy tripwire for DoorDash CLI (dd-cli) checkouts. Before any 'dd-cli order checkout-url' (direct or via the dd-guard wrapper) it verifies that a fresh vetted-cart dump exists for that cart (written by the doordash-allergy-shield skill after vetting) and independently re-greps the dump against the anaphylaxis-severity allergens in the user's dietary profile plus their hidden-source synonyms (satay->peanut, aioli->egg, ponzu->soy/fish). Blocks with exit 2 when the dump is missing, stale (older than the last cart mutation), or contains a match. Also timestamps cart mutations so staleness is verifiable. A tripwire against agent mistakes, not medical-grade protection.",
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/doordash-allergy-checkout-gate.sh"
}
]
}
]
}
}
© davila7 · MIT · davila7/claude-code-templates