Skip to main content
hook

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.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --hook doordash/doordash-spend-guard
Open on GitHub

What 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-cli without bypassing dd-guard.sh.
  • Add items to the cart, but don’t edit limits.json directly.
  • 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-guard

2Manually: put the files in place

.claude/settings.json

The 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

Similar hooks

All hooks for Security →

From the same set804

The whole set →
change-logger This hook writes each file mutation to a CSV: timestamp, tool, path, action and details. Handy when you are prepping a demo and need to show what the agent touched. 163installs subagent-read-only-guard PreToolUse hook that restricts Claude Code subagents to read-only shell commands and blocks file modifications. 105installs edit-audit-log This hook records the path and timestamp for files changed with Edit. Use it to review file changes across Claude Code sessions. 103installs ai-bash-guard An AI agent inspects every bash command before execution, catching destructive patterns like recursive deletes outside /tmp, force pushes to protected branches, database drops, and credential leaks, then blocks them with a reason. 80installs plan-mode-game This hook opens a browser game when Claude Code enters Plan Mode and tracks tool activity. It gives you something to do while a plan takes shape. 54installs doordash-group-checkout-gate A hook that re-checks allergens at DoorDash group checkout through dd-cli and blocks payment when a dangerous match turns up. 24installs doordash-audit-log Logs every DoorDash CLI call made by Claude Code into an append-only audit file. Keeps a structured record of cart changes, searches, and agent spend. 23installs doordash-allergy-checkout-gate 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. 23installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor