IntelliJ plugin: `<system-reminder>` reports selected line numbers off by one
Description
When the user selects code in IntelliJ with the Claude Code plugin enabled, the plugin injects a <system-reminder> into the conversation describing the selection. The line-number range in that reminder is consistently one less than the actual line numbers in the file. The quoted content of the selection is correct — the bug is only in the numeric line range.
This is the same shape as #42759 (VS Code, closed stale, not fixed) but observed on the IntelliJ plugin.
Reminder shape
<system-reminder>
The user selected the lines X to Y from /path/to/file.ext:
<quoted content>
This may or may not be related to the current task.
</system-reminder>
X and Y are each actual_line - 1.
Reproductions (today, 2026-06-06)
File: be-platform-ui/src/api/projectApi.ts
Repro 1 — single line
- User selected line 22:
export const projectApi: ProjectApi = { - Reminder said:
The user selected the lines 21 to 21 from … projectApi - File content at line 21 is blank; the quoted symbol
projectApiactually lives on line 22. Verified by reading the file.
Repro 2 — multi-line range
- User selected lines 7–9 inclusive (whole lines): the
type ProjectApi = {opener, thecreate:line, and theget:line. - Reminder said:
The user selected the lines 6 to 8 from …followed by exactly those three lines of content. - Verified the quoted content sits on lines 7–9 in the file, not 6–8.
Pattern: reported numbers are always actual - 1. Content extraction is correct.
Expected behavior
Reported line numbers should be 1-based to match what the user sees in the editor gutter.
Impact
- Misleads Claude when it acts on the location — e.g. calling LSP
findReferences/goToDefinitionat the reported line/character hits the wrong row. - Forces a workaround: trust the quoted content over the numeric range, or compensate with
+1before any positional tool call. - Likely a 0-based vs 1-based mismatch on the plugin side before the payload is injected.
Environment
- Platform: macOS (Darwin 25.3.0)
- IDE: IntelliJ with Claude Code plugin
- Claude model: Opus 4.7 (1M context) — but the bug is upstream of the model
Related
- #42759 — same bug reported for the VS Code extension; closed as stale without a fix. Suggests shared injection code across IDE plugins.