# Measure unused CSS and JavaScript on one route

Bytes shipped and never executed on one route, measured with coverage and removed.

Category: Audits and budgets
Source: https://letsship.ai/use-cases/measure-and-remove-unused-code
Published: 2026-08-25

## Goal

Measure unused CSS and JavaScript on one route and remove what nothing needs.

## Acceptance criteria

- Coverage is measured before and after
- Removed code is confirmed unused across the route's interactions, not just on load
- Rendered output is unchanged, shown by a visual comparison
- Byte savings are recorded

## What lands as proof

Coverage measurements either side plus a visual comparison, since coverage alone misses interaction-only code.

## Prompt

Copy this to an agent to open the ticket:

```text
Create a Linear issue in my team and assign it to the SHIP agent.

Title: Remove unused code from {route}

Description: Measure unused CSS and JavaScript on one route and remove what nothing needs.

Acceptance criteria:
- Coverage is measured before and after
- Removed code is confirmed unused across the route's interactions, not just on load
- Rendered output is unchanged, shown by a visual comparison
- Byte savings are recorded

Before you create the issue, run a coverage profile on one of this repository's routes and replace {route}.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: measure unused CSS and JavaScript on one route and remove what nothing needs. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.

### How do I know the work is done?

The pull request carries the evidence, not only the diff. Here that means unused bytes reported before and after, so a reviewer can confirm the result without reproducing the work locally.

### How much oversight does this need?

The run stops once the plan is written. Somebody reads the approach and approves it before any code exists, which is the cheapest moment to redirect the work.
