Recipes / Claude Code use cases
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.

From Christian B. B. Houmann · Blog · Jun 2025

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

What the source did

  • 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.

Copy the prompt

Ours Our version, based on what Christian B. B. Houmann described. Not their wording. Fill in the [BRACKETS].

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 rule

🛡
The 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

⚠
  • 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.

Get the 10 best agent setups. Free.

Plus new recipes every week. One email, no spam.

Unsubscribe anytime. Privacy

Related recipes

More Claude Code use cases →

Read original ↗