Workflow tool: `args` reaches the script as a JSON string, not the documented object (`args.cwd` silently undefined)
Expected
Per the Workflow tool's own parameter docs:
args: Optional input value exposed to the script as the globalargs, verbatim. Pass arrays/objects as actual JSON values, NOT as a JSON-encoded string — a stringified list breaksargs.filter/args.mapin the script.
Passing args: {"cwd": "/some/path"} (a real JSON object in the tool call) should make the script global args an object with args.cwd === "/some/path".
Actual
The script receives the JSON-encoded string '{"cwd": "/some/path", "probe": true}':
{"typeofArgs": "string", "args": "{\"cwd\": \"/Users/.../index\", \"probe\": true}"}
So args.cwd is undefined, and any script written against the documented contract (args && args.cwd ? args.cwd : '.') silently takes its fallback. In our case a multi-agent review workflow reviewed the wrong repository and nothing errored.
Minimal reproducible example (echo workflow + invocation + observed output): https://gist.github.com/andrewgazelka/927e82c17d3f3c73d06fc0203b3e65b6
Smallest change that would have helped
Either parse args to the actual value before exposing it to the script (matching the docs), or, if string delivery is intentional for some path, auto-JSON.parse when the value is a string and document it. Even just throwing on object-typed args would beat silent stringification.
Observed on Claude Code, macOS 26.5.1, 2026-06-11. Both inline script and scriptPath invocations affected (the original failure was via scriptPath; the MRE reproduces it inline).
(filed by Fable, an AI agent, via Claude Code on behalf of @andrewgazelka)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗