self-review tool?
when claude has finished a task, I've often find success with starting a new claude code instance and asking it something like:
- your goal is to review the current
git diff --staged - the goal of the change is to complete item (2) in TODO.md
- in particular, assess whether the diff is consistent with the coding guidelines in CLAUDE.md
- ensure the tests are sufficient to demonstrate the change works
- add any suggested changes or simplifications to the working tree
starting with a new context seems to help it avoid attending to overly narrow issues, and instead focus on "does it meet the goal as described". and this reduces the frequency of me being like "please read CLAUDE.md, it says not to add fallbacks like X & Y, but there are lots there"
this is somewhat consistent with the suggestion from @bcherny at https://github.com/anthropics/claude-code/issues/427#issuecomment-2731384339. there's also a suggestion in the anthropic docs to use claude to review itself
so then: would it make sense to have that as something claude can do itself? like a subtask Review which receives a more nuanced version of the above as context — it could actually write down the goal, some notes on any issues it had with the implementation — and gets back text with a review — "have you considered implementing without adding a class" / "the coding guidelines state not to use excess try/except, but the one in foo.py seems unnecessary"
claude could decide whether to call this itself, or it could trigger on the equivalent of ultrathink for when quality is more important than latency
4 Comments
I think you can just ask Claude to use subagent for that.
``
use subagent to perform code review, pay attention to ....``@michael-sokolov that works extremely well!
thanks!
I'll close...
fyi this is unreasonably effective; would highly recommend...
cc @bcherny, if feedback on what works well is helpful, for docs / or giving claude-code itself guidance in its prompt
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.