Installation
Start the server
The server runs on port To stop it:
4567 by default.Quick Start (CLI)
Start the server in the background before running your dev server:The server will run as a detached background process. Stopping your dev server (Ctrl+C) won’t stop the React Grab server.
Recommended: Config File Setup
For better lifecycle management, start the server from your config file. This ensures the server stops when your dev server stops:Vite
Next.js
How It Works
- React Grab sends the selected element context to the server via HTTP POST
- Server receives the request and forwards it to Claude Code via the Agent SDK
- Claude Code processes the request and streams responses back
- Server relays status updates to the client via Server-Sent Events (SSE)
Usage
Once installed, you can:- Select an element in your browser by hovering over it with React Grab active
- Right-click or use the context menu to choose “Edit with Claude Code”
- Enter your prompt describing what you want to change
- Watch as Claude Code makes the changes in real-time
- The selected element’s HTML structure
- Component name and file location
- Line numbers for precise targeting
- Full context for accurate modifications
Example Workflow
Select the element
Hover over any UI element in your browser and press Cmd+C (Mac) or Ctrl+C (Windows/Linux).
Advanced Configuration
You can customize the Claude Code provider:Why Use Claude Code with React Grab?
Claude Code excels at:- Understanding context: Claude can understand complex UI patterns and relationships
- Making intelligent changes: Goes beyond simple edits to suggest architectural improvements
- Following best practices: Applies React and TypeScript best practices automatically
- Handling edge cases: Considers accessibility, responsiveness, and error states
Troubleshooting
Server won't start
Server won't start
- Check if port 4567 is already in use
- Try killing existing processes:
pkill -f "react-grab.*server" - Ensure you have the Claude Agent SDK configured
No response from Claude Code
No response from Claude Code
- Verify the Claude Agent SDK is properly installed
- Check server logs for API errors
- Ensure you have valid API credentials
Context not being sent
Context not being sent
- Verify the client script is loaded in your browser
- Check browser console for connection errors
- Ensure the server is running before loading your app
Changes not appearing
Changes not appearing
- Check that your files are writable
- Verify Claude Code has permissions to modify files
- Look for error messages in the server logs
Performance Benefits
Using React Grab with Claude Code can make your development workflow up to 3× faster by:- Providing precise element context without manual file searching
- Reducing the need for follow-up questions from the AI
- Enabling direct, targeted modifications instead of broad refactoring
- Including file paths and line numbers for instant navigation
Next Steps
Quick Start
Get started with React Grab
Plugin API
Learn about the plugin system
