Recipes / Dev & code
Claude CodeSkillDev & code

CLAUDE.md upkeep + log-file debugging loop

A long list of field-tested habits; two that pay off most are keeping CLAUDE.md current and piping dev-server output into a log file the agent can read while it debugs.

Setup time10 min
CostIncluded in plan
RunsPer session
NeedsClaude Code, git
Last updated2026-10-15
BlogSource

How I use Claude Code

by Christian B. B. Houmann · 2025-06-22

✓ Opened with WebFetch on 2026-10-15

Read the original ↗
Part 1 · What the source did

A long list of field-tested habits; two that pay off most are keeping CLAUDE.md current and piping dev-server output into a log file the agent can read while it debugs.

  • Maintains CLAUDE.md files per subdirectory and adds rules with the # prefix.
  • Redirects dev output (bun run dev > dev.log 2>&1) so Claude can read logs, add logging and narrow down bugs.
  • Commits often, since git is the safety net for agent edits.
“USE GIT. USE IT OFTEN.”— Christian B. B. Houmann, Blog

Summary written by Agent Cookbook. See the original for the full context.

Part 2 · Our copy-paste version

Adapted by us from what the source described. Fill in the [BRACKETS].

The prompt

Debug [BUG] using the logs. 1. The dev server writes to dev.log. Read the last 200 lines. 2. Add targeted log statements where you suspect the problem, tell me exactly what to click to reproduce, then read dev.log again. 3. Repeat until you can name the root cause with evidence from the log. 4. Fix it, remove the temporary logging, and propose a one-line CLAUDE.md rule if the bug came from a convention you didn't know.
🛡
Approval ruleThe agent may edit code but not commit or push; you commit after reviewing.

Set it up

  1. Run your dev server with output redirected to dev.log.
  2. Commit before the session.
  3. Paste the prompt and follow the repro steps it gives you.
  4. Review the CLAUDE.md change it proposes.

Common failures

⚠
What usually goes wrong
  • Logs with secrets get read into context. Scrub tokens from logs first.
  • Forgetting to remove temporary logging.

Variations

  • Pipe frontend and backend into the same log for one view.
  • Use a second model for planning and Claude Code for the edits.

Related recipes