Skip to content
BENIBIX Learn

Compound Command

AI⌨️ Claude CodeConfiguration

Also known as && command, chained command

Commands joined with && or a pipe, each part checked on its own.

Think of it like

It is like a ticket for two rides. Each ride still checks it.

Example

Claude writes cd api && npm test. The cd is safe and npm test is allowed, so it runs. Had it ended in git push, Jack would be asked.

Why it matters

Without the split, one safe command could sneak a bad one in behind it.

Definition

A compound command joins two or more commands with &&, ||, ;, a pipe or a new line. Claude Code splits it before it checks your rules. Every part must be allowed on its own, or you are asked. So Bash(npm test *) does not let npm test && rm -rf build run. A deny rule that matches any one part stops the whole thing.

Example code

console
$ npm test && git push
# npm test matches an allow rule
# git push does not, so Claude Code asks
One part passes, one part needs you.
Each part is checked alone.

Common mistake

Saving a rule for the whole joined line. Claude Code saves one rule per part instead.

Key takeaways

  1. 1
    Split first. &&, ||, ;, pipe.
  2. 2
    Each part must pass. Or it asks.
  3. 3
    Any deny wins. For the whole.