claude-code - 💡(How to fix) Fix JetBrains/PyCharm: Messages appear multiple times in chat UI, causing double token charges [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47865Fetched 2026-04-15 06:40:07
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

When using Claude Code inside PyCharm (JetBrains extension), each user message appears multiple times in the chat UI. The duplication results in the query being processed more than once, which doubles token usage and cost.

Root Cause

When using Claude Code inside PyCharm (JetBrains extension), each user message appears multiple times in the chat UI. The duplication results in the query being processed more than once, which doubles token usage and cost.

Fix Action

Fix / Workaround

  • No custom keybindings or submit hooks are configured, ruling out accidental double-submit via keybinding conflict
  • Issue appears specific to the PyCharm/JetBrains integration — not reproduced when running Claude Code from a plain terminal
  • No workaround currently known
RAW_BUFFERClick to expand / collapse

Bug Report

Summary

When using Claude Code inside PyCharm (JetBrains extension), each user message appears multiple times in the chat UI. The duplication results in the query being processed more than once, which doubles token usage and cost.

Environment

FieldValue
Claude Code version2.1.107
IDEPyCharm 2025.3.3
OSmacOS 26.3 (Build 25D125)
Custom keybindingsNone (~/.claude/keybindings.json does not exist)
Hooks configuredNone

Steps to Reproduce

  1. Open Claude Code inside PyCharm (JetBrains extension)
  2. Type any message and submit it
  3. Observe the chat UI

Expected Behavior

Each submitted message appears once and is processed once.

Actual Behavior

The same message appears multiple times in the chat UI. This causes the query to be processed multiple times, resulting in approximately 2x the expected token consumption and cost.

Additional Context

  • No custom keybindings or submit hooks are configured, ruling out accidental double-submit via keybinding conflict
  • Issue appears specific to the PyCharm/JetBrains integration — not reproduced when running Claude Code from a plain terminal
  • No workaround currently known

Impact

Double billing on every query when using the JetBrains extension.

extent analysis

TL;DR

The issue can likely be resolved by identifying and fixing the cause of the duplicate message submissions in the Claude Code PyCharm integration.

Guidance

  • Investigate the PyCharm/JetBrains extension code to determine why each user message is being submitted multiple times, focusing on event handling and submission logic.
  • Verify that the issue is not related to the Claude Code version (2.1.107) by checking if the problem persists with a different version, if available.
  • Check for any potential conflicts or misconfigurations in the PyCharm environment that could be contributing to the duplicate submissions.
  • Consider implementing a temporary workaround, such as a client-side deduplication mechanism, to prevent duplicate queries from being processed until a permanent fix is found.

Example

No code example is provided due to the lack of specific technical details about the Claude Code PyCharm integration.

Notes

The solution may require modifications to the PyCharm/JetBrains extension code or the Claude Code application, and may involve debugging and testing to identify the root cause of the issue.

Recommendation

Apply a workaround, such as client-side deduplication, to prevent duplicate queries from being processed until a permanent fix is found, as the root cause of the issue is currently unknown and may require further investigation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING