Skip to content

Allow cd, sed, awk, xargs, cp, and mv as sandbox-contained commands #164

Closed

Description

@furedea

Claude Code matches its allow rules against every command in a call, so a compound call such as cd repo && rg foo, or a pipeline into sed, awk, or xargs, is not rule-matched because cd, sed (without -n or -i), awk, xargs, cp, and mv have no allow entry. In auto mode the classifier then decides and sometimes prompts; in other modes it always prompts. All of these are confined by the sandbox: cd is guarded by the verification scope check, sed -i is already allowed, and cp and mv can only write inside the worktree and temp directories where Git restores tracked files. Add allow prefixes and precise rules for cd, sed, awk, xargs, cp, and mv under ADR-0034. Acceptance: cd agents && rg foo, sed -E s/a/b/ README.md, awk programs in single quotes, find | xargs grep, cp a b, and mv a b are allowed by the guard and by the generated Claude permissions; xargs still exposes the wrapped command to the forbidden and dangerous-Git guards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions