# Cut build output: remove unused code and split bundles

A build artefact heavier than it needs to be, reduced with size measured either side.

Category: Build, containers, and artifacts
Source: https://letsship.ai/use-cases/cut-build-output
Published: 2026-08-25

## Goal

Reduce build output size through pruning, tree-shaking, and splitting.

## Acceptance criteria

- Size is measured before and after
- Removed code is confirmed unused
- Behaviour is unchanged, proven by the suite
- The largest remaining contributors are listed for follow-up

## What lands as proof

Size measurements either side plus a green suite, so the reduction is not paid for in behaviour.

## 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: Cut the build output for {target}

Description: Reduce build output size through pruning, tree-shaking, and splitting.

Acceptance criteria:
- Size is measured before and after
- Removed code is confirmed unused
- Behaviour is unchanged, proven by the suite
- The largest remaining contributors are listed for follow-up

Before you create the issue, measure this repository's build output and identify the largest contributors. Replace {target}.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: reduce build output size through pruning, tree-shaking, and splitting. 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 size measured before and after in the pull request, 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.
