[FEATURE] WriteTemp() tool
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Currently the instructions for writing a temp file in order to pass data to scripts look something like this:
- Create a temp file in project root:
mktemp --suffix=.json --tmpdir=$(pwd) - Use Read tool to read the temp file returned. It is expected to be empty. This step is needed only to bypass safety check of the Write tool.
- Use the Write tool to save the JSON array to the path returned by mktemp
- Run the script with that path and delete the temp file
Proposed Solution
Create a wrapper for Write() tool, that creates a temp file in the OS temp folder, writes into it and returns the path.
Optional: cleanup old temp files if the caller failed to do so.
Alternative Solutions
Passing data to scripts directly faces significant size limitations on Windows systems, since Claude is using Git Bash tool.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
I have skills that mix LLM instructions and deterministic calculations.
I wrote node.js scripts that accept and return JSON data needed for those calculations.
Passing JSON data directly to the scripts as a CLI parameter sometimes fails on Windows because of bash integration limit on parameter size.
Writing input JSON to a temp file using Write() tool is a reasonable workaround, but requires excessive instructions.
Additional Context
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗