You're 40 minutes into a refactor. Claude Code has rewritten six files, three more are half done, the tests are red, and then the message lands: you've hit your usage limit.
Now you have a broken branch, an agent that can't help, and a context window full of decisions you never wrote down. Here's what I'd set up on a Mac so that moment costs you five minutes instead of an evening.
Before the limit: make the half-done state safe
1. A WIP commit in GitHub Desktop
The cheapest insurance is a commit you're not proud of. GitHub Desktop is free and MIT-licensed, and its diff view makes it easy to scan what the agent touched, check every file, and commit "WIP: refactor halfway, tests failing" in a few seconds. A messy commit you can squash later beats a dirty working tree you have to remember.
2. Claude Code checkpoints and /rewind
Claude Code checkpoints your code before every prompt , and /rewind (or Esc twice on an empty prompt) lets you restore code, conversation, or both to any earlier point.…