Skip to content

Claude CLI integration: compaction fails due to missing tool call response handling #4261

@aligurelli

Description

@aligurelli

Description

When connecting to Clawdbot via Claude CLI (claude -p "..." or sessions_send), Claude's automatic context compaction fails because Clawdbot does not respond to tool calls initiated by Claude.

Problem

Claude CLI periodically needs to compact conversation history using a compact tool call. When this happens:

  1. Claude sends a tool call request (e.g., compact or summarization tool)
  2. Clawdbot receives the message but does not handle/respond to the tool call
  3. Claude waits indefinitely for the tool result
  4. Eventually times out or fails

Observed Behavior

Error: Unexpected server message: {"type":"error","error":{"type":"api_error","message":"Output blocked by token limit."},"usage":{"input_tokens":100754,"output_tokens":15879}}

The high token counts (100K+ input) indicate compaction was not working and context kept growing until it hit limits.

Technical Details

  • Claude CLI expects tool call responses when it issues internal tools
  • Clawdbot's message handling pipeline does not intercept/respond to Claude's tool calls
  • This affects any long-running session where compaction would normally trigger

Expected Behavior

Either:

  1. Clawdbot should handle Claude's internal tool calls and return appropriate responses
  2. Or there should be a way to disable Claude's auto-compaction when used as a sub-agent
  3. Or document this limitation for Claude CLI integration

Environment

  • Clawdbot version: latest (npm)
  • Claude CLI connection via sessions_send
  • Opus model with extended thinking

Workaround

Currently none - sessions eventually fail when context grows too large.

Related

This affects the Claude CLI coding-agent skill and any integration where Claude is used as a sub-agent through Clawdbot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions