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.
npx agentmods add commands/peerjakobsen/smartspender/receipt-learngit clone --depth 1 https://github.com/peerjakobsen/smartspenderWrote 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.
[](https://agentmods.dev/commands/peerjakobsen/smartspender/receipt-learn)<a href="https://agentmods.dev/commands/peerjakobsen/smartspender/receipt-learn"><img src="https://agentmods.dev/badge/commands/peerjakobsen/smartspender/receipt-learn.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00012 | $0.01215 |
| Opus 5 | $0.00006 | $0.00607 |
| Sonnet 5 | $0.00002 | $0.00243 |
| Haiku 4.5 | $0.00001 | $0.00121 |
Grade A, and why
receipt-learn 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.
How it starts
The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/smartspender:receipt learn
Trigger
/smartspender:receipt learn- "Gem udtraeksregler"
- "Laer denne faktura"
Arguments
| Argument | Required | Values | Default |
|---|---|---|---|
| action | yes | learn | - |
Prerequisites
- A receipt or invoice has been processed in the current conversation
- User has verified and/or corrected the extraction results
- The processed receipt was a PDF invoice (not a grocery receipt or card slip)
Workflow
- Check if the current conversation contains a receipt/invoice processing session with extraction results. If not, respond: "Jeg kan ikke finde en behandlet faktura i denne samtale. Behandl venligst en faktura med /smartspender:receipt upload foerst."
- Identify the vendor from the conversation context:
- Use the extracted merchant name from the receipt processing
- Normalize to vendor-id (lowercase, no spaces, no A/S suffix)
- Analyze the conversation for corrections the user made:
- Changed merchant name
- Changed date or billing period
- Changed total amount
- Changed line item names, categories, or subcategories
- Added missing line items
- Removed incorrect line items
- Changed extraction approach (e.g., "the total is on page 2, not page 1")
- Summarize the learned rules and present to user for confirmation:
Jeg har identificeret foelgende regler for {Vendor Name} fakturaer: Leverandoer: {vendor name} (ID: {vendor-id}) Fakturetype: {type, e.g., Telecom, Forsyning} Udtraeksregler: - {rule 1, e.g., "Fakturadato findes efter 'Dato:' paa side 1"} - {rule 2, e.g., "Total findes efter 'I alt inkl. moms'"} - {rule 3, e.g., "Linjer kategoriseres som Abonnementer > Mobilabonnement"} Rettelser fra denne session: - {correction 1, e.g., "'Ekstra data' skal vaere Mobilabonnement, ikke Internet"} Skal jeg gemme disse regler? (ja/nej) - [USER ACTION]: User confirms or provides additional corrections
- If user says no: respond "Reglerne blev ikke gemt." and stop.
- Check if
invoice-knowledge/{vendor-id}/PARSER.mdalready exists:- EXISTS: Update the existing file:
- Add new entries to the Learned Corrections table with today's date
- Update extraction rules if the user's corrections change the approach
- Update Last Updated date
- DOES NOT EXIST: Create a new parser:
- Create directory
invoice-knowledge/{vendor-id}/ - Copy structure from
invoice-knowledge/_template.md - Fill in Vendor Info from conversation context
- Fill in Extraction Rules from the processed invoice structure
- Fill in Line Items from the extracted (and corrected) items
- Add any corrections to the Learned Corrections table
- Set Last Updated to today
- Create directory
- EXISTS: Update the existing file:
- Write the file to
invoice-knowledge/{vendor-id}/PARSER.md - Output confirmation:
Regler for {Vendor Name} er gemt i invoice-knowledge/{vendor-id}/PARSER.md. {If new}: Ny leverandoer-parser oprettet med {n} udtraeksregler. {If updated}: Eksisterende parser opdateret med {n} nye rettelser. Naeste gang du behandler en faktura fra {Vendor Name}, vil disse regler automatisk blive brugt til mere praecis udtraekning.
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.
- 4d ago First seen · 119 lines · 12 tokens per session scan A dac97f75d5f3
receipt-learn is a command published in the GitHub repository peerjakobsen/smartspender (5 stars, last pushed 7mo ago), licensed MIT. It adds 12 tokens to every session and 1,215 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.
Other commands, from other repositories
octo-usage
Your first output line MUST be: 🐙 Octopus Usage Report.
research
Professional equity research analysis with institutional-grade formatting.
better-auth:add-plugin
Add a better-auth plugin to an existing project. Configures server and client plugins with proper imports.
better-auth:setup
Interactive setup wizard for better-auth authentication. Guides through database, framework, OAuth providers, and plugin configuration.
cloudflare-r2:presigned-url
Generate presigned URLs for secure client-side uploads or downloads.
bun:migrate
Migrate existing Node.js/npm projects to Bun.