doordash-spend-guard — Claude Code hook for spending control
Blocks DoorDash CLI checkout and cart commands that bypass dd-guard.sh, and prevents command-line edits to limits.json.
npx claude-code-templates@latest --hook doordash/doordash-spend-guardWhat doordash-spend-guard does
Before a Bash tool call, the hook runs .claude/hooks/doordash-spend-guard.sh to inspect the command. It blocks direct dd-cli order checkout-url and dd-cli cart add-items calls when they skip the dd-guard.sh wrapper. It also denies command-line writes to limits.json.
Change spending limits only through the interactive /doordash-budget command. The hook is configured in .claude/settings.json. It does not replace the dd-guard.sh wrapper’s budget check.
What it helps with
- block checkout commands that bypass
dd-guard.sh - prevent direct DoorDash CLI cart additions
- deny command-line edits to
limits.json - restrict budget changes to
/doordash-budget
Example prompts for the agent
- Place a DoorDash order through
dd-cliwithout bypassingdd-guard.sh. - Add items to the cart, but don’t edit
limits.jsondirectly. - Change the spending limit with
/doordash-budget.
How to install doordash-spend-guard
1claude-code-templates
npx claude-code-templates@latest --hook doordash/doordash-spend-guard2Manually: 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-spend-guard
How do I install doordash-spend-guard in Claude Code?
Run npx claude-code-templates@latest --hook doordash/doordash-spend-guard. The hook configuration is in .claude/settings.json.
What does doordash-spend-guard do?
Before Bash calls, it runs a check that blocks DoorDash CLI checkout and cart commands when they bypass dd-guard.sh. It also blocks command-line writes to limits.json.
How should I change spending limits?
Use the interactive /doordash-budget command. Command-line writes to limits.json are denied.
Source text
doordash-spend-guard.json · MIT
{
"description": "Enforce the dd-guard spending gate for DoorDash CLI (dd-cli). Denies raw 'dd-cli order checkout-url' and 'dd-cli cart add-items' Bash calls that bypass the dd-guard.sh wrapper (installed by the doordash-spend-guard skill), and denies command-line writes to the policy file limits.json, which must only change through the interactive /doordash-budget command. Deterministic budget enforcement for agent-driven food ordering: a budget in a prompt is advisory, an exit-2 hook is not.",
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/doordash-spend-guard.sh"
}
]
}
]
}
}
© davila7 · MIT · davila7/claude-code-templates