---
title: "Sweep Project Worktrees"
method: POST
path: "/projects/{project_id}/worktrees/sweep"
---

# Sweep Project Worktrees

`POST /projects/{project_id}/worktrees/sweep`

## Request

- Base URL: `https://usemeridian.us` (the document declares no server; this is the origin it was published from)
- URL: `https://usemeridian.us/projects/{project_id}/worktrees/sweep`
- Auth: none declared

a03c0eeb — on-demand real disk cleanup for this project's worktrees.

Reclaims any active_worktrees row whose owning sprint item/session has
already reached a terminal state but whose directory was never actually
removed from disk (see `worktree_cleanup.sweep_stale_worktrees`). This is
the same pass the server runs periodically; exposed here so a
post-integration trigger (e.g. the Stop-hook sprint guard, once a
session's pending sprint items hit 0) doesn't have to wait for the next
periodic tick. Self-hosted only — hosted (multi-tenant) mode has no
filesystem access to the caller's worktrees and returns a no-op summary.

## Path parameters

- `project_id` string, required

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/usemeridian/apis/meridian.md) · [All operations](https://skmtc.dev/usemeridian/apis/meridian/llms.txt) · [OpenAPI document](https://skmtc.dev/usemeridian/apis/meridian/revisions/f37a894bd374?raw)
