Recipes / Claude Code use cases
Claude CodeWorkflowMoney & bills

Tag a trip's spending from your notes (hledger)

Keep a plain-text ledger in the same vault as your trip and project notes; the agent reads the notes, finds every related transaction, asks about the ambiguous ones, tags them and writes a cost summary.

From mandalivia.com · Blog · Apr 2026

Setup timeAn afternoon
CostIncluded in plan
RunsAfter each trip or event
NeedsClaude Code, hledger, Obsidian vault, bank CSV export
Last updated2026-10-17

What the source did

  • Imports budgeting-app CSVs into an hledger journal using rules the agent helped write.
  • Asks Claude to read a trip note plus daily notes and find every matching transaction, including flights booked weeks earlier.
  • Confirms the ambiguous ones by hand; Claude tags the rest and appends an Expenses table to the note.
  • Runs a Sunday report headless with claude -p, scoped to two folders and only Read, Write and hledger.
“The prompt is the specification.”— mandalivia.com, Blog

Summary written by Agent Cookbook. See the original for the full context.

Their prompt

From mandalivia.com Their exact wording. Source ↗

Read PR-2026-Amsterdam.md and the daily notes from May 15–17. Find every transaction in Planner/Finance/finances.journal that belongs to this trip — including pre-booked flights and hotel from weeks earlier. Tag them trip:amsterdam-2026 in hledger syntax (comment line after the description). Show me the ambiguous candidates before tagging anything. After I confirm, write an Expenses summary block to the bottom of the project note with the total and a breakdown by account.

Approval rule

🛡
Nothing is tagged until you've confirmed the ambiguous list. Never run a full reimport without committing first; it wipes tags.

Set it up

  1. Keep the journal in git; commit before every session.
  2. Write a README in the finance folder with tag conventions; the agent reads it first.
  3. Run the prompt, review the ambiguous list, confirm.
  4. Query later with hledger bal tag:trip=...

Common failures

⚠
  • Misspelled tags quietly split totals. Use one case convention.
  • Unanchored regex in import rules matches too much (NA matches 'Donations').

Variations

  • Weekly report via claude -p with --allowedTools 'Read,Write,Bash(hledger:*)'.
  • Tag hosted visits or home projects the same way.

Get the 10 best agent setups. Free.

Plus new recipes every week. One email, no spam.

Unsubscribe anytime. Privacy

Related recipes

More Claude Code use cases →

Read original ↗