receipt

receipt is a command for coding agents from peerjakobsen/smartspender. It costs 18 tokens per session (1,969 once invoked), scanned A, original, MIT.

A command for processing receipt images and PDF invoices, extracting their line items, and matching them to bank transactions.

In plain words
What is it for?
It helps upload a receipt, identify its vendor, extract purchase details, and match the result against previously synced transactions.
Why use it?
It reduces manual entry when recording purchases and checking which bank transaction belongs to a receipt.

Command

Part of the smartspender plugin — 13 skills, 19 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/peerjakobsen/smartspender/receipt
Clone the repo
git clone --depth 1 https://github.com/peerjakobsen/smartspender

Or install smartspender, the plugin that ships this one along with the rest of its 13 skills, 19 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for receipt

README.md
[![agentmods](https://agentmods.dev/badge/commands/peerjakobsen/smartspender/receipt.svg)](https://agentmods.dev/commands/peerjakobsen/smartspender/receipt)
Your own site
<a href="https://agentmods.dev/commands/peerjakobsen/smartspender/receipt"><img src="https://agentmods.dev/badge/commands/peerjakobsen/smartspender/receipt.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,969 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00018 $0.01969
Opus 5 $0.00009 $0.00984
Sonnet 5 $0.00004 $0.00394
Haiku 4.5 $0.00002 $0.00197

Measured 4d ago against content hash 32894bd171d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

receipt scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/receipt.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/smartspender:receipt

Trigger

  • /smartspender:receipt upload
  • "Upload en kvittering"
  • "Registrer denne kvittering"
  • "Tilfoej kvittering"

Arguments

Argument Required Values Default
action yes upload -

Prerequisites

  • At least one bank sync completed (transactions.csv exists with data) for matching to work
  • User has a receipt image or PDF invoice ready to share

Workflow

  1. Prompt the user to share their receipt: "Del venligst kvitteringen — du kan indsaette et billede eller traekke en PDF ind i chatten."
  2. [USER ACTION]: User attaches a receipt image or PDF invoice
  3. If no file is attached, respond: "Jeg kan ikke se nogen kvittering. Indsaet venligst et billede eller en PDF."
  4. Load extraction rules: skills/document-parsing/SKILL.md
  5. Load vendor detection workflow from skills/document-parsing/SKILL.md
  6. Detect vendor from the uploaded file (filename, header/logo, content keywords) per the invoice-parsing skill's vendor detection workflow
  7. If vendor detected: check for invoice-knowledge/{vendor-id}/PARSER.md
    • If parser exists: load vendor-specific extraction rules and use them for steps 8-11
    • If no parser: continue with general extraction rules from receipt-parsing skill
  8. Extract receipt metadata using Claude Vision:
    • Merchant name (normalize per skills/categorization/SKILL.md)
    • Date (convert to YYYY-MM-DD)
    • Total amount (convert to standard decimal format)
    • Currency (default DKK)
  9. Present extraction summary to user for confirmation:
    Jeg aflæste følgende fra kvitteringen:
    
    Butik: {merchant}
    Dato: {date, Danish format}
    Total: {total} kr
    
    Er det korrekt? (Eller ret de felter der er forkerte)
    
  10. [USER ACTION]: User confirms or provides corrections
  11. Apply any corrections from the user
  12. Extract line items from the receipt:
    • Item name, quantity, unit price, total price
    • Assign category and subcategory per skills/document-parsing/SKILL.md product taxonomy (or vendor-specific PARSER.md if loaded in step 7)
    • Handle discounts (RABAT lines)
  13. Validate line item sum against receipt total (per variance rules in document-parsing skill)
  14. Load schema: skills/data-schemas/SKILL.md
  15. Check for duplicate receipts in receipts.csv (same date + merchant + total_amount). If duplicate found, ask: "Denne kvittering ligner en der allerede er registreret ({receipt_id} fra {date}). Vil du tilfoeje den alligevel?"
  16. [USER ACTION] (only if duplicate): User confirms or cancels
  17. If user cancels on duplicate, stop and output: "Kvitteringen blev ikke tilfojet."
  18. Load matching rules: skills/transaction-matching/SKILL.md
  19. Search transactions.csv for matching transactions (amount +-1%, date +-1 day)
  20. Score candidates per transaction-matching confidence rules
  21. If exactly 1 match with confidence >= 0.8: auto-link to the transaction
  22. If multiple candidates or confidence < 0.8: present candidates to user:
    Jeg fandt {n} mulige transaktioner til denne kvittering:
    
    1. {date} — {description} — {amount} kr (match: {confidence_pct}%)
    2. {date} — {description} — {amount} kr (match: {confidence_pct}%)
    
    Hvilken transaktion hører kvitteringen til? (Eller "ingen" hvis ingen passer)
    
  23. [USER ACTION] (only if ambiguous): User picks a candidate or says "ingen"
  24. If no candidates found: store as unmatched
  25. Generate receipt_id (rcpt- + 8 hex chars) and item_ids (ritm- + 8 hex chars per item)
  26. Create the receipts/ directory if it does not exist
  27. Save the uploaded file to receipts/{receipt_id}.{ext} (preserve original extension). Set file_reference to this path.
  28. If receipts.csv does not exist, create it with the header row
  29. Append receipt row to receipts.csv
  30. Determine the monthly file from the receipt date: receipt-items-{YYYY-MM}.csv (e.g., receipt date 2026-01-28 → receipt-items-2026-01.csv)
  31. If the monthly file does not exist, create it with the header row
  32. Append all item rows to receipt-items-{YYYY-MM}.csv
  33. Append event to action-log.csv:
    • action_type: receipt
    • target: {merchant}
    • status: completed
    • details: "{item_count} items, {match_status} to {transaction_description or 'no transaction'}"
  34. Output summary in Danish
  35. If the receipt was a PDF invoice without a vendor-specific parser and the user made corrections, suggest: "Tip: Koer /smartspender:receipt learn for at gemme udtraeksregler for {vendor}."

Read the full file on GitHub · 166 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 166 lines · 18 tokens per session scan A 32894bd171d8

Subscribe to this mod's changes

receipt is a command published in the GitHub repository peerjakobsen/smartspender (5 stars, last pushed 7mo ago), licensed MIT. It adds 18 tokens to every session and 1,969 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.