> I haven't managed to really figure out what's the best way
For you, the best way is to break your code down into modules insofar as possible, so that you don't overrun the context window. Opus Max starts forgetting things the minute it begins compressing your conversation -- and multiple compressions can make for gaps in memory.
I find that it's also important to have another model serve as review/critique. I use Opus Max for code and 5.5 Pro for immediate code review. The latter will often pick up on things that might have been missed, and will usually provide good suggestions.
I've made it write a /status-line thing to display context tokens in the status line and also a hook to stop and ask to continue or compact whenever it reaches 250k tokens. For subscription I have also made it stop at 90% usage so Claude chat is not unusable between coding sessions. The greatest addition so far.
For you, the best way is to break your code down into modules insofar as possible, so that you don't overrun the context window. Opus Max starts forgetting things the minute it begins compressing your conversation -- and multiple compressions can make for gaps in memory.
I find that it's also important to have another model serve as review/critique. I use Opus Max for code and 5.5 Pro for immediate code review. The latter will often pick up on things that might have been missed, and will usually provide good suggestions.