Skip to content

[FEATURE] Auto-restrict sandbox to current working directory #22155

Description

@beziehungsweise

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Claude Code should automatically restrict filesystem access (read AND write) to the current project directory by default, with an explicit notification that this restriction is active.

Current behavior:

  • Sandbox allows read access to entire filesystem
  • User must manually create .claude/settings.json in each project
  • No automatic notification of sandbox status

Requested behavior:

  • On startup, automatically restrict read.allowOnly and write.allowOnly to current working directory + /tmp/claude
  • Show clear notification: "Sandbox active - restricted to: [project path]"
  • If not active, warn user to enable it
  • Make this the DEFAULT behavior for security

Why this matters:
Teams and security-conscious users cannot use Claude Code without this feature. Current behavior is a security risk.

Proposed Solution

.

Alternative Solutions

No response

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions