DistilCodeAll techniques

Technique 09 / 14 · Noise reduction

Grep/glob compressor

Keep a broad search from returning every match in build output and node_modules.

Interactive model

See the context change.

grep -rn "useAuth" . in a web app with build output and dependencies.

Grouped8 files + note

grep -rn "useAuth" .

  1. 01

    src/hooks/useAuth.ts (4)

  2. 02

    src/pages/Account.tsx (2)

  3. 03

    src/components/Nav.tsx (3)

  4. 04

    ⋮ 5 more files

  5. 05

    +3 more files, 80 matches capped

Conceptual demonstration. Counts illustrate the flow, not measured production savings.

How it works

Less context. Same thread of work.

A broad grep or glob can return hundreds of matches, many from bundles, coverage reports and dependencies. DistilCode groups results by file with a match count and the first matching line, so the agent sees where a name lives before it sees every occurrence.

Long result lists are capped, and a note says how many files and matches were left out. viewraw lists them all when the agent needs the complete set.

In practice

The operating loop

  1. 01

    Group by file

    Each file appears once, with its match count and first match.

  2. 02

    Cap the list

    Runaway results stop at a fixed number of files.

  3. 03

    Say what was cut

    A note counts the omitted files and matches, and viewraw returns them.