Status: current cross-Agent presentation and cleanup-impact model
Last reviewed: 2026-08-28
CleanerX uses a common forest model for storage navigation:
Agent
└── Verified project / repository root
├── Root session
│ ├── Branch, fork, or child session
│ └── Subagent session
└── Another root session
A project can contain multiple independent root sessions, so this is a forest rather than a strict single tree. Sessions with no known parent stay at the project root. Unknown or missing project associations are kept under an explicit “No project” virtual root instead of being discarded. This node is presentation-only: it is not written to the Agent's project registry and selecting it selects only visible, eligible session data.
| Agent | Official hierarchy signals | CleanerX mapping |
|---|---|---|
| Codex | App Server thread/list exposes parentThreadId / ancestorThreadId; thread/delete removes a thread and its spawned descendants. |
Project root → root thread → child/subagent threads. |
| Claude Code | Sessions are associated with a project bucket. Forked sessions have independent IDs; subagent transcripts are stored beneath their parent session directory. | Project bucket → independent root sessions. Forks remain sibling roots because the documented transcript metadata does not expose a stable parent-session ID; subagent files are included in the owning session's cleanup impact rather than invented as selectable sessions. |
| OpenCode | The recognized official SQLite schema records project_id and parent_id; the public server exposes child-session and fork routes, and official deletion recursively removes children. |
Official project record → root session → child/fork sessions. The project worktree and session directory are grouping metadata only and are never scanned. |
| pi | Session JSONL entries use id and parentId, and session files can reference a parentSession; /tree, /fork, and /clone expose branching. |
Working-directory bucket → session files. A parentSession reference to another inventoried file is shown as its tree child, but never expands into a deletion descendant because removing one pi session file never removes another. Message-entry branching is intentionally not shown in CleanerX MVP. |
Official references:
- Codex App Server protocol
- Codex projects and chats
- Claude Code sessions
- Claude Code subagents
- OpenCode agents
- OpenCode server session APIs
- pi session format
- pi session navigation
- Tree view is the default on the Sessions page. Project roots are grouping nodes there; CleanerX does not maintain a duplicate Projects page.
- Sessions page retains a flat list toggle for sorting, comparison, and large-result workflows.
- “Recent” is an updated-time filter (currently last 7 or 30 days), not a durable tree node. Its membership changes over time and never creates or changes a project association.
- Filtering a child keeps its ancestor rows as non-selectable context.
- Project selection operates only on associated Agent data; it never selects or traverses the source directory.
- Session title,
cwd, and project association remain independent. A title is never synthesized from thecwddirectory name, and a title does not establish project membership. - A session
cwdis shown as recognition metadata but does not by itself create a project association. CleanerX requires a recognized Codex project root or an ancestor Git marker; standalone desktop chat workspaces therefore remain under “No project.” - For Claude Code, the documented
projects/<project>/bucket is positive association evidence. CleanerX groups every recognized UUID transcript in that bucket together, records absolute transcriptcwdvalues as display roots, and never traverses or mutates those roots. Sessions without a usablecwdmay still inherit the verified bucket group. - For OpenCode, a recognized
session.project_idjoined to the officialprojecttable is positive association evidence. CleanerX usesparent_idtransitively, detects cycles, and includes every known descendant in the review and encrypted export set while invoking official deletion only for the minimal roots. A verified loopback Server API status map applies to the full expanded tree, so an active descendant blocks deletion of its ancestor. - For pi, the documented
sessions/--<working-directory>--/bucket is positive association evidence. CleanerX groups every recognized session file in that bucket together and records the session headercwdas a display root. AparentSessionreference to another inventoried file is shown as tree lineage, but pi file deletion never cascades, so a fork is never included as a deletion descendant of its parent. - The “No project” virtual root sorts sessions by most recent update. A known
cwdmay be shown only as recognition metadata; an absentcwdis displayed explicitly and is never inferred from CleanerX's working directory. - A parent cleanup remains explicit. The confirmation plan expands and displays every descendant that the Agent's official delete operation will also remove.
- CleanerX does not inspect message bodies while building the hierarchy. Codex content can be loaded on demand in a bounded detail view; Agent-specific entry-level branching, such as pi's internal message tree, remains out of scope for the MVP hierarchy.