Skip to content

[Bug] /dev-story's "Read ADR fully" instruction fails on ADRs >25k tokens, forcing offset/limit retries that double the read cost #64

Description

@Shtruk

Description

The Claude Code Read tool caps file content at 25,000 tokens per call.
/dev-story Phase 2 instructs Read("docs/architecture/[adr-file].md")
unconditionally. ADRs for non-trivial architectural decisions routinely
exceed this cap (35k+ tokens is common when the ADR includes detailed
Implementation Guidelines, Engine Compatibility tables, and Amendments).

The result is a failed Read, an error message instructing the agent to
retry with offset/limit, and 2-3 follow-up reads to assemble the
file in chunks. Total token cost: ~30k of input tokens spent on
failed-read errors + retry reads — roughly double what a successful
single Read would have consumed.

This compounds Issue #63: not only is the full ADR re-read redundant
per /create-stories' contract, it's also pathologically expensive on
realistic ADRs.

Steps to Reproduce

  1. Create an ADR with substantial Implementation Guidelines + Amendments
    sections (target ~35k tokens / ~250 lines of dense prose)
  2. Generate stories via /create-stories referencing that ADR
  3. Run /dev-story on one of the stories
  4. Observe the Read call on the ADR fails with:
    File content (35000+ tokens) exceeds maximum allowed tokens (25000). Use offset and limit parameters to read specific portions of the file...
  5. Agent then issues offset+limit Reads to recover

Expected Behavior

Skills that need ADR content should use targeted reads (grep for
specific sections, or Read with offset/limit for known section
boundaries) rather than unbounded full-file reads.

Actual Behavior

Phase 2 instructions assume Read returns the full file; no
preconditioning for large ADRs.

Environment

  • Template version: v1.0.0 (commit 984023d)

Affected Component

  • Skill: dev-story
  • Documentation: skill prescribes a read pattern that doesn't scale

Additional Context

Real-world example: a project with ADR-0007 (~35k tokens) and ADR-0009
(~35k tokens), both referenced by stories. Each /dev-story invocation
incurred ~60k of failed-read + retry overhead before implementation even
started. The Issue #63 fix (use story-embedded Decision Summary)
incidentally resolves this symptom; if Issue #63's fix is not adopted,
this issue should still be addressed with targeted Read patterns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions