doordash-audit-log — Claude Code hook: what it does, how to install
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.
npx claude-code-templates@latest --hook doordash/doordash-audit-logWhat doordash-audit-log does
The hook triggers on the Bash tool using the PostToolUse event. Whenever Claude Code executes a dd-cli command, it writes a versioned JSON line to ~/.claude/dd-guard/audit.jsonl. Each entry stores the timestamp, session ID, working directory, and event type.
It categorizes actions directly from the command string into search, cart mutations, checkout URLs, or history. Extracted cart and order UUIDs are preserved. Authentication tokens are stripped from the command text before writing to the log, preventing credential leaks.
This hook operates on its own without dependencies on other DoorDash hooks. You can combine it with the /doordash-report command to generate reconciled spend summaries from the recorded audit log.
What it helps with
- log all
dd-clitool executions into an append-only JSONL file - strip authentication tokens from logged terminal commands
- track cart mutations and checkout URLs initiated by Claude Code
- gather raw audit data for
/doordash-reportspend summaries
Example prompts for the agent
- Use dd-cli to find nearby sushi restaurants
- Add two items to the DoorDash cart via dd-cli
- Generate the checkout URL using dd-cli
How to install doordash-audit-log
1claude-code-templates
npx claude-code-templates@latest --hook doordash/doordash-audit-log2Manually: 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-audit-log
How to install doordash-audit-log in Claude Code?
Run npx claude-code-templates@latest --hook doordash/doordash-audit-log, then configure the hook in .claude/settings.json.
Where does doordash-audit-log store command records?
It saves all entries to ~/.claude/dd-guard/audit.jsonl in an append-only format.
How does the hook handle DoorDash credentials?
The hook strips authorization tokens directly from the command string before saving the record to the audit file.
Source text
doordash-audit-log.json · MIT
{
"description": "Append-only audit log of every DoorDash CLI (dd-cli) invocation made through Claude Code. A PostToolUse hook records one versioned JSON line per dd-cli command (timestamp, session, cwd, command with tokens stripped, event type derived from the command itself - search / cart_mutation / checkout_url / history - plus cart/order uuids when extractable) to ~/.claude/dd-guard/audit.jsonl. Answers 'what has my AI been ordering and what did it cost' with data instead of memory. Self-contained: captures checkout and mutation events from the command text itself, no dependency on other dd-cli hooks. Pair with the /doordash-report command for reconciled spend summaries.",
"hooks": {
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/doordash-audit-log.sh"
}
]
}
]
}
}
© davila7 · MIT · davila7/claude-code-templates