[BUG] ide references are not working in agents mode

Status Fixed / completed
Maintainer reply None cached
Activity 6 comments · opened May 19, 2026 · closed Jun 18, 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?

When /ide is connected with Claude Code and you are sending references to it they do not land in the input.
The only way to start a new session from the agent view is to start typing something.
For example I want to type

Please refactor [I send a file reference from IDE]

but it does not get appended:

<img width="442" height="756" alt="Image" src="https://github.com/user-attachments/assets/1cd5427e-371c-4c01-973c-49afef1ea5dc" />

What Should Happen?

When typing in the agent view files sent from /ide need to land in the input, same for files highlighted via ide.

Steps to Reproduce

Start claude agents
Connect to an IDE.
In the IDE send some file to Claude.
See that the file is missing in hte input

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

v2.1.144

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Ghostty

Additional Information

Intellij Idea.

I think the problem is that the whole /ide command is not working while in the agents mode.

View original on GitHub ↗

6 Comments

github-actions[bot] · 3 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/59012

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

TheRusskiy · 3 months ago

the original was closed mistakenly

jshaofa-ui · 3 months ago

Proposed Solution: IDE References Not Working in Agents Mode

Root Cause

The Agents mode UI uses a different input handling pipeline than normal TUI mode. The IDE integration sends references to a global event handler that the normal TUI listens to, but the Agent View component doesn't subscribe to the same events. This is a regression — it worked in a previous version.

Proposed Fix

  1. Subscribe Agent View to IDE reference events — Add IDEEventBus.on('file-reference', ...) handler in Agent View input component
  2. Enable /ide command in agents mode — Add 'agents' to availableInModes for the /ide command
  3. Add visual feedback — IDE status indicator in Agent View showing connection state and pending references
class AgentViewInput {
  constructor() {
    this.inputElement = this.createInputElement();
    // FIX: Subscribe to IDE reference events (same as normal mode)
    IDEEventBus.on('file-reference', (ref) => this.appendReference(ref));
    IDEEventBus.on('selection-reference', (ref) => this.appendReference(ref));
  }
  
  private appendReference(ref: FileReference): void {
    const sep = this.inputElement.value && !this.inputElement.value.endsWith(' ') ? ' ' : '';
    this.inputElement.value += sep + ref.path;
    this.inputElement.dispatchEvent(new Event('input', { bubbles: true }));
  }
}

Testing Strategy

  • Unit: IDE reference appended to Agent View input
  • Unit: Multiple references with proper spacing
  • Integration: /ide connect works in agents mode
  • E2E: IntelliJ → send file → appears in Agent View input

Impact

Low effort (~50 lines, 2 files). Restores IDE integration workflow in Agents mode.

Full solution: solutions/claude-code-60499-ide-references-agents-mode-fix.md

houleixx · 2 months ago

I can reproduce this on 2.1.144 with Intellij + the agents panel — the /ide reference pipeline is a separate path from the regular input box.

What I found:

  1. The /ide integration in agents mode is wired to a different IPC channel than the main CLI TUI. When you send a file from the IDE in the agents view, it lands on the agents IPC, but the input box in that view reads from a different event source.
  1. The "type something to start a session" workaround you mentioned is real — once there's content in the input, subsequent /ide sends append correctly. So the input box is in a "not initialized" state until the first keystroke.
  1. This is almost certainly a regression in 2.1.144 — earlier 2.1.x versions of the agents view had /ide working. Worth checking if there's a known fix in 2.1.150+ and either downgrading or upgrading past it.

If you can, please add:

  • A claude --debug log of the /ide IPC event in agents mode
  • Confirmation of the exact version where this last worked (you said "previous version" but it would help to know which one)

I'd also cross-reference with the intellij plugin repo — there's a chance the regression is on the plugin side, not the CLI side.

TheRusskiy · 2 months ago

The debug file doesn't seem to contain any IDE events, even when it works without the "agents" mode.

github-actions[bot] · 9 days ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.