[BUG] Claude denies redirection to directories that were added with `--add-dir`
Status Closed — duplicate
Reported on v2.1.17
Maintainer reply None cached
Activity 3 comments · opened Feb 3, 2026 · closed Feb 6, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I've noticed that Claude denies some commands even though the directories have been allowed. From a recent run:
Output redirection to '/tmp/failed_job_log.txt' was blocked. For security, Claude Code
may only write to files in the allowed working directories for this session:
'<elided>', '/tmp'.
What Should Happen?
It should allow redirection to directories added with --add-dir.
Error Messages/Logs
Steps to Reproduce
- Add
/tmpwith--add-dir - Have claude do something that redirects output to
/tmp
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.17
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗