mktemp
Create temporary files or directories with unique, unpredictable names atomically. Prevents race conditions during temporary workspace creation. Supports prefix and suffix for naming control.
Instructions
Create temporary files or directories with unique, unpredictable names atomically to prevent race conditions. Destructive: creates files/dirs on the filesystem. Returns JSON with the created path. Supports prefix and suffix for naming control. Use for safe temporary workspace creation in agent workflows. Not for persistent directories — use 'mkdir'. See also 'mkdir'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| directory | No | Create a temporary directory. | |
| dry_run | No | Report a candidate path without creating it. | |
| prefix | No | Temporary path prefix. | tmp. |
| suffix | No | Temporary path suffix. | |
| tmpdir | No | Directory where the temporary path should be created. Defaults to cwd. |