# Run only the tasks the diff affects

A pipeline that rebuilds everything for a one-line change, narrowed to what the diff touches.

Category: Pipeline speed and cost
Source: https://letsship.ai/use-cases/run-only-affected-tasks
Published: 2026-08-25

## Goal

Make the pipeline run only the tasks affected by the diff.

## Acceptance criteria

- Affected-task selection is derived from the dependency graph, not a path allowlist
- A full and an affected run are compared on the same commit
- The main branch still runs everything
- Selection failures fall back to running everything

## What lands as proof

A full run and an affected run on the same commit, showing the same result with different durations.

## 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: Run only affected tasks in CI

Description: Make the pipeline run only the tasks affected by the diff.

Acceptance criteria:
- Affected-task selection is derived from the dependency graph, not a path allowlist
- A full and an affected run are compared on the same commit
- The main branch still runs everything
- Selection failures fall back to running everything

Before you create the issue, check whether this repository's tooling can compute affected tasks and say so in the description.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: make the pipeline run only the tasks affected by the diff. 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 full and affected runs compared on the same commit, so a reviewer can confirm the result without reproducing the work locally.

### How much oversight does this need?

The run stops for the plan, and the review bar is raised afterwards so that smaller suggestions block the merge too, not only serious findings.
