A worktree is a separate working copy of a git repository. When a session is limited to one, Claude Code checks git commands before they run. That check now refuses a command whose subcommand contains -- in its name. Names like that belong to git's internal helper programs, and some of those helpers write files outside the worktree.
The refusal message suggests what to do instead:
- Run the ordinary git command rather than the helper.
- Add the missing space if
--was meant to start an option. - Write a file path as
./nameso it is not read as a command.
The message for words that cannot be checked before a command runs was also reworded. It now says such a word may expand when the command runs, or is an option the check does not know.
Some git commands that were accepted before in worktree-restricted sessions are now refused. The new message explains how to rewrite them.