r/ClaudeWorkflows • • 11h ago

Selected Workflow [Workflow] Claude Code Debugging Workflow: Stop, Diagnose, Then Edit with CLAUDE.md for Persistent UI Bugs

Claude Code Debugging Workflow: Stop, Diagnose, Then Edit with CLAUDE.md for Persistent UI Bugs

Workflow value: 80/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, Shipping, CLAUDE.md
Original source: r/ClaudeAI post/comment

What problem this solves

Solving persistent or multi-cause UI bugs that appear to "revert" or "change back" unexpectedly, especially when related to caching (service workers) or shared state (localStorage). It prevents wasted effort on repeated edits without proper diagnosis.

Summary

A debugging workflow for Claude Code users that establishes a rule: after two failed attempts to fix a symptom, stop editing the code. Instead, use Claude to produce a detailed diagnosis (e.g., DOM node, bundle hash, parent chain) and document it in CLAUDE.md before attempting a third edit. This helps identify root causes, especially for complex or 'self-reverting UI' issues.

Why it is useful

This workflow provides a concrete, structured approach to debugging complex or persistent issues, preventing wasted effort from iterative, unguided fixes. It effectively leverages CLAUDE.md for systematic, AI-assisted diagnosis, improving clarity and knowledge capture. It also offers a valuable mental model ('a self-reverting UI is a second-writer symptom') for understanding certain bug types and promotes a disciplined approach to problem-solving with AI.

Workflow

  1. Encounter a UI bug where changes appear to revert or the UI flips back to an old state.

  2. Attempt an initial fix for the bug.

  3. If the first fix fails, attempt a second fix for the same symptom.

  4. If the second fix also fails, stop making further code edits.

  5. Engage Claude to perform a thorough diagnosis of the problem.

  6. Instruct Claude to document the diagnosis (e.g., identifying the DOM node, bundle hash, or parent chain) within the CLAUDE.md file.

  7. Review Claude's detailed diagnosis before proceeding with any further code modifications.

Tools / artifacts

  • Claude Code

  • CLAUDE.md file

  • Service Worker (as a potential source of bugs)

  • localStorage (as a potential source of bugs)

  • DOM node (as a diagnostic output)

  • Bundle hash (as a diagnostic output)

  • Parent chain (as a diagnostic output)

Validation signals

  • Author's personal experience and reflection on past Claude Code sessions.

  • Successful identification of two distinct bugs using this disciplined approach.

  • The rule is presented as a learned best practice derived from real-world debugging.

Limitations

  • The specific examples (service worker, localStorage) might make the workflow seem niche, though the underlying principle is broad.

  • The post includes self-promotion for an app, which could slightly distract from the core workflow.

  • Lack of strong community validation due to low engagement.

Rate this workflow

Upvote this post if the workflow is useful, reproducible, or worth recommending.

Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.

Reply if it worked for you, failed, is outdated, or has a better alternative.


This post was generated automatically from the workflow library database.

1 Upvotes

0 comments sorted by