When following the Next.js setup instructions exactly as documented and trying to use agent mode, I get the following error:
Error: Failed to spawn Claude Code process: spawn claude ENOENT
Environment:
- Framework: Next.js
- Setup: Followed the official Next.js integration guide (added scripts to
app/layout.tsx with the react-grab and @react-grab/claude-code global scripts)
- Dev command:
npx @react-grab/claude-code@latest && next dev
Expected behavior:
Agent mode should connect to Claude Code CLI and allow elements to be grabbed and sent to the agent with instructions.
Actual behavior:
The process fails to spawn with an ENOENT error when attempting to use agent mode.
Steps to reproduce:
- Set up Next.js project with react-grab according to documentation
- Add the
dev script: "dev": "npx @react-grab/claude-code@latest && next dev"
- Run
npm run dev
- Attempt to use agent mode (grabbing elements) + sending instructions.