--- id: agent-coordination/an-agent-cannot-learn-its-own-session-id title: 'An agent cannot learn its own transcript id, so it cannot sign its own work' theme: agent-coordination status: open created: 2026-08-23 date_source: stated order: 2 --- **An agent has no reliable way to find out its own transcript id**, which blocks the commit convention in `CLAUDE.md` — "an agent's commit names the session that made it." Searched on 2026-08-23. No environment variable carries it. `~/.claude/sessions/` is keyed on process id, not transcript. The only exposure found is indirect: a background task's output path contains it (`/tmp/claude-1000///tasks/.output`), so an agent can learn who it is by starting a job it does not need and reading the path back. That works and it is absurd. **The mechanism already exists for one case.** `commanderBlock` in `api/command-hq/commander-block.ts` hands a commander its own transcript id, because a commander needs it to write its pid and spawned records. So the platform knows the id at turn time and can already put it in a preamble — it just does that for commanders only. What to build: give every session its own id the same way. One line in whatever preamble a session already receives, phrased as a fact rather than an instruction. Two things to get right: - **The transcript id, never the session name.** Names are renamed by restarts — two sessions were renamed in one night on 2026-08-23 — and a commit trailer naming something that no longer exists is worse than no trailer. - **It unblocks more than the trailer.** The delegation problem in this theme is keyed on transcript ids too, and a manager cannot record "I am X" in a delegation row it cannot name itself in. Until it lands: an agent that happens to know its id adds the trailer, and one that does not leaves it out rather than guessing.