Skip to content

[FEATURE] Read tool's 25k token limit is too conservative and easily bypassed #15687

Description

@davidszp

When attempting to read a moderately-sized file (e.g., a 65k token academic paper PDF text), the Read tool refuses with:

Error: File content (65113 tokens) exceeds maximum allowed tokens (25000).
Please use offset and limit parameters to read specific portions of the file,
or use the GrepTool to search for specific content.

The workaround defeats the limit's purpose:

Users can simply use Bash instead:

cat file | head -c 30000
cat file | tail -c +30000 | head -c 30000
# etc.

This workaround actually uses more total tokens than a single Read call would (multiple tool calls, repeated context, overhead).

The limit is very conservative:

  • Models have ~200k context windows
  • 25k is ~12% of available context
  • Many legitimate files (papers, large source files, logs) exceed this

Suggestion:

  1. Raise the default limit, or make it configurable
  2. Consider allowing users to specify a cheaper model (Haiku/Sonnet) for large file reads in exchange for more permissive limits - users may prefer trading off model capability for the ability to ingest more content in a single read

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions