claude-code - 💡(How to fix) Fix Explore subagent rejects short prompts with "Prompt is too long"; general-purpose accepts same prompt [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#52400Fetched 2026-04-24 06:08:11
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Agent({ subagent_type: "Explore", prompt: "<ANY TEXT>" }) consistently returns Prompt is too long in a project where subagent_type: "general-purpose" with an identical prompt runs successfully and returns the expected result. This blocks Plan-mode Phase 1, which per the harness instructions is only supposed to use Explore.

Error Message

  • Explore rejects a ~16-word prompt with the same "too long" error it returns for ~400-word prompts.
  • 0 tool uses is the confusing failure mode — the agent appears Done but did nothing. No error is surfaced.
  • At minimum, the error should clearly indicate which component exceeded budget (user prompt vs. ambient context vs. tool schemas) so users can respond.

Root Cause

Agent({ subagent_type: "Explore", prompt: "<ANY TEXT>" }) consistently returns Prompt is too long in a project where subagent_type: "general-purpose" with an identical prompt runs successfully and returns the expected result. This blocks Plan-mode Phase 1, which per the harness instructions is only supposed to use Explore.

Fix Action

Workaround

Substitute subagent_type: "general-purpose" everywhere Explore is documented. Slightly more expensive per call (larger tool list loaded) but functionally equivalent for read-only research.

Code Example

Agent({
     subagent_type: "Explore",
     description: "Minimal test",
     prompt: "Read /path/to/repo/package.json. Report the \`name\` field only."
   })

---

Agent({
     subagent_type: "general-purpose",
     description: "Minimal test general-purpose",
     prompt: "Read /path/to/repo/package.json. Report the \`name\` field only."
   })
RAW_BUFFERClick to expand / collapse

Description

Agent({ subagent_type: "Explore", prompt: "<ANY TEXT>" }) consistently returns Prompt is too long in a project where subagent_type: "general-purpose" with an identical prompt runs successfully and returns the expected result. This blocks Plan-mode Phase 1, which per the harness instructions is only supposed to use Explore.

Reproduction

Environment:

  • Claude Code CLI (latest as of 2026-04-23)
  • macOS (Darwin 25.3.0)
  • Model: Claude Opus 4.7 (1M context)
  • Project has several MCP servers active, plus a CLAUDE.md and project-level MEMORY.md. Ambient context is substantial but well within normal Opus 4.7 budgets.

Steps:

  1. In an existing Claude Code session with several MCP servers registered, launch:
    Agent({
      subagent_type: "Explore",
      description: "Minimal test",
      prompt: "Read /path/to/repo/package.json. Report the \`name\` field only."
    })
  2. Result: Prompt is too long (instant rejection, zero tool uses).
  3. In the same session, launch the same prompt with subagent_type: "general-purpose":
    Agent({
      subagent_type: "general-purpose",
      description: "Minimal test general-purpose",
      prompt: "Read /path/to/repo/package.json. Report the \`name\` field only."
    })
  4. Result: succeeds. 1 tool use, ~5 s duration, ~43 K total tokens reported.

Evidence it is not user-prompt size

  • Explore rejects a ~16-word prompt with the same "too long" error it returns for ~400-word prompts.
  • Three earlier Explore calls with ~150-word prompts were accepted but returned with 0 tool uses — i.e., the agent produced no output. Same session, same ambient context. So the threshold is either non-deterministic or measured inconsistently.
  • The exact same 16-word prompt to general-purpose works with ~43 K total tokens. Ambient context is therefore within budget for general-purpose but exceeds it for Explore.

Hypothesis

Either:

  1. Explore has a smaller hardcoded input-token budget than general-purpose, even though its tool allowlist is a subset (fewer tool schemas → should have more headroom), OR
  2. Explore's size check counts something differently (e.g., double-counts the skills list or MCP instructions).

Impact

  • Plan-mode Phase 1 documentation says "you should only use the Explore subagent type." When Explore rejects all prompts, plan-mode investigation is forced to either (a) use general-purpose (contradicting harness guidance) or (b) investigate inline without delegation. Users hit a silent dead-end unless they try a different subagent type.
  • 0 tool uses is the confusing failure mode — the agent appears Done but did nothing. No error is surfaced.

Workaround

Substitute subagent_type: "general-purpose" everywhere Explore is documented. Slightly more expensive per call (larger tool list loaded) but functionally equivalent for read-only research.

Suggested fix

  • At minimum, the error should clearly indicate which component exceeded budget (user prompt vs. ambient context vs. tool schemas) so users can respond.
  • Ideally, Explore's budget should be at least as large as general-purpose's, since it has a strictly smaller tool allowlist.
  • If the silent "0 tool uses" path is distinct from the "Prompt is too long" reject, worth checking whether these are two related or independent regressions.

extent analysis

TL;DR

The issue can be worked around by substituting subagent_type: "general-purpose" for "Explore" due to a potential input-token budget discrepancy.

Guidance

  • Verify the input-token budget for both "Explore" and "general-purpose" subagent types to confirm the discrepancy.
  • Test the "Explore" subagent type with a minimal prompt and no ambient context to isolate the issue.
  • Consider implementing a clear error message that indicates which component exceeded the budget.
  • Review the tool allowlist for "Explore" to ensure it is a subset of "general-purpose" and adjust the budget accordingly.

Example

No code snippet is provided as the issue is more related to configuration and budgeting.

Notes

The root cause of the issue is unclear, but it appears to be related to the input-token budget for the "Explore" subagent type. The workaround of using "general-purpose" may have performance implications due to the larger tool list loaded.

Recommendation

Apply the workaround by substituting subagent_type: "general-purpose" for "Explore" until the input-token budget issue is resolved, as it provides a functional equivalent for read-only research.

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