compozy session cleanup
Delete archived sessions in bulk, in the background
574 pages in CLI Reference
Usage
compozy session cleanup [flags]Subcommands2
- statusShow the running or most recent archived-history cleanup
- stopStop the running archived-history cleanup; what it deleted stays deleted
Examples4
Preview what a cleanup of the current workspace would delete
compozy session cleanupDelete every thread archived more than 30 days ago, across all workspaces
compozy session cleanup --older-than 30 --all-workspaces --yesKeep main sessions; delete only their archived subagents
compozy session cleanup --subagents --any-time --yesFollow or stop the running cleanup
Terminalcompozy session cleanup status compozy session cleanup stop
Options11
- --all-workspaces
- Clean up every project and User scope
- --any-time
- Pick every archived thread, whenever it was archived
- --beforestring
- Pick threads archived before this date: YYYY-MM-DD (local midnight) or RFC 3339
- --children
- Delete archived child sessions, keeping main sessions
- --everything
- Delete picked threads whole: main sessions, child sessions, and subagents (the default)
- --help-h
- help for cleanup
- --older-thanint
- Pick threads archived more than this many days ago (default 7)
- --sessionstrings
- Limit the cleanup to these archived main sessions, as a retry of failed threads does
- --subagents
- Delete archived subagents, keeping main sessions
- --workspacestring
- Workspace ID, name, or path (defaults to the current workspace)
- --yes
- Delete; without it the command only previews
Inherited options3
- --json
- Emit JSON output
- --output-ostring
- Output format: human, json, jsonl, or toon (default "human")
- --profilestring
- Act as a profile for this command
Synopsis
Plan a cleanup of the profile's archived sessions and, with --yes, delete them in the daemon's background. Without --yes it only previews what would go. Only archived sessions are deleted: child sessions still in the session list or in Later stay, with everything under them. Worktrees stay, as with a single delete. By default it picks threads archived more than 7 days ago in the current workspace and deletes them whole.
Output Formats
The root -o, --output flag accepts these values. A renderer is supported only when this command writes that result; jsonl is for commands that emit one JSON record per line.
| Format | Command result |
|---|---|
human | Interactive terminal rendering |
json | Machine-readable JSON rendering |
jsonl | One JSON record per line when supported |
toon | Compact agent-readable rendering |
Example:
compozy session cleanup -o json