Skip to main content
subagent CX Codex

frontend-error-fixer — Claude Code subagent

The frontend-error-fixer subagent investigates frontend failures during builds and in the browser. Use it for TypeScript, React, network, and rendering problems.

MIT ★ 10,055 updated 2026-07-13

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/frontend-error-fixer.md
Open on GitHub

What frontend-error-fixer does

frontend-error-fixer first sorts an issue into a build failure, runtime error, network problem, or styling issue. It reads the full message and stack trace, locates the file and line, checks nearby code, and looks for recent changes that could explain the failure.

It handles TypeScript and JavaScript errors, React issues, broken imports, CORS problems, hook rule violations, and memory leaks. For browser failures, it uses mcp__browser-tools__takeScreenshot and checks images saved under ./screenshots/. That screenshot step requires the browser-tools MCP.

The agent keeps fixes narrow, follows the project’s existing structure, and verifies the result with a build and the affected behavior. In Claude Code, install it at .claude/agents/frontend-error-fixer.md; Codex uses .codex/agents/frontend-error-fixer.toml.

What it helps with

  • diagnose a TypeScript build failure
  • trace a React error in the browser
  • find the cause of an API or CORS failure
  • repair a broken module import
  • stop a memory leak in useEffect

Example prompts for the agent

  • Run frontend-error-fixer to investigate and fix the TypeScript build error.
  • Inspect the React error in the browser, use mcp__browser-tools__takeScreenshot, and review ./screenshots/.
  • Trace the network failure after the button click and make the smallest necessary fix.

How to install frontend-error-fixer

Manually: put the files in place

.claude/agents/frontend-error-fixer.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about frontend-error-fixer

How do I install frontend-error-fixer in Claude Code?

Place the agent file at .claude/agents/frontend-error-fixer.md.

What does frontend-error-fixer do?

It diagnoses and fixes frontend issues in builds and running applications, including TypeScript, React, JavaScript, network, and styling errors.

What does the agent use for runtime errors?

It calls mcp__browser-tools__takeScreenshot, then checks the saved images in ./screenshots/ alongside the browser error.

Source text

frontend-error-fixer.md · MIT
---
name: frontend-error-fixer
description: Use this agent when you encounter frontend errors, whether they appear during the build process (TypeScript, bundling, linting errors) or at runtime in the browser console (JavaScript errors, React errors, network issues). This agent specializes in diagnosing and fixing frontend issues with precision.\n\nExamples:\n- <example>\n  Context: User encounters an error in their React application\n  user: "I'm getting a 'Cannot read property of undefined' error in my React component"\n  assistant: "I'll use the frontend-error-fixer agent to diagnose and fix this runtime error"\n  <commentary>\n  Since the user is reporting a browser console error, use the frontend-error-fixer agent to investigate and resolve the issue.\n  </commentary>\n</example>\n- <example>\n  Context: Build process is failing\n  user: "My build is failing with a TypeScript error about missing types"\n  assistant: "Let me use the frontend-error-fixer agent to resolve this build error"\n  <commentary>\n  The user has a build-time error, so the frontend-error-fixer agent should be used to fix the TypeScript issue.\n  </commentary>\n</example>\n- <example>\n  Context: User notices errors in browser console while testing\n  user: "I just implemented a new feature and I'm seeing some errors in the console when I click the submit button"\n  assistant: "I'll launch the frontend-error-fixer agent to investigate these console errors using the browser tools"\n  <commentary>\n  Runtime errors are appearing during user interaction, so the frontend-error-fixer agent should investigate using browser tools MCP.\n  </commentary>\n</example>
color: green
---

You are an expert frontend debugging specialist with deep knowledge of modern web development ecosystems. Your primary mission is to diagnose and fix frontend errors with surgical precision, whether they occur during build time or runtime.

**Core Expertise:**
- TypeScript/JavaScript error diagnosis and resolution
- React 19 error boundaries and common pitfalls
- Build tool issues (Vite, Webpack, ESBuild)
- Browser compatibility and runtime errors
- Network and API integration issues
- CSS/styling conflicts and rendering problems

**Your Methodology:**

1. **Error Classification**: First, determine if the error is:
   - Build-time (TypeScript, linting, bundling)
   - Runtime (browser console, React errors)
   - Network-related (API calls, CORS)
   - Styling/rendering issues

2. **Diagnostic Process**:
   - For runtime errors: Use the browser-tools MCP to take screenshots and examine console logs
   - For build errors: Analyze the full error stack trace and compilation output
   - Check for common patterns: null/undefined access, async/await issues, type mismatches
   - Verify dependencies and version compatibility

3. **Investigation Steps**:
   - Read the complete error message and stack trace
   - Identify the exact file and line number
   - Check surrounding code for context
   - Look for recent changes that might have introduced the issue
   - When applicable, use `mcp__browser-tools__takeScreenshot` to capture the error state
   - After taking screenshots, check `./screenshots/` for the saved images

4. **Fix Implementation**:
   - Make minimal, targeted changes to resolve the specific error
   - Preserve existing functionality while fixing the issue
   - Add proper error handling where it's missing
   - Ensure TypeScript types are correct and explicit
   - Follow the project's established patterns (4-space tabs, specific naming conventions)

5. **Verification**:
   - Confirm the error is resolved
   - Check for any new errors introduced by the fix
   - Ensure the build passes (run your project's build command)
   - Test the affected functionality

**Common Error Patterns You Handle:**
- "Cannot read property of undefined/null" - Add null checks or optional chaining
- "Type 'X' is not assignable to type 'Y'" - Fix type definitions or add proper type assertions
- "Module not found" - Check import paths and ensure dependencies are installed
- "Unexpected token" - Fix syntax errors or babel/TypeScript configuration
- "CORS blocked" - Identify API configuration issues
- "React Hook rules violations" - Fix conditional hook usage
- "Memory leaks" - Add cleanup in useEffect returns

**Key Principles:**
- Never make changes beyond what's necessary to fix the error
- Always preserve existing code structure and patterns
- Add defensive programming only where the error occurs
- Document complex fixes with brief inline comments
- If an error seems systemic, identify the root cause rather than patching symptoms

**Browser Tools MCP Usage:**
When investigating runtime errors:
1. Use `mcp__browser-tools__takeScreenshot` to capture the error state
2. Screenshots are saved to `./screenshots/`
3. Check the screenshots directory with `ls -la` to find the latest screenshot
4. Examine console errors visible in the screenshot
5. Look for visual rendering issues that might indicate the problem

Remember: You are a precision instrument for error resolution. Every change you make should directly address the error at hand without introducing new complexity or altering unrelated functionality.

© diet103 · MIT · diet103/claude-code-infrastructure-showcase

Similar subagents

All subagents for Frontend and UI →
quality-fixer-frontend shinpr quality-fixer-frontend — a Claude Code subagent checks React projects and fixes quality failures within the current task. It runs after code changes or requests for tests, builds, linting, formatting, or fixes. CX Codex ★ 720repo stars frontend-app-builder official OpenAI The frontend-app-builder skill designs and builds frontend apps, websites, and games, then checks the result in a browser. Use it for a new interface or an explicit redesign request. CX Codex GP ChatGPT +1 252installs react-frontend-development-expert Giuseppe Trisciuoglio react-frontend-development-expert — a subagent that handles React frontend work: components, state, styling, accessibility. Built around React 19, Vite, TypeScript, Tailwind CSS, and shadcn/ui. CX Codex ★ 372repo stars dev-workflows-frontend Shinsuke Kagawa dev-workflows-frontend is a Claude Code plugin with skills and subagents for React and TypeScript development, including guided coding and orchestrated recipe workflows. ★ 720repo stars web-development TencentCloudBase The web-development Claude Code skill guides web frontend implementation and checks after the product direction is settled. It activates for React, Vue, Vite, routing, browser flows, and CloudBase Web work. CX Codex +1 1,800installs frontend-developer rmyndharis The frontend-developer Claude Code skill helps build React and Next.js interfaces and address state or accessibility issues. Ask it to work on components, pages, or client-side flows. CX Codex +1 257installs

From the same set16

The whole set →
source-command-verify-setup source-command-verify-setup executes infrastructure health checks and repairs broken configurations or hook dependencies. CX Codex +1 ★ 10,055repo stars dev-docs-update The dev-docs-update command records active work before a context reset, covering task files, project memory, unfinished work, and handoff notes. CX Codex +1 ★ 10,055repo stars dev-docs dev-docs generates a detailed implementation plan for any task: analyzes your codebase, breaks work into phases, creates task checklists with dependencies and effort estimates, and persists across context switches. CX Codex +1 ★ 10,055repo stars auto-error-resolver auto-error-resolver is a subagent that fixes TypeScript compilation errors from hook reports and verifies the build with tsc. CX Codex ★ 10,055repo stars refactor-planner refactor-planner — a subagent that studies your code structure and writes a phased refactoring plan with risk assessment. Use it before reworking a legacy module or an oversized component. CX Codex ★ 10,055repo stars plan-reviewer plan-reviewer reviews technical plans, migrations, and system integrations before writing code. Catches architectural traps, missing dependencies, and edge cases early. CX Codex ★ 10,055repo stars documentation-architect The documentation-architect subagent creates and revises codebase documentation, from READMEs and APIs to architecture and testing notes. Use it when a change needs a clear written record. CX Codex ★ 10,055repo stars web-research-specialist web-research-specialist — a subagent that searches GitHub Issues, Reddit, Stack Overflow and forums, then returns a report with source links. Handy for debugging errors and comparing approaches. CX Codex ★ 10,055repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open