[BUG] Claude denies redirection to directories that were added with `--add-dir`

Resolved 💬 3 comments Opened Feb 3, 2026 by f1sherman 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

  1. Add /tmp with --add-dir
  2. 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_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗