"Don't ask again" for joined cd commands

Status Fixed / completed
Maintainer reply ✓ Yes — rboyce-ant
Activity 5 comments · opened Mar 2, 2025 · closed Mar 13, 2025
💡 Likely answer: A maintainer (rboyce-ant, contributor) responded on this thread — see the highlighted reply below.

Claude Code will often chain a cd command with other commands. The result is that the option "Yes, and don't ask again for cd commands..." isn't really accurate, in that it will give the same option again the next time a cd command is chained to a different follow-up command. It's not a big deal, just confusing. It would be clearer to say "don't ask again for this specific command combination."

Example:

Bash command                                                                                                                                                   │
│                                                                                                                                                                │
│   cd /Users/user1/auth-service && node deploy-db-schema.js                                                                                      │
│   Changes directory and runs database schema deployment script                                                                                                 │
│                                                                                                                                                                │
│ Do you want to proceed?                                                                                                                                        │
│ ❯ Yes                                                                                                                                                          │
│   Yes, and don't ask again for cd commands in /Users/user1/auth-service

View original on GitHub ↗

5 Comments

peterkaminski · 1 year ago

Claude Code chains other commands besides cd. The one I can think of offhand is git add and git commit.

My concern is that the user might approve the first command (cd or git add or whatever), but not carefully review whether or not the chained commands are safe / appropriate at the moment. "Yes, and don't ask again..." seems potentially dangerous, without more clarity about what you're perma-allowing.

peterkaminski · 1 year ago

Here's an example from just now, Claude Code wanted to do:

cd (dirpath) && yarn build

It asks about cd and offers don't ask again, but the "don't ask again" is about cd, not yarn build.

It seems like "don't ask again" should be about _all_ the commands it will run, not just the first one.

peterkaminski · 1 year ago

Hmm, now it's trying to do the same cd (dirpath) && yarn build command, but this time it's asking about yarn build. So maybe it does the right thing sometimes, and sometimes not? I'm pretty sure I've been saying "Yes", and not "Yes, and don't ask again".

macOS Sonoma 14.7, M1 Max, iTerm2, 0.2.32 (Claude Code)

rboyce-ant contributor · 1 year ago

This is fixed now, thanks for the feedback! You'll be asked to approve both cd and node commands when asked about this command in version 0.2.39 and newer.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.