Comment by hibikir
9 hours ago
My favorite uses of Claude code is to do code quality improvements that would be seen as a total waste of time if I was doing them by hand, but are perfectly fine when they are done mostly for free. Looking for repetitive patterns in unit tests/functional tests. Making sure that all json serialization is done in similar patterns unless there's a particularly good reason. Looking for functions that are way too complicated, or large chunks of duplication.
The PRs that it comes with are rarely even remotely controversial, shrink the codebase, and are likely saving tokens in the end when working on a real feature, because there's less to read, and it's more boring. Some patterns are so common you can just write them down, and throw them at different repos/sections of a monorepo. It's the equivalent of linting, but at a larger scale. Make the language hesitant enough, and it won't just be a steamroller either, and mostly fix egregrious things.
But again, this is the opposite of the "vibe coding" idea, where a feature appears from thin air. Vibe Linting, I guess.
Absolutely. I've got a nice multi-paragraph prompt on hunting for subtle bugs, user expectation breaks, crufty/repeated code, useless tests (six tests that actually should be one logical flow; assertions that a ternary is still, indeed, a ternary; etc.), documentation gaps, and a few other bits and bobs.
I sick Opus, GPT5.4, and Gemini on it, have them write their own hitlists, and then have a warden Opus instance go and try to counterprove the findings, and compose a final hitlist for me, then a fresh context instance to go fix the hitlist.
They always find some little niggling thing, or inconsistency, or code organization improvement. They absolutely introduce more churn than is necessary into the codebase, but the things they catch are still a net positive, and I validate each item on the final hitlist (often editing things out if they're being overeager or have found a one in a million bug that's just not worth the fix (lately, one agent keeps getting hung up on "what if the device returns invalid serial output" in which case "yeah, we crash" is a perfectly fine response)).
Mind sharing that prompt? This is one of my favorite uses for AI too, but I’m just using it to fix the stuff that’s already top of mind for me.
For sure. This is a straight copy-paste of my prompt which references my architecture, codebase, references folder (God, that's so golden -- .gitignored, but saving the tokens of googling or cloning and just having the codebases we depend on locally is killer) so this is not ready to be copy pasted. However, with the context that this is an interface for a peer-to-peer encrypted radio mesh client (for MeshCore; my code is https://github.com/jkingsman/Remote-Terminal-for-MeshCore), that can maybe give you a mote of context around things that are obviously key (e.g. sending/receiving) or important but not a topline acceptance criteria (message ordering, async radio operations, etc.) to port this and try it out on your codebase.
Prompts: https://gist.github.com/jkingsman/30a61882917c68c114ee28fe5f...
Also, I say "prior to public release" and obviously, this codebase is super publicly released, but that doesn't matter -- what I'm doing in the prompt is priming my agents for a this matters tone. I have no opinions I'd state publicly on the consciousness argument, but I generally dislike deception; in this case, I find declaring this to be our last ditch review before public release puts it in a context state to be more details-oriented than other primers I tried ("this is our final release" led to too many interoperability/future-proof finds; "this codebase has subtle bugs introduced by an adversarial engineer" had too many security false positives or true-but-absurd positives; "please be detailed and carefully dig deep" just wasn't as good. Plus, the "public release" paradigm helped it to do innate classification of "gotta fix before release" vs. "fix soon after" vs. "fix when able" which maps pretty well to my personal taste in the severity of bugs it's found I've evaluated, so I've kept it).