---
created: 2026-04-18T12:03:42.819Z
promoted: 2026-05-10
promoted_to: Phase 24 (v1.8 Psyche Restructure)
title: Organize psyches/tracked by agent + add psyche sessions file
area: psyche
files:
  - src/common/owlery.rs:62
  - src/live/start.rs:166
  - src/owl/doctor.rs:58
  - src/live/wrapper
---

## Problem

Two related observability gaps in psyche tracking:

1. `spt/psyches/tracked/` is a flat directory. Multiple self agents dump logs together, making it hard to find a specific agent's history.
2. No structured record of when fresh (non-`--resume`) psyche sessions are launched. Each new `claude -p` invocation without `--resume` starts a new Claude session ID, but there's no rollup showing which session IDs belong to which generation.

## Solution

**Part 1 — Sort tracked dir by agent:**
- Change layout from `spt/psyches/tracked/<file>` to `spt/psyches/tracked/<self_id>/<file>`.
- Update: `src/common/owlery.rs:62` (tracking dir helper), `src/live/start.rs:166` (archive path), `src/owl/doctor.rs:58` (doctor subdir check).
- Migration: move existing files into subfolders by parsing agent ID from filename, or let them linger as legacy.

**Part 2 — Psyche sessions file:**
- Wrapper maintains `spt/psyches/tracked/<self_id>/sessions-<gen>.log` (or similar).
- Each time wrapper spawns a fresh `claude -p` without `--resume`, append: timestamp, session ID, gen, trigger reason.
- On new generation (fresh `/spt:live start` or `/spt:revive`), commit old sessions file (rotate/rename) and start a new one.
- Keeps a human-readable audit trail of "which Claude session IDs this generation produced."
