Temporary files¶
AI agents frequently produce transient artifacts during work - design documents, investigation logs, intermediate outputs, and other files that don’t belong in version control. The workspace provides a dedicated .tmp/ directory for this, with a helper script that keeps it organized.
How it works¶
The .tmp/ directory is git-ignored (except for its README.md and .gitkeep). Agents create task-specific subdirectories to isolate artifacts from different tasks, preventing the directory from becoming a dumping ground of mixed files.
The generated AGENTS.md instructs agents to use this directory and follow the naming conventions below.
Creating a task directory¶
A helper script creates task-specific subdirectories:
The script outputs the created path. If a named directory already exists, it returns the existing path.
Naming strategy¶
The name argument controls how the directory is named:
-
Work item ID (preferred) - The canonical identifier from the tracking system
-
Descriptive name - A name derived from the task, when no work item ID exists
Distinguishing details help -
fix-api-timeout-retry-logicrather thanapi-fix. -
Random (default) - When the name is omitted, for exploratory or throwaway work
Generates a
YYYYMMDD-xxxxdirectory (date + random hex).
Subtask coordination¶
When an agent delegates work to subtasks, passing the directory path keeps all related artifacts together:
- Delegating subtasks - The
.tmp/subdirectory path is passed so subtask output lands in the same place - Coordinating multiple subtasks - A shared subdirectory is created before delegating, and its path is passed to all subtasks