025. A Claude process holds its task folder open
- Date
- 2026-10-30
- Agents
- Claude Code
- Measured on
- real machine
Measured
2026-10-30, Claude Code 2.1.310 and 2.1.314, on Linux (Debian 13, x64).
Two live interactive sessions in tmux. readlink read each entry of
/proc/<pid>/fd.
Measured on: real machine.
What was measured
- A Claude process holds no transcript file open.
- It holds one folder open:
/tmp/claude-<uid>/<project key>/<session id>/tasks. The session ID in that path is thesessionIdof~/.claude/sessions/<pid>.json(fact 023). - Its other descriptors are its tty (8 descriptors), sockets, and
anon_inodeentries (eventpoll,eventfd,pidfd).
Mechanism
A reader that can read the open files of a process, but not the home folder of its user, can still get the session ID from the task folder.
Incident
None.
Screens
None.
Not measured
- Whether the folder changes after
/clear. - Sessions with no background task. Both sessions had run tasks.
- The path on macOS and Windows, where the temporary folder is different.
2026-10-30, 2.1.314: before the first task, and after /clear
Measured on: real machine. Scenario scenarios/claude/dialog-states.sh
(three runs) in a throwaway HOME, on the same Linux machine.
- Before the first Bash tool call, the process held no folder below
/tmp/claude-<uid>/open, and thetasksfolder did not exist. The first Bash call made the folder and opened it. That call was a foregroundls, not a background task (fact 034). - After
/clear, the process still held thetasksfolder of the first session ID. A background task after/clearwrote its output there. So the session ID in the path is the first session ID of the process, not always thesessionIdof the pid file. The Mechanism above is correct only for a process that has had one session (fact 034).