# Remove commented-out code left behind by old changes

Blocks of code kept in comments just in case, removed because the history already keeps them.

Category: Dead code and stale content
Source: https://letsship.ai/use-cases/remove-commented-out-code
Published: 2026-08-25

## Goal

Delete commented-out code blocks, relying on version history to preserve them.

## Acceptance criteria

- Commented-out code blocks are removed
- Explanatory comments are kept and left untouched
- No behaviour changes
- Anything genuinely worth keeping is moved into a comment that explains why

## What lands as proof

A diff containing only deletions of dead blocks, with real comments untouched.

## 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 commented-out code from {area}

Description: Delete commented-out code blocks, relying on version history to preserve them.

Acceptance criteria:
- Commented-out code blocks are removed
- Explanatory comments are kept and left untouched
- No behaviour changes
- Anything genuinely worth keeping is moved into a comment that explains why

Before you create the issue, search this repository for commented-out code blocks and replace {area} with the densest file or directory.
```

## Questions

### What does the agent actually change?

The ticket is scoped to one outcome: delete commented-out code blocks, relying on version history to preserve them. 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 only live code remains, the history keeps the rest, so a reviewer can confirm the result without reproducing the work locally.

### How much oversight does this need?

None is required before the run starts. Every claim this ticket makes can be checked by machine, so the agent works straight through and a person reviews the finished pull request like any other.
