CommunityResearch & Data Analysisgithub.com

receipts

Receipts for every number an AI agent uses: grounding, citations and provenance that stop agents from making up figures. Input and output validation for any value that feeds money, a quote, a report, a dashboard or something sent to a customer: every such value carries where it came from (the record, the spot inside it, when it was read), a screenshot of that spot, and the check it passed. Use when building, changing or auditing a dashboard, report, quote, data pipeline or agent that shows or sends figures; and when someone asks "where did that number come from", "show me the source", "cite it", "screenshot the source", "input output validation", "I don't trust this number", "show me the receipts", or "stop it hallucinating numbers". Not for ordinary coding or source code. Ships spot.py (screenshot of a PDF spot, spreadsheet cell or web page's words, plus its source record), check_sources.py, status.py, a local dashboard and a privacy check.

What is receipts?

receipts is a Claude Code agent skill that receipts for every number an AI agent uses: grounding, citations and provenance that stop agents from making up figures. Input and output validation for any value that feeds money, a quote, a report, a dashboard or something sent to a customer: every such value carries where it came from (the record, the spot inside it, when it was read), a screenshot of that spot, and the check it passed. Use when building, changing or auditing a dashboard, report, quote, data pipeline or agent that shows or sends figures; and when someone asks "where did that number come from", "show me the source", "cite it", "screenshot the source", "input output validation", "I don't trust this number", "show me the receipts", or "stop it hallucinating numbers". Not for ordinary coding or source code. Ships spot.py (screenshot of a PDF spot, spreadsheet cell or web page's words, plus its source record), check_sources.py, status.py, a local dashboard and a privacy check.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/andrewscimeca/agent-receipts/tree/HEAD

Installed? Explore more Research & Data Analysis skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation


name: receipts description: Receipts for every number an AI agent uses: grounding, citations and provenance that stop agents from making up figures. Input and output validation for any value that feeds money, a quote, a report, a dashboard or something sent to a customer: every such value carries where it came from (the record, the spot inside it, when it was read), a screenshot of that spot, and the check it passed. Use when building, changing or auditing a dashboard, report, quote, data pipeline or agent that shows or sends figures; and when someone asks "where did that number come from", "show me the source", "cite it", "screenshot the source", "input output validation", "I don't trust this number", "show me the receipts", or "stop it hallucinating numbers". Not for ordinary coding or source code. Ships spot.py (screenshot of a PDF spot, spreadsheet cell or web page's words, plus its source record), check_sources.py, status.py, a local dashboard and a privacy check.

What does receipts do?

Receipts for every number an AI agent uses. It is grounding, citations and provenance for agents: the agent cannot use a figure it cannot trace to a real record, and every figure comes with a screenshot of the spot it came from.

The rule: a value that someone will act on (a price, a total, a date, a status, a fact in a report or a send) is not shown, used, priced or sent unless you can point at the record it came from, show a picture of that exact spot (or, for a database row or an API answer, the saved raw answer), and show the check it passed. If you cannot, it is not shown. It is never guessed.

This skill is the framework that governs that rule. It has four parts: what a source is (section 2), what goes in, which is input validation (section 3), what comes out, which is output validation (section 4), and how it is shown (section 5). Section 6 lists the tools. Sections 7 to 10 are how to use it: building, auditing, reporting in chat, briefing helpers.

<skill-dir> below is the folder holding this file.

0. Say it before anyone asks

Nobody should have to ask an agent "what are you doing", "what will happen", or "why is it right". At the start of any job with more than a few steps, at each milestone, and before anything that sends, deletes, spends, or changes shared data or anything outside the working copy, run (not before every file edit):

python3 <skill-dir>/scripts/status.py --doing "..." --will "..." --why "..."

and say the same three lines in chat.

  • Doing: what I am doing right now, in plain words.
  • Will happen: what changes, what gets touched, what is left alone, and when it ends.
  • Why it's right: the source or the check that proves it, naming a file that exists (a :line suffix is fine) or a web link. status.py refuses a "why" with nothing that can be opened.

A helper adds --who "<its task>" so its lines are told apart from the main agent's. status.py appends to ~/.local/state/receipts/status/<session>.jsonl (the session is $CLAUDE_CODE_SESSION_ID, or --session). A monitor reads the latest line and shows it on the agent's card. A monitor can also list, from the agent's saved transcript alone, every file it read, every file it changed, every command and helper it ran, and every source picture it took. That list comes from the tool calls themselves, so it costs no model tokens and is not the agent's own summary.

1. Terms (each defined once)

TermMeaning
ValueAny number, price, date, name, status, count, yes/no or fact that a person sees or that feeds a calculation, a price, a design or a send.
SourceThe original record the value was read from: the file, the page of the document, the spreadsheet cell, the database row, the program's own output, the provider's own record, a person's own written or recorded words.
Source recordThe small record stored with the value that says where it came from (fields in 2.2).
PictureA screenshot of the source at the exact spot, taken when it was read, with the spot outlined.
FingerprintA SHA-256 hash of the source file (or the saved page) as it was read. If it changes, the source changed.
Past caseA saved earlier result of the same kind (a past job, invoice, design or report), used to check a new one against.
HelperA subagent the main agent starts. App calls are MCP tool calls; a chat is a session.
Input checkA test a value must pass before anything uses it.
Output checkA test of a result against something that did not make it.
RulingA person's decision that overrides a check, kept word for word with their name and the date.
StaleA value whose source has changed since it was read.

2. What counts as a source

2.1 Ranks. Use the highest rank that exists. Say which rank it is.

  1. The original record. The file itself, the official document, the program's own output file, the bank's or provider's own record read back from them, the signed contract.
  2. Our derivation of an original record, made by a script that is kept, so anyone can run it again and get the same value. Name the script and the records it read.
  3. A person's own words to us. Meeting transcript with the time, their text, their email, a file they sent. Usable as "what they said". For money, a number in an email is only a pointer to the record that holds it; the record is the source.
  4. Not a source, ever: model memory, a summary or recap, an agent's report, a to-do list, "industry standard" with no document, a vendor's modeled estimate shown as fact, a value typed with no record of why. Our own planning numbers may be modeled if they are labeled as ours.

2.2 The source record. Every value carries these fields. templates/source-record.json is the shape.

FieldWhat it holds
sourcePath, URL or record id of the original.
locationThe spot inside it: page and words, tab and cell with the row and column labels, row id and field, line number, timestamp in a recording.
value_as_readThe value exactly as the source has it, before any change.
value_used + transformOnly when it was changed: the value used and the script (with version) that changed it.
quoteFor text, the deciding words, word for word.
sha256Fingerprint of the source as read.
source_savedWhen the source itself was last saved or dated.
read_atWhen we read it (clock time with time zone, from the machine, never typed). One time zone across the whole system, named on the page.
readerThe script and version that read it.
pictureThe picture file (section 2.3).
rank1, 2 or 3 from 2.1.
checksThe input and output checks it passed, each with its time (sections 3 and 4).
rulingOnly when a person overrode a check: their words exactly, their name, the date.

Source records and their history are append only. A new read adds a new record; it never edits or deletes an old one. That is how anyone can see what a value was on a past date and what changed it.

2.3 Pictures. A picture shows the source as it was when read. It is taken at read time, never redrawn later from our own data.

  • The top of the picture names the file, the spot (page, tab and cell), when the source was saved, when it was read, and the fingerprint.
  • The spot is outlined. For a spreadsheet the row numbers, column letters and header row are in view. For a PDF the whole page shows with the words boxed. For a web page the saved copy is kept beside the picture, because pages change.
  • A difference between two sources gets two pictures, one per side, plus the rows that explain the gap.
  • A table needs one picture per region, not one per cell: picture the total and any row that decides something; the other rows cite the same table with their row label.
  • A link opens the original at that spot wherever the original allows it.
  • The picture is evidence. It is never edited after it is taken (check_sources.py fingerprints it).
  • When a program draws its own output (a drawing, a report, a calculation sheet), the picture is that program's own output or viewer, never our redraw of it.
  • The picture and the value come from the same read: the same fingerprint. A picture made from a later version of the file is a picture of a different source, and must not sit beside the older value.
  • A picture drawn from the data we read (rather than captured from the screen) says so on the picture, and still shows the formula, the headers and the saved time.

Make pictures with python3 <skill-dir>/scripts/spot.py (section 6).

3. Input validation: the gate before use

A value must pass these before anything uses it. A value that fails is held: it is shown as held with the reason in plain words, it does not flow on, and nobody "fixes" it quietly.

  • I-1 Right record. The file is the one it claims to be. Read the content, not the name (a zip is a zip whatever it is called). The period, date, place or account printed inside the document matches the one it is being used for. A block page, a login page, an empty answer or a redirect is never saved as a source. A file that changed while it was being read is read again.
  • I-2 The record agrees with itself. Its rows add up to its own printed totals; its count matches its listed rows. A record that disagrees with itself is held, not averaged.
  • I-3 The deciding words are there. Before a value from a document is written anywhere, the script finds the deciding words in the saved copy. No words found, nothing written (spot.py refuses with exit 2).
  • I-4 Shape and range. Right type, right unit, inside the range the history supports. A value outside every past case is said to be so before it is used, naming the past case that holds the record.
  • I-5 Two sources agree. Where a second source exists, compare. Agreement is recorded as a check. Disagreement shows both sides with both pictures.
  • I-6 Unknown means stop. A missing value is never filled with a guess. A default is allowed only when it is the program's or the rulebook's own default, and then it is labeled as a default with where that default comes from. Every result has one status: found (needs the value and its source), not_found (needs the list of every method tried), blocked (needs the reason), or held (needs the failed check). A not_found counts only if a known-good lookup worked in the same run. A failed read never overwrites an earlier good value with nothing.
  • I-7 People's input. What a person types or says is kept word for word with who and when. A confirmation is asked once and stored, not asked every time.
  • I-8 Fresh. Every source has a date. Before use, compare the fingerprint with the last read (check_sources.py). A changed source is read again, never assumed the same.

4. Output validation: the check after

  • O-1 Calculated by a script, never by head. Every sum, difference, percentage and total comes from a kept script or a spreadsheet formula, so it can be run again. Same inputs, same output.
  • O-2 Checked against something independent. In order of strength: the original program's own output from the same inputs (replay); the saved real past cases; an official outside service; the other side of a reconciliation (bank against ledger, provider read-back against what we think we sent).
  • O-3 The checker is not the maker. The script or helper that checks did not produce the value. It checks against the raw source, not against the maker's notes. Report the pass count, for example "48 of 50 match, 2 open".
  • O-4 Fix the input, never the output. A wrong result is fixed by changing an input a person could set, or by fixing the reader. Writing or patching an output file or a shown number by hand is a defect.
  • O-5 Prove a failure before saying it. "X failed" or "X is broken" is said only after one independent confirmation (read it back from the provider or the record). Say how many were checked and how.
  • O-6 Every check is itself a record: what was checked, against what, when, the result, and the count.
  • O-7 Every check is proven to catch a wrong value. Plant a wrong value and watch the check fail before trusting it to pass. Readers run against saved known-good sources before a live run, and the live run does not start if they no longer reproduce them.
  • O-8 The check that proved the method runs on every load, not only on the test set. If a second reading of the same bytes (the visible text, the page's own data) must agree with the parser on the test set, it must agree on every scheduled run too.
  • O-9 The verdict a person reads includes every check. A "ready", "done" or "all good" line is computed from all the output checks for that result, not from one of them. A check whose result is stored but never shown and never stops anything is not a check.

AI answers and AI-written text follow the same rules. Each number or fact in the answer cites a record that was actually retrieved for that answer, pinned to the data version it came from. Before the text is shown or sent, check by script that each number in it appears in the record it cites (for example, search the record for each number the text quotes). An answer that cites anything else is refused.

5. Showing it

  • P-1 Every value on a page sits beside its Source. Opening the Source shows the picture, the source record as labeled rows, and a link to open the original at the spot. Never raw JSON.
  • P-2 A checked value shows the check it passed and when, including when the sides agree ("they agree, to the cent, read 9:05"). A failed check shows as real data, not hidden. A failed check never silently removes things from the page (a link, a row); it shows what failed.
  • P-3 A value with no source is not shown as fact. Leave it out rather than fill the gap with a caveat paragraph or a guess. Held values show as held with the reason.
  • P-4 A difference shows both sides and the rows that explain it.
  • P-5 A ruling shows the person's words, name and date beside the value it governs.
  • P-6 Plain words, labeled rows, the answer first. No disclaimers, no "AI says".

6. Tools

python3 <skill-dir>/scripts/spot.py pdf   FILE --find "deciding words" [--page N] [--nth K] --out DIR [--id NAME] [--rank 1|2|3]
python3 <skill-dir>/scripts/spot.py sheet FILE --cell B7 [--tab NAME]                       --out DIR [--id NAME] [--rank 1|2|3]
python3 <skill-dir>/scripts/spot.py web   URL  --find "deciding words" [--nth K]            --out DIR [--id NAME] [--rank 1|2|3]
python3 <skill-dir>/scripts/check_sources.py DIR [--refetch]
python3 <skill-dir>/scripts/status.py --doing "..." --will "..." --why "..." [--who "helper task"]
python3 <skill-dir>/scripts/board.py [--host 127.0.0.1] [--port 7900]
python3 <skill-dir>/scripts/privacy_check.py [PATH ...]
  • spot.py writes DIR/<id>.png (the picture) and DIR/<id>.json (the source record); a web read also keeps DIR/<id>.html, the saved copy that the value and the picture both came from. It refuses with exit code 2, and writes nothing, when: the words or the cell are not there, or match only part of a longer value; the words appear more than once and --nth does not say which; the words are in the file's text but not visible where a person would look (checked by reading the boxed spot back with OCR); a PDF phrase would have to jump between lines or table rows; a spreadsheet's saved result disagrees with its own formula; a web page answers with an error; the source changes while it is read; or a record with that id already exists. Needs Pillow; poppler and tesseract for PDFs; openpyxl for spreadsheets; Chrome or Chromium and tesseract for web pages (SPOT_CHROME names the browser, SPOT_CHROME_FLAGS adds flags such as --no-sandbox inside a container).
  • check_sources.py re-proves every record in a folder by reading the same spot again: PASS, STALE (the source changed since it was read), MOVED (same file, value no longer at the recorded spot), MISSING, BAD (a field is missing, a path leads outside the folder, or the picture or saved copy no longer matches its fingerprint or a fresh picture), UNCHECKED (a kind it cannot re-read). Paths are read relative to the record's folder. Each result is appended to DIR/checks.jsonl. Exit 0 only when every record passes. Run it before a page is published, before a price or a send goes out, and on a schedule for anything live.
  • A sheet picture is drawn from the saved file's cells (the values as the spreadsheet program last saved them) and says so on the picture. A web picture is the saved copy, with scripts removed, cropped around the words with a box added by the reader, and says so.
  • board.py is a live dashboard of every recent agent chat on the machine: its Doing / Will happen / Why it's right, every file it read and changed, every search, web page, app call, command and helper (from the chat's saved tool calls, so no model tokens and not the agent's summary), and every source picture with whether its source changed since it was read. Standard library only and read only. It answers only on this machine unless --host says otherwise, and then only to a link carrying a random key.
  • privacy_check.py checks a folder for private information before it is shared or published. It is a pattern check, not a proof. It looks for the owner's private words (kept outside the folder in ~/.config/receipts/private-words.txt), this machine's login, home folder, host name and git identity, email addresses, phone numbers, home-folder paths, private and Tailscale network addresses, photo GPS and secret-key shapes. It reads file and folder names, text (also after undoing HTML, %-encoding and base64), zip-based files member by member (docx, xlsx, pptx, odt), compressed files, PDF text, fields and streams, the words in pictures and PDF pages (tesseract), picture metadata, and the full git history. A file it cannot read is a finding. Run it before anything leaves the machine.
  • Sources that are none of these (a database row, an API answer, a program's output file, a recording): keep the raw answer as saved bytes with its fingerprint, and show it as labeled rows. The record fields in 2.2 still apply.

7. When building or changing something

  1. List every value the thing will show, use, price or send. Nothing is in scope until it is on the list.
  2. For each value, name its source (rank 1 if it exists) and the spot inside it.
  3. Write the reader so it stores the source record and takes the picture at read time.
  4. Put the input checks (section 3) in front of the use and the output checks (section 4) after.
  5. Show the Source beside the value (section 5).
  6. Prove it: run check_sources.py, run the output checks, and open the page yourself. Then say done, with the counts.

8. When auditing something that exists

Follow references/audit.md. In short: list every value the system shows or uses, and score each one on five questions: is there a source record, is the source rank 1, is there a picture, did it pass an input check, did its result pass an output check. Money, prices and anything sent to a customer or a bank come first. Report the counts and the worst gaps, then fix them in that order.

9. In chat

  • Every number stated in chat that someone will act on names its source in short form: the file and line, the cell, the page, the record id, with the date. Those numbers come from a script run, never from memory or mental math.
  • "No record" is said as "no record". It is never filled with an estimate.
  • A claim that something was done comes with proof the reader can check alone: the link, the file, the command and its output, the count.
  • Read the clock (date) before writing any time.
  • Keep the long evidence in files. The reply is the answer, the source, and what is still open.

10. Briefing a helper

Paste templates/helper-brief.md into every helper's instructions. A helper's report is not a source. Before passing on anything a helper found, check it against the original record (O-3).

11. Case law

references/case-law.md holds the failures this framework was built from, one line each: what went wrong, what caught it, the rule that now prevents it. When a new failure happens, add a line there.

Related Skills