Technical
Combining Claude Code and the Browser DevTools
Frontend bugs hide in the gap between code and runtime. The code looks right, but the page behaves wrong. Neither Claude Code nor the browser DevTools alone solve this. Combined, they crush the bug in minutes. Here is the workflow I use.
The Two Sides
Claude Code sees the code. It knows the component hierarchy, the state shape, the types. DevTools sees the runtime. It sees actual rendered DOM, actual network requests, actual errors. The bug usually lives in the mismatch between the two views.
The Loop
My debugging loop looks like:
- Reproduce the bug in the browser
- Open DevTools. Note the error, the failing request, the unexpected DOM
- Paste the error and relevant DOM into Claude Code
- Ask: 'given this runtime behavior, where is the mismatch in the code?'
- Claude Code reads the relevant components and identifies the issue
- Apply the fix. Reload. Verify.
A Real Example
A client reported that the signup form worked, but their email never appeared in the admin. I opened DevTools, submitted the form, watched the Network tab. The POST request returned 200 OK. The Response tab showed a new user object. Everything looked fine.
I asked Claude Code: 'The POST returns 200 but the admin list does not update. Here is the response body. Here is the admin component file.'
Claude Code spotted it immediately: the admin component fetched users with a cache key that was never invalidated after signup. The new user existed in the database, but the frontend showed stale data.
// Before: cache never invalidated
const { data } = useQuery({ queryKey: ['users'] });
// After: invalidate on signup success
mutation.onSuccess = () => {
queryClient.invalidateQueries({ queryKey: ['users'] });
};What DevTools Shows That Code Cannot
- Network timing: 'this request takes 2 seconds' is invisible in code
- Request payloads: the actual headers and body the browser sent
- DOM state: what the user is actually looking at
- Console errors: the exact error message and stack trace
I always paste at least one of these into Claude Code when debugging. Vague descriptions of bugs get vague answers.
The Performance Angle
DevTools has a Performance tab that records rendering work. When a page feels slow, I record a profile and share the flame chart with Claude Code. 'This component re-renders 30 times per interaction. Here is the profile. Here is the code. Find the culprit.'
The combination finds issues that either tool alone would miss.
The Mindset
DevTools is the microscope. Claude Code is the encyclopedia. Use the microscope to spot the symptom. Use the encyclopedia to find the root cause. Together they replace what used to be an afternoon of bug hunting.
See the Chrome DevTools documentation for the full tool set and practice finding where the runtime disagrees with your assumptions.
RELATED READING
The Consulting Shift I Am Making In Year Two
After a year of writing and building, my consulting practice is changing shape. Shorter engagements. Sharper outcomes.
ReadThe Frontend Shift: Shipping Less JavaScript In Year Two
A year ago I reached for Next.js for everything. This year I often reach for nothing.
ReadThe Serverless Lesson I Would Write On A Sticky Note
After a year of shipping serverless projects, one rule explains most of the wins and all of the losses.
Read