Add to Claude

Guides · Beyond customer lists

Flag big refunds and orders for review, with an undo

Tools: sift_count, sift_fix_dry_run, sift_fix_apply, sift_fix_undoWorks with Claude Code

Count the refunds and orders over your limits, then have Sift write check in a review column on just those rows. In the test file, 7 of 18 transactions are over the limits, worth 5,465.00, and 6 get marked: the seventh was marked already.

Ask your agent

With Sift connected (setup takes three steps), paste this and swap in your own paths.

Use Sift on /path/to/shop_transactions_nov.csv. Count the refunds with an amount of 100 or more and the orders of 1,000 or more, and total the amount. Then, with /path/to/rules.shop-review.json, dry run set_if on the review column, setting it to check where that holds, and apply it if I say yes.

Your agent writes the condition for both tools: {"any": [{"all": [{"field": "type", "op": "eq", "value": "refund"}, {"field": "amount", "op": "gte", "value": 100}]}, {"all": [{"field": "type", "op": "eq", "value": "order"}, {"field": "amount", "op": "gte", "value": 1000}]}]}. The rules file allows up to 40% of rows to change, and makes txn_id, type and amount hands-off.

What Sift sends back

Over the limits, from sift_count7 of 18, worth 5,465.00
Would be marked check6
Already said check1, left as it is
Rows changed33.3%, inside the 40% limit
After applyA new file, a receipt and a changes-only file with the 6 changes
After undoThe original rebuilt, matching byte for byte

A refund of exactly 100.00 counts, because the condition is 100 or more. One at 99.99 does not. A refund with a blank amount is not counted, because a blank can't be compared with 100.

What to do next

Questions

Can it look at dates too?
Yes. Add a condition such as within_days 30 with an as of date, and only recent rows are marked.
What if a row already says check?
It counts as meeting the condition, but nothing on it changes.
Does it change the original file?
No. Apply writes a new file next to it, with a receipt that records every old and new value.

One file, no agent? Clean a file by hand in your browser, with nothing uploaded.

More guides

Guide Change prices across a list, with a dry run and an undo Guide Tidy expense categories before your accountant sees them Guide Find unpaid invoices: match invoices to payments