Claude Code Now Asks Before Running Read-Only Git Commands in Repositories You Have Not Trusted

Claude CodeView original changelog

Claude Code 2.1.325 changes read-only git commands to ask first in a repository that is not the project's or one the user trusted. Naming the repository with --add-dir runs them without prompts. The additionalDirectories setting no longer does that.

Key Takeaways

  • Read-only git commands now ask first in repositories that are not trusted.
  • The rule applies to repositories that are not the project's own.
  • --add-dir is the way to run them without prompts.
  • additionalDirectories no longer works for this purpose.
  • Existing setups relying on the setting may start prompting.
  • The change reduces the chance of an untrusted repository's config being read without a prompt.

What changed

Read-only git commands used to run without asking. In 2.1.325, Claude Code asks first when the repository is not the project's own and has not been trusted.

How to avoid the prompts

Name the repository with --add-dir. The additionalDirectories setting no longer has the same effect for these commands, so configurations that relied on it will start prompting.