Skip to content

Owner question: may the cleaner delete idle agent session scratch (about 24 GB)? #466

Closed

Description

@scuttletoby

Owner question. My recommendation: yes.

May the cleaner delete old agent session scratch folders? This frees about 24 GB on the shared machine now. The space comes back every few days.

What would be deleted: the per-session scratch folder Claude Code makes under /tmp. Only sessions whose transcript has not changed for 3 days, and only when no process is working in the folder or holding a file in it open.

What is never deleted:

  • the transcripts themselves
  • Codex sessions and T3 databases
  • any git folder in a scratch folder that has unpushed commits or uncommitted changes (these are kept and listed instead)

Why it needs your yes: the current cleaner skips these folders on purpose. Claude Code's own contract says the scratch folder may be cleared, but your earlier rule kept them.

State question:

  • Run again: nothing is left to do.
  • Stopped half-way: a partly deleted scratch folder, which the next run finishes.
  • In use: skipped.

Reply yes or no. The study is in the orchestrator's research notes (storage, 2026-11-18). The rule ships with the general cleaner (#470).

🤖 Generated with Claude Code

Activity

  1. scuttletoby commented on Nov 18, 2026

    @scuttletoby
    OwnerAuthor

    Owner decision (in chat, 2026-11-18): yes, with one condition from the owner: before raw data is deleted, check whether anything in it is worth keeping for analysis. If so, analyse it and save the analysed output first; only then delete the raw data. Do not analyse what is not worth keeping.

    🤖 Generated with Claude Code

  2. scuttletoby commented on Nov 21, 2026

    @scuttletoby
    OwnerAuthor

    Done: the agent-scratch rule in fork-kit/cleaner copies the files worth keeping out first (keepFirst.patterns), reads the copy back, and only then deletes (README section on keep-first, rules.py KeepFirstError).

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions