Troubleshooting

Agent Says “Permission Denied” When Saving Files?

Fix write-failure loops fast and get back to shipping work with a safe, proof-first recovery flow.

If your agent says it can’t write a file because of permission denied, operation not permitted, or read-only file system, you’re usually hitting a path or policy mismatch—not a model-quality issue.

Good news: most write failures resolve in under 5 minutes when you verify the exact path, then test with a tiny canary file in the correct workspace.

What this usually means

5-minute recovery flow

1) Capture the exact error text

Don’t paraphrase. Save the full message (including path) so you can distinguish permission failure from “file not found” or “wrong workspace.”

2) Verify the target path is inside your workspace

Ask the agent to print the exact absolute path it is trying to write. If it points outside your workspace root, reroute before retrying.

3) Run a tiny canary write

Try writing one tiny file in a known-good folder (like the workspace root or a simple notes/ folder). If canary succeeds, your original path is the blocker.

4) Create missing directories first

If path is valid but nested folders don’t exist, create them before writing. Missing folders often trigger confusing write errors.

5) Require proof of write success

Require: file path, byte size, and first line of content. No proof = not done.

Copy/paste recovery prompt

I’m getting a file write error. Diagnose it step-by-step. 1) Show the exact absolute path you are trying to write. 2) Confirm whether that path is inside this session’s writable workspace. 3) Run a tiny canary write to ./canary-write-test.txt 4) If canary works, create missing directories for my target path and retry once. 5) Return only: - Status - Exact blocker (one sentence) - Evidence (path + file size + first line) Do not claim success without evidence.

High-friction mistakes to avoid

Trust rule: if the agent says “saved,” require exact path + file size + content snippet before moving on.

When to escalate to #help

Escalate after one clean retry if canary and real target both fail. Include:

Bottom line: treat write failures as path/policy diagnosis, not model failure. One canary write plus path proof resolves most cases quickly.