Skip to content

[BUG] ExitPlanMode doesn't return the plan as a tool result in v2.0.51 #12288

@omidmogasemi

Description

@omidmogasemi

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When asking Claude to make a plan using the Claude Agent SDK, the ExitPlanMode tool_use block has an empty input field.

This effectively means that Claude Code is not returning the plan to the user. Previously, the plan that Claude generated would be in this input field with format input: {"plan": "<some-plan-here>"}.

What Should Happen?

The Claude Agent SDK should return an input block with the resulting plan.

Error Messages/Logs

Full SDK logs: 

[2025-11-24T20:54:44.020Z] {
  "type": "assistant",
  "message": {
    "model": "claude-opus-4-5-20251101",
    "id": "msg_017e2j7Cgo6nPveSEXPFi49B",
    "type": "message",
    "role": "assistant",
    "content": [
      {
        "type": "tool_use",
        "id": "toolu_01DZVSfTvie8owEVhnS4EP7Y",
        "name": "ExitPlanMode",
        "input": {}
      }
    ],
    "stop_reason": null,
    "stop_sequence": null,
    "usage": {
      "input_tokens": 1,
      "cache_creation_input_tokens": 1108,
      "cache_read_input_tokens": 20452,
      "cache_creation": {
        "ephemeral_5m_input_tokens": 1108,
        "ephemeral_1h_input_tokens": 0
      },
      "output_tokens": 1,
      "service_tier": "standard"
    },
    "context_management": null
  },
  "parent_tool_use_id": null,
  "session_id": "b1eb90ac-9c78-4e64-8574-97a4929ca4e1",
  "uuid": "3f192f9f-7518-4eb1-8758-9bb1d86c517b"
}
[2025-11-24T20:54:44.048Z] [CC-SDK-STDERR]: 2025-11-24T20:54:44.048Z [ERROR] "ZodError: ZodError\n    at error (/$bunfs/root/claude:77:18464)\n    at parse (/$bunfs/root/claude:77:11726)\n    at w67 (/$bunfs/root/claude:4010:4667)\n    at async <anonymous> (/$bunfs/root/claude:4010:6182)\n    at async <anonymous> (/$bunfs/root/claude:4432:680)\n    at async <anonymous> (/$bunfs/root/claude:4435:1537)\n    at async Jt8 (/$bunfs/root/claude:2149:23658)\n    at processTicksAndRejections (native:7:39)"
[2025-11-24T20:54:44.048Z] [canUseTool] ExitPlanMode detected for session d638be6a-54ee-4483-b6a9-c931b30364cf

Steps to Reproduce

  1. Ask Claude Code to make a plan using the SDK with permissionMode: "plan"
  2. Notice that the tool_use block with name set to ExitPlanMode will have an empty input field

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.34

Claude Code Version

2.0.51

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Non-interactive/CI environment

Additional Information

The last version we tested on was v2.0.34. We have not bisected versions further than that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoncall

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions