Skip to content
Mastering Claude

Home

Claude Code7 lessons63 min

When things go wrong

  1. 01Loops, polluted context and restarting10 min

    The sign of a loop is the same failure message repeating, a saturated context is handled by a targeted compaction or a full clear, and starting over with a hand written summary of the decisions already made beats insisting inside a degraded conversation.

  2. 02Undoing and recovering a change9 min

    To undo Claude Code's last change in the current session, open the checkpoint menu with /rewind rather than going through Git first. Git remains the tool for what checkpoints ignore: changes made by a bash command, a background sub-agent's edits, and linked files.

  3. 03API errors and rate limits9 min

    An API error carries a status code that tells very different causes apart: a malformed request must be corrected before any retry, whereas a temporary rate limit resolves by respecting Retry-After. A spending cap reached carries no such header, and waiting achieves nothing: the cap itself must be raised.

  4. 04A stuck command7 min

    For a frozen shell command, press Ctrl+C, which attempts to interrupt the operation; otherwise relaunch with claude --resume. Do not add a timeout prefix by hand, because the Bash tool already carries a delay parameter that Claude chooses itself, and most commands that reach their delay switch to a background task instead of being stopped.

  5. 05Several sessions die together, suspect the machine9 min

    When several sessions die at the same instant with no trace whatsoever in their own logs, the likely cause is the operating system killing processes under memory pressure, and the system log settles the question faster than a hunt through application errors.

  6. 06The request may rest on a false premise9 min

    A request for a fix mixes an observed symptom with an assumed cause: the symptom can be accurate while the cause is false. Carrying it out to the letter then fixes nothing. Measure the actual state, state the gap at the start of the reply, then fix the real cause.

  7. 07Read the function called next, prove the culprit10 min

    A fix whose unit test goes green can be undone, within the same execution turn, by the function called right after it, and the already fixed function only becomes a proven culprit once a test has isolated its effect from that of the functions that follow.