Skip to content

fix(evals): plugin-eval leaves TMPDIR roots and sealed sandboxes in the home directory #17061

Closed

Description

@kyle-sexton

Problem

evals:plugin-eval tells a run on Linux/WSL2 to set TMPDIR to a directory of at most 24 characters outside the system temp directory (skills/plugin-eval/reference/sandboxes.md, "Sandbox start"). It names no location, so agent sessions create one ad hoc under $HOME: on one WSL lane, 2026-11-09 to 2026-11-18, about 350 top-level directories accumulated in the home directory (~/.ev-<n>-a, ~/.ev-p<n>-b, ~/.evc-<n>, ~/.evso, ~/.ev-knobs, ...), plus more under ~/worktrees/.ev<n>.

Each ~/.ev-* holds claude-eval-* sandboxes whose sealed/ subdirectory is unreadable (dr-x------ parent, sealed/ not enterable), so du, find and general cleanup tools fail on them. The ~/.evc-* siblings hold staged before//after/ plugin copies for the A/B arms and have no removal step at all.

Removal only happens in "Removing a read's sandboxes", which runs after a read, per run, by the owning session. A run that never reaches a read, or a session that ends first, leaves everything behind, and nothing ever removes the TMPDIR root or the staged .evc-* copies. Of the directories I matched to an issue or PR number, about 260 belong to work already merged or closed.

Proposed fix

  1. Name one fixed, short root for eval TMPDIRs (for example $HOME/.ev/<run-id>, which stays under 24 characters for typical home paths), and put staged plugin copies under the same run directory.
  2. At the end of every run, not only after a read, remove that run's directory (the existing chmod + rm -rf loop, scoped to the run root), unless --keep-temp was asked for.
  3. Have preflight report leftover run roots under the fixed root older than N days, so a crashed session's directories are visible to the next one.

Cause: UNVERIFIED that every directory came from this skill, but the layout (claude-eval-*/{out,sealed,config}) and the 24-character naming fit it.

🤖 Generated with Claude Code

Activity

  1. added
    needs-triage
    on Nov 18, 2026
  2. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor

    Size: Medium
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: none
    Blast radius: plugins/evals plugin-eval SKILL.md and reference/sandboxes.md (temp root, closing step, preflight report, removal loop); read by anyone running plugin-eval.
    Reversible: yes; revert the doc and instruction edits.
    Open questions: none
    I understood this as: plugin-eval leaves TMPDIR roots and sealed sandboxes in the home directory because it names no fixed root and removes only after a read. The trusted confirmed done-when in the later comment already picks the design (required $HOME/.ev/<short-run-id> root, a closing-step removal not keyed on --keep-temp, a report-only preflight listing of run roots older than 3 days, and a second scoped removal loop). It is exact, so I treat it as settled and ask nothing more. One note: the owner comment starts with **Decision recorded.** but its first line carries extra text, so I did not apply the formal decision-recorded path. It made no difference to the outcome.
    Related: #15112 (age-based pruning of kept sandboxes) overlaps item 3 and stays open as narrowed in the comments, and #16797 may touch the same files. Neither blocks this issue, and no merged pull request already fixes it.

    Automated triage. A maintainer reviews it.

  3. removed
    needs-triage
    on Nov 18, 2026
  4. melodic-automation-lanes commented on Nov 18, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  5. melodic-automation-lanes commented on Nov 18, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: plugin-eval names one fixed on-disk TMPDIR root with a per-run directory, removes the run's directory when the run ends, and preflight reports stale run roots.

    Related work

    Open questions

    1. The default run command passes --keep-temp (SKILL.md:247) because the validity gate needs the traces. Item 2 removes the run directory at the end of every run unless --keep-temp was asked for. Should removal then wait until after the read, and be skipped only when the user asks to keep the run (a new opt-out), or should the run end with removal and the read be moved before it?
      RECOMMENDED: Remove the run directory after the read, or when the session stops without a read, and add an explicit user opt-out; do not key removal on --keep-temp, since the default always sets it. Basis: plugins/evals/skills/plugin-eval/SKILL.md:247
    2. Where do the staged before/after plugin copies (the ~/.evc-* directories) come from? No text under plugins/evals describes staging them, so item 1 and the removal step have nothing to edit for them. Which skill or procedure creates them, and should that one be changed or is this out of scope?
      RECOMMENDED: Limit this issue to the TMPDIR root and sandboxes in plugin-eval, and split the staged-copy layout into its own issue once its source is identified. Basis: judgment
    3. The skill already gives $HOME/.ev as an example <dir> (SKILL.md:256) but does not require it, and the issue proposes $HOME/.ev/<run-id>. Should the fixed root be made mandatory, and should <dir> be the per-run directory, which keeps the 24-character bound, or the shared root?
      RECOMMENDED: Make $HOME/.ev the required root, use $HOME/.ev/<short-run-id> as TMPDIR for each run, and keep the 24-character check on that per-run path. Basis: plugins/evals/skills/plugin-eval/SKILL.md:256
    4. Should preflight's stale-root report (item 3) be built here or by #​15112, and what age N in days applies? Preflight currently only probes <tmp>/claude-eval-* and prints no removal command (sandboxes.md:3-23).
      RECOMMENDED: Build the report here as report-only, with N set to 3 days, and let #​15112 be closed or narrowed to it. Basis: 15112
    5. Should the removal loop be extended to run roots? It currently refuses anything not a direct child of <tmp> named claude-eval-* (sandboxes.md:53), so a run directory under $HOME/.ev would be skipped.
      RECOMMENDED: Yes: add a second loop scoped to $HOME/.ev/<run-id> that checks it is a real directory and not a symlink, its realpath is a direct child of the realpath of $HOME/.ev, and it holds claude-eval-* children, with the same chmod then rm -rf handling of sealed/. Basis: plugins/evals/skills/plugin-eval/reference/sandboxes.md:53

    Sources read

    • plugins/evals/skills/plugin-eval/SKILL.md:247: the default run command passes --keep-temp
    • plugins/evals/skills/plugin-eval/SKILL.md:256: tells Linux/WSL2 runs to set TMPDIR to a directory of at most 24 characters outside the system temp directory, giving $HOME/.ev only as an example
    • plugins/evals/skills/plugin-eval/SKILL.md:52-61: preflight fields leftover_sandboxes and eval_tmpdir; preflight removes nothing and prints no removal command
    • plugins/evals/skills/plugin-eval/reference/sandboxes.md:3-23: the leftover probe covers only <tmp>/claude-eval-* with no age filter
    • plugins/evals/skills/plugin-eval/reference/sandboxes.md:25-71: removal happens only after a read, by results file, confined to claude-eval-* directly under <tmp>
    • plugins/evals/skills/plugin-eval/reference/sandboxes.md:73-78: the 24-character TMPDIR bound
    • grep of plugins/evals for .evc, .ev- and before/after staging: no text describes staged before/after plugin copies

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  6. kyle-sexton commented on Nov 21, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. Owner, 2026-11-20, typed in the owning session (verbatim): "I want to make sure that the recommendations are grounded in facts, data, metrics, and research from the latest consensus-based research from official, authoritative, and trusted sources, and just go with the recommendations there." The recommendation was checked against the code at origin/main and current official sources before this record; the decision below is the grounded one.

    Q117 (REVISED (sweep draft omits refinement Q4 and Q5; #15112 folds in, narrowed))

    Go with the refinement's five recommendations:
    (1) The run's closing step removes the run directory whether or not a read happened, after the read when there is one, unless the user opts out explicitly. A session that dies before that step is covered by (4). Removal is not keyed on --keep-temp, which the default run command always passes (SKILL.md:247).
    (2) Staged before/after plugin copies (~/.evc-*) are out of scope. Nothing in this repository creates them (git grep "evc" over origin/main finds nothing). If their source turns up, it gets its own issue.
    (3) $HOME/.ev is the required root, and each run's TMPDIR is $HOME/.ev/<short-run-id>. The 24-character check applies to that per-run path.
    (4) Preflight reports run roots under $HOME/.ev older than 3 days, with counts that include nested claude-eval-* sandboxes. It is report-only and keeps preflight's "removes nothing" rule.
    (5) A second removal loop is scoped to $HOME/.ev/<run-id>. It requires a real directory, not a symlink, whose realpath is a direct child of realpath $HOME/.ev and which holds claude-eval-* children. It uses the same chmod-then-rm -rf handling of sealed/.
    #15112 folds in only in part. Its "counts nested sandboxes" and "rule stated once in sandboxes.md" items are done here. Its age-based removal is not. The PR says Refs: #15112, and #15112 stays open, narrowed to removing whole run roots under $HOME/.ev by age. Per-run roots make that safer than the shared-<tmp> case sandboxes.md:17-22 warns about.

    Basis

      • origin/main plugins/evals/skills/plugin-eval/SKILL.md:247 (--keep-temp in the default run), :256 ($HOME/.ev only an example)
    • origin/main plugins/evals/skills/plugin-eval/reference/sandboxes.md:17-22: "Neither age nor the absence of a claude plugin eval process tells them apart". That is why age-based removal in a shared root is unsafe and the report stays report-only. :53 is the removal loop, confined to direct children of <tmp>.
    • evals: prune kept plugin-eval sandboxes under the eval temp root by age #15112 (read this session, OPEN): done-when asks for an age-based removal rule, nested counts, and the rule stated once in sandboxes.md, all under the same $HOME/.ev root
    • git grep -n -I -E "\.evc|evc-" origin/main: no output

    Dissent considered

    #15112's real problem (8,180 unread sandboxes, about 11 GB) needs removal, not a report. That is why it stays open, narrowed. N=3 days is judgment.

  7. kyle-sexton commented on Nov 21, 2026

    @kyle-sexton
    MemberAuthor

    Confirmed done-when for the decision above (owner direction of 2026-11-20 recorded there).

    • plugins/evals/skills/plugin-eval/SKILL.md makes $HOME/.ev the required eval temp root and sets each run's TMPDIR to $HOME/.ev/<short-run-id>, no longer giving $HOME/.ev only as an example.
    • The 24-character TMPDIR bound in plugins/evals/skills/plugin-eval/reference/sandboxes.md applies to the per-run path $HOME/.ev/<short-run-id>.
    • The run's closing step in SKILL.md removes the run directory whether or not a read happened, after the read when there is one, unless the user opts out explicitly; removal is not keyed on --keep-temp.
    • Preflight, as SKILL.md and reference/sandboxes.md describe it, lists run roots under $HOME/.ev older than 3 days with counts that include nested claude-eval-* sandboxes, and still removes nothing.
    • reference/sandboxes.md has a second removal loop scoped to $HOME/.ev/<run-id> that acts only on a real directory (not a symlink) whose realpath is a direct child of realpath $HOME/.ev and which holds claude-eval-* children, with the same chmod-then-rm -rf handling of sealed/ as the existing loop.
    • The nested-sandbox count rule and the run-root removal rule are each stated once, in reference/sandboxes.md, and SKILL.md points at them.
    • No age-based removal of run roots is added: the stale run-root listing stays report-only.
    • The pull request carries a Refs: #15112 line and no closing keyword for evals: prune kept plugin-eval sandboxes under the eval temp root by age #15112.
  8. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"cd0c2fb25824df65dcf733a622b03dce025357d9a6527ea95086caedb17e606b","body_sha256":"32f4a7ecefee380a16f01e299cf4f6720d1f574d32094d47d80e0b1a84800601"}

  9. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"cd0c2fb25824df65dcf733a622b03dce025357d9a6527ea95086caedb17e606b","body_sha256":"32f4a7ecefee380a16f01e299cf4f6720d1f574d32094d47d80e0b1a84800601"}

  10. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor
    No description provided.
  11. github-actions commented on Nov 21, 2026

    @github-actions
    Contributor
    No description provided.
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

    Fields

    Work status

    needs-triage

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions