Question about cutting my prompt tokens in half with one dumb trick
I was burning through way too many tokens sending whole log files to Claude for error triage, so last Tuesday I tried asking it to write a short regex first and pull out only the matching lines before doing the real analysis. My 12k token debug session dropped to about 5k, and the answers actually got sharper because the noise was gone. Not a big deal but it saved me real money on my API bill this month. Has anyone tried chaining a cheap filter model in front of the expensive one, and did it break anything for you?
Tried the exact same thing and felt like a genius until I realized I'd spent 45 minutes writing a regex that missed half the error lines because of one dumb whitespace assumption. Honestly the filter idea is solid though and I've had good luck running a cheap model as the first pass, mostly because it's dumb enough to just do the boring extraction job without overthinking it. The main thing that bit me was multi-line stack traces getting chopped up, so watch out for that if your logs wrap errors across lines. Ngl cutting 12k down to 5k is a bigger win than you're giving yourself credit for.