CC should verify its own work against requirements and rules
tl;dr: Have Claude Code check its own work at the end of edit sessions, vs standards and requirements. One way to do this is with some equivalent to:
_claude -p "Please check uncommitted changes vs any global rules or requirements that you're aware of, and identify any deviations from those rules and requirements. Then say PASS or FAIL based on whether you think the code quality and compliance are good enough to allow a production launch."_
---
Working with Claude Code has been great, but I've noticed some consistent patterns of failure:
- CC doesn't naturally write unit tests
- if tests exist, and it's having trouble making them work, CC will mark them skipped
- if I give example cases where functionality fails, CC sometimes writes implementation code that handles the one use case
- if code is throwing an error, CC sometimes adds workarounds or ignores exceptions rather than fixing the error and allowing the exception to show failure
When I look at my chat logs, I'm constantly watching its output and correcting it as it colors outside the lines of the rules, even if they're established in CLAUDE.md. I keep saying NO WORKAROUNDS!
It occurs to me that the fix for this is somewhere between a linter and a unit test. Since I'm just being a nanny most of the time, verifying that the changes are okay against CLAUDE.md and any requirements like a REQUIREMENTS.md, how about automating this? Have CC itself run this comparison at the end of a code editing run?
I've started using this prompt to do this kind of check, with decent results. I don't think it should be run in the current session, but as a separate query with a new context:
Please check uncommitted changes vs any global rules or requirements that you're aware of, and identify any deviations from those rules and requirements.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗