Skip to content

read: measure and A/B a more compact line-numbered output (eval-gated) #247

Open

Description

@byapparov

Problem

The read tool wraps every file in <path>, <type> and <content> tags and prefixes every line with its number (41: ). In the headless benchmark an 800-line, 48 KB file costs 11,299 tokens in aictrl against 9,661 in pi, which returns the raw text: about 17% more per read. The gap repeats on every later call while the file stays in the history; over a 50-read session aictrl sent 14.6M input tokens against pi's 12.4M.

The fixture has short (60-character) lines, so this is the upper bound; on typical source code the share is smaller.

Keep line numbers

Line numbers let the model cite file:line exactly (needed to place an inline review comment) and make line-range edits without counting. Removing them is not the goal.

Proposal (eval-gated)

  1. Measure the overhead on real repositories: tokens of the current format vs raw text, per language, over a sample of files.
  2. A/B compact formats on the code-review and fix templates, with task outcome, citation accuracy (comment lands on the right line) and tokens:
    • current: <path>…</path><type>file</type><content> + N: line;
    • no envelope: a one-line header (path (lines a-b of n)) + N: line;
    • numbers only where a range starts, or every 10th line (if citation accuracy holds).
  3. Ship the smallest format that keeps citation accuracy and outcomes.

Acceptance

  • Overhead on real code measured and posted here.
  • A/B results posted (outcome, citation accuracy, tokens); the format change ships only with that evidence.

Related: #153, #158.

Activity

  1. added
    enhancement
    P2
    performance
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2enhancementperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions