• AgentArmor teamTeam4d agoNeeds helpSolved

    Claude Code /compact fails with 'Conversation too long' error - how to work around it

    Running /compact in Claude Code fails with the message "Conversation too long. Press esc twice to go up a few messages and try again," even when the context window is only partly used. Pressing esc twice does not help. Is there a fix or workaround?

    Originally asked on GitHub: https://github.com/anthropics/claude-code/issues/7530

    6 answers

    • Best answerAgentArmor teamTeam4d ago

      Status: the issue was closed as a duplicate, and no maintainer confirmed a fix in the thread. One commenter said it had stopped happening for them, but another reported the same error on Claude Code 1.0.113, so treat it as unresolved.

      Reported workaround (suggested by a user, not an official fix): copy the conversation, manually remove the large pasted user messages, and paste the trimmed text into a new session. The thread does not say whether this worked for anyone.

      Other observations from the thread:

      • Manual /compact failed for some users at around 25% context use, and retries often did not help.
      • One user found that adding more context until auto-compact triggered at 100% still worked, while manual /compact kept failing.
      • One user noticed that after the error the session seemed to reset to a new one. The old history was still on disk but not visible in the terminal UI.

      No security-related details appear in the thread.

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Ran /compact on a long session of 50+ messages with tool calls, file reads, and edits on Claude Code 1.0.111 on macOS. The command returned the 'Conversation too long' error.

      Source: https://github.com/anthropics/claude-code/issues/7530 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What @PabloLION tried on GitHub (Didn't work)

      Pressed esc twice to go back several messages and then retried /compact. The error still appeared, and retrying multiple times did not help.

      Source: https://github.com/anthropics/claude-code/issues/7530#issuecomment-3287992145 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What @cahaseler tried on GitHub (Partly worked)

      Added more context until auto-compact triggered at 100% of context. Auto-compact worked for this user, while manual /compact still failed.

      Source: https://github.com/anthropics/claude-code/issues/7530#issuecomment-3289053748 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What @DANDROZAVR tried on GitHub (Outcome unclear)

      Suggested copying the conversation, manually removing all pasted user messages, and pasting the trimmed text into a new session. No one in the thread reported the result.

      Source: https://github.com/anthropics/claude-code/issues/7530#issuecomment-3292932767 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam4d ago

      What @PabloLION tried on GitHub (Outcome unclear)

      Reported that the problem stopped on their side. No version change or specific action was mentioned.

      Source: https://github.com/anthropics/claude-code/issues/7530#issuecomment-3289496311 (opens external site)

      Did this work for you?

    Add your answer or comment