[BUG] Intellij AI Chat Failed to initialize ACP session. Error: Internal error

Resolved 💬 2 comments Opened May 29, 2026 by kanebryant Closed Jul 1, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Environment:

  • OS: Windows 10
  • IntelliJ IDEA 2026.1
  • Claude Code plugin: 0.1.14-beta
  • Claude Code: 2.1.154

Problem:
The AI Chat Claude Agent fails to initialize on Windows with "Intellij AI Chat Failed to initialize ACP session. Error: Internal error: "Claude Code process exited with code 1"". Claude Code works fine in the terminal.

Root causes found:

  1. JetBrains launches the ACP process with Target PATH: null, overwriting system PATH with only its bundled Node bin folder
  2. The bundled Node bin folder only has node.exe not node, causing npx.cmd to fail
  3. CLAUDE_CODE_GIT_BASH_PATH environment variable is not passed through to the ACP process
  4. The bundled claude.exe in the npx cache (@anthropic-ai/claude-agent-sdk-win32-x64) is not compatible with the OS
  5. CLAUDE_CODE_EXECUTABLE is not passed through, so the ACP wrapper cannot find a working claude binary

What Should Happen?

Workaround:

  1. Copy node.exe to node in the JetBrains bundled Node bin folder
  2. Patch acp-agent.js in the npx cache to inject CLAUDE_CODE_GIT_BASH_PATH and CLAUDE_CODE_EXECUTABLE pointing to the working claude.exe from the npm global installation

Expected fix:

  • JetBrains should append to PATH rather than replace it
  • CLAUDE_CODE_GIT_BASH_PATH should be passed through to the ACP process environment
  • The bundled claude.exe should be compatible with Windows or fall back to the globally installed one

Error Messages/Logs

Intellij AI Chat Failed to initialize ACP session. Error: Internal error: "Claude Code process exited with code 1"

2026-05-29 10:34:36,667 [  25204]   WARN - #c.i.m.l.a.a.p.AcpProcessHandler - [Claude Agent] stderr: Error handling request {
  type: 'com.agentclientprotocol.rpc.JsonRpcRequest',
  id: 4,
  method: 'session/new',
  params: {
    cwd: 'D:\\Users\\bryank01\\dtf11\\rev',
    mcpServers: [ [Object] ],
    _meta: { additionalRoots: [Array] }
  },
  jsonrpc: '2.0'
} {
  code: -32603,
  message: 'Internal error',
  data: { details: 'Claude Code process exited with code 1' }
}

2026-05-29 10:34:36,667 [  25204]   FINE - #c.i.m.l.a.a.p.AcpProcessHandlerService - No process handler found for agent acp.registry.claude-acp in chat 332e42af-3003-4e7c-88b3-42cc9c123da0
2026-05-29 10:34:36,667 [  25204]   WARN - #c.i.m.l.a.a.c.AcpSessionLifecycleManager - Failed to initialize ACP session for chat 332e42af-3003-4e7c-88b3-42cc9c123da0, error: com.

Steps to Reproduce

  1. Start Intellij
  2. open AI Chat

3 install claude from APC Registry

  1. start conversation.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.154

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

IntelliJ IDEA terminal

Additional Information

Intellij Terminal works fine I set that up ok, its the new AI chat window in IntelliJ

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗