Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[MODEL] Subagent deleted other subagents' mktemp dirs with a glob rm in the shared session scratchpad

Open
#104,804 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
devtools

Research direction

Start by reading the subagent scratchpad setup and cleanup paths; the issue names no files or tests, so locate where shared scratchpads are created and where temporary directories are removed. Check how cleanup is scoped when subagents run in parallel. Done when one subagent's cleanup cannot remove another's temporary directory, with coverage for the shared-session case.

Written by the indexing model from the issue text.

Description

area:agents area:model bug platform:linux
Type of Behavior Issue

Subagent behaved unexpectedly

What You Asked Claude to Do

Four coding subagents were running in parallel in one session. Each one had to build and run its own script, and each made temporary directories with mktemp -d inside the shared session scratchpad.

What Claude Actually Did

One subagent cleaned up its own temporary mirror with a name glob over the whole shared scratchpad:

find <scratchpad> -maxdepth 1 -type d -name 'tmp*' -exec rm -r {} +

This deleted about 70 tmp.XXXXXXXXXX directories that the other subagents had created. Named files were not touched.

Expected Behavior

The subagent should delete only its own directory, by its explicit path. Alternatively, the harness could give each subagent its own scratchpad subdirectory, so that one agent's cleanup cannot reach another's files.

Permission Mode

Not recorded.

Can You Reproduce This?

No, only happened once

Steps to Reproduce
  1. Run several subagents that share one session scratchpad and create directories there with mktemp -d.
  2. Let one of them clean up with a glob such as -name 'tmp*' over the shared directory.
Claude Model

Opus 5.5 (claude-opus-5-5), Claude Code 2.1.289, Linux x64

Impact

Medium - Extra work to undo changes (other agents' intermediate work was lost)

Dominant language
TypeScript
Stars
154k
Forks
26.1k
Avg merge
18h 55m
Merged PRs (30d)
11

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/claude-code

All issues in anthropics/claude-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.