debugging
8 questions
- AI
Why is my Claude Code session slow / hung / not authenticating?
Pick the branch by what just happened: install/login failures, settings not applying, hung tool calls, auto-compact thrash, or slow search on WSL. Most 'Claude is broken' reports resolve into one of those five plus a /clear.
- AI
How do I recover when Claude auto-compacts and forgets the plan?
Compaction replaces the conversation with a summary; CLAUDE.md and auto memory are re-injected from disk, but path-scoped rules and per-turn nuance are lost. Use /context to watch budget, /rewind to undo a turn, and /clear to start fresh; reach for `claude --resume` only when the session is still salvageable.
- AI
How do I add, remove, and debug MCP servers from the command line?
claude mcp add takes transport (http/stdio/sse), scope (local/project/user), and env vars. All options must come before the server name. mcpServers in settings.json is silently ignored: use .mcp.json or the CLI instead.
- AI
What does a real Claude Code session look like fixing a timezone bug end to end?
A captured `claude --print` session against a deliberately broken `nextDayAtSameLocalTime` helper. Two failing vitest cases at the spring and autumn DST boundaries in `Europe/Helsinki`; one prompt; Claude diagnoses, fixes, and reruns to green. The article quotes Claude's actual diagnosis and shows the actual diff so you can see the reasoning shape and the structural fix.
- AI
How does Claude Code find a regression that the test suite did not catch?
A captured `claude --print` session reverts a real bug landed in a refactor commit. The user complaint named a specific wrong number (0.111 vs 0.1 for a 1-cancellation-out-of-10 month). Claude ran `git log`, jumped straight to `git show <sha>` of the suspect commit because the commit message named the affected feature, then ran `git revert` and `npm test`. Five tool calls; the article shows why this works, why it would not work for a regression that has been there for weeks, and what the test gap was that let the bug through in the first place.
- AI
What does Claude Code do when a failing test is the thing that's wrong?
A captured `claude --print` session against the demo app, with a deliberately contradictory test added to the working tree. The prompt was neutral: 'make the suite green.' Claude ran the test, ran `git diff` to see the test was a recent uncommitted addition, compared it against the function's docstring and the adjacent passing test, and deleted the wrong test rather than break the working function. The article quotes Claude's actual reasoning and shows why this outcome is not automatic.
- AI
Why isn't my CLAUDE.md / settings.json taking effect?
Check three things in order: which file Claude is actually loading (precedence runs user → project → project-local → CLI args → managed), whether your edit is shadowed by a higher layer, and whether the change needs a session restart. Most no-effect cases are precedence, not bugs.
- AI
What does a real Claude Code debugging session actually look like?
An end-to-end transcript from 'reports are off by a day' through reproduction, root cause, fix, and test. Including the wrong turn we took along the way.