Recipes / Money & bills
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.

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

Personal Finance in Obsidian with hledger and Claude Code: Complete Setup Guide

by mandalivia.com · 2026-04-12

✓ Opened with WebFetch on 2026-10-15

Read the original ↗
Part 1 · What the source did

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.

  • 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.

Part 2 · Our copy-paste version

Adapted by us from what the source described. Fill in the [BRACKETS].

The prompt

Read [PROJECT NOTE] and the daily notes from [DATES]. Find every transaction in [JOURNAL PATH] that belongs to this event, including pre-bookings from weeks earlier. Show me two lists: CONFIRMED (with the reason for each) and AMBIGUOUS. Tag nothing yet. After I confirm, append "; [tag:slug-year]" to each tagged transaction's comment line (lowercase-kebab-case), then add an "## Expenses" table to the note with total and breakdown by account.
🛡
Approval ruleNothing 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

⚠
What usually goes wrong
  • 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.

Related recipes