Skip to content

Add support for filtering vite build output (rtk vite) #2744

Description

@redhoyurizal

Feature request: rtk vite (filter vite build output)

Problem

vite build is one of the most frequent unhandled commands in my Claude Code
sessions — it showed up 6 times in a 30-day rtk discover scan and is the
top unhandled command by impact. Its output is verbose: a full per-asset table
(every chunk, gzip size, map files), Rollup warnings, and build timing. When this
lands in an agent's tool_result, most of it is noise — the agent only needs:

  • success / failure
  • any errors or warnings
  • maybe the total bundle size + largest chunks

Example output (what gets sent to the model today)

vite v6.3.5 building for production...
✓ 1234 modules transformed.
dist/index.html                   0.46 kB │ gzip:  0.30 kB
dist/assets/index-a1b2c3.css     12.34 kB │ gzip:  3.21 kB
dist/assets/vendor-d4e5f6.js    142.11 kB │ gzip: 45.67 kB
dist/assets/index-g7h8i9.js      88.02 kB │ gzip: 28.44 kB
... (dozens more rows)
✓ built in 7.04s

Proposed behavior

rtk vite build (and rtk npm run build when it resolves to vite) should:

  1. On success: collapse the asset table to a summary —
    total modules, total bundle size (raw + gzip), top N largest chunks,
    build time. Drop the long per-file listing.
  2. On warning: preserve warnings verbatim (Rollup circular deps,
    "chunk larger than 500 kB", etc.) — these are actionable.
  3. On failure: pass through the full error + stack untouched.
  4. Respect a verbosity flag (e.g. --full) to bypass filtering when needed.

Why it matters

  • Build output is mostly a fixed-format table → high, safe compression ratio.
  • It's a recurring command in any frontend project, so savings compound.
  • Errors/warnings (the parts the agent actually acts on) are short and preserved.

Environment

  • rtk version: 0.43.0
  • vite version: 6.3.5
  • Used via Claude Code Bash hook (rtk hook claude)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions