Process and file an HSA receipt
Extracts HSA receipt details and organizes them into year-based folders with a CSV tracking file.
/plugin marketplace add stbenjam/claude-nine/plugin install stbenjam-finances-plugins-finances@stbenjam/claude-nine<path-to-receipt>finances:add-hsa-receipt
/add-hsa-receipt <path-to-receipt>
Process an HSA receipt file by extracting transaction details and organizing it for tax records.
The command will:
$1 (required): Path to the receipt file (PDF, image, etc.)Use the Read tool to read the file provided in $1. Claude can natively read PDFs, images (PNG, JPG), and other file formats.
From the receipt content, extract:
Extract the year from the transaction date (e.g., if date is 2024-01-09, year is "2024").
In the current working directory, create a directory named with just the year if it doesn't already exist:
mkdir -p YYYY
Example: mkdir -p 2024
The CSV file is located at <year>/records.txt.
If the file doesn't exist:
Date,Description,Amount,FilenameAppend the new entry:
Format: YYYY-MM-DD,description,amount,filename
Example: 2024-01-09,Dental cleaning,350.00,2024-01-09_dental-cleaning_350.00.pdf
Important CSV handling:
"Smith, Dr. John"Copy the original file to the year directory with a new standardized name.
Filename format: YYYY-MM-DD_description_amount.ext
Sanitization rules:
Examples:
~/Downloads/receipt.pdf2024-01-09_dental-cleaning_350.00.pdfCommand:
cp "$ORIGINAL_PATH" "YYYY/YYYY-MM-DD_description_amount.ext"
Handle duplicates: If the destination file already exists, you may:
-2, -3 to avoid overwritingOutput a summary showing:
Example output format:
Processed HSA receipt:
Date: 2024-01-09
Description: Dental cleaning
Amount: $350.00
File saved: ./2024/2024-01-09_dental-cleaning_350.00.pdf
Record added to: ./2024/records.txt
Command:
/add-hsa-receipt ~/Downloads/dental-receipt.pdf
Process:
~/Downloads/dental-receipt.pdf./2024/ (if needed)./2024/records.txt:
Date,Description,Amount,Filename2024-01-09,Dental cleaning,350.00,2024-01-09_dental-cleaning_350.00.pdfcp ~/Downloads/dental-receipt.pdf ./2024/2024-01-09_dental-cleaning_350.00.pdfOutput:
Processed HSA receipt:
Date: 2024-01-09
Description: Dental cleaning
Amount: $350.00
File saved: ./2024/2024-01-09_dental-cleaning_350.00.pdf
Record added to: ./2024/records.txt
$1 doesn't exist, show error: "Receipt file not found: <path>"