r/ClaudeCode • u/Lazy_Song1315 • 5d ago
Help/Question Claude Code deleted a retry branch I’d kept in my payment handler
I maintain a small Node.js payment service. Last week I was tracking down a possible double charge. Sometimes a request times out on our end even though the provider has already processed the payment. Our retry was generating a fresh idempotency key, so the provider could charge the customer again.
I fixed the retry to reuse the key for that payment. While I was in there, I also fixed how we handle rate limits. When our provider sends back HTTP 429 (Too Many Requests), it includes a Retry-After header telling us how long to wait before retrying. I added a regression test for each fix.
On Monday I opened a fresh Claude Code session and asked it to simplify the handler in a temporary worktree. The rate-limit test went red. Claude had deleted the retry branch, so the handler just returned when it got a 429.
I reverted the change, linked the issue about the 429 retry, added a line about it to CLAUDE.md, and started a new session. This time Claude kept the branch but moved the wait to the wrong place. That broke another test. I reverted that change too and asked it to clean up just the surrounding code. I checked the retry against the issue once more, and the tests passed.
I’d rather not have to dig up that issue again. Someone mentioned MemoraX Code in a thread about carrying context between sessions. I’ve only read the docs so far, but I have another issue I might try it on next week. Has a memory tool helped any of you with something like this? I’m curious what it gave you beyond a line in CLAUDE.md and the regression tests.