ClaudeCode.Sandbox.Filesystem (ClaudeCode v0.29.0)

View Source

Filesystem isolation settings for sandbox configuration.

Maps to the SandboxFilesystemConfig type in the TS SDK.

Fields

  • :allow_write - Additional paths where sandboxed commands can write. Arrays merge across settings scopes.
  • :deny_write - Paths where sandboxed commands cannot write. Arrays merge across settings scopes.
  • :deny_read - Paths where sandboxed commands cannot read. Arrays merge across settings scopes.

Path Prefixes

PrefixMeaningExample
//Absolute path from filesystem root//tmp/build -> /tmp/build
~/Relative to home directory~/.kube -> $HOME/.kube
/Relative to settings file directory/build -> $SETTINGS_DIR/build
./ or noneRelative path./output

Examples

iex> ClaudeCode.Sandbox.Filesystem.new(allow_write: ["/tmp/build", "~/.kube"], deny_read: ["~/.aws/credentials"])
%ClaudeCode.Sandbox.Filesystem{allow_write: ["/tmp/build", "~/.kube"], deny_write: nil, deny_read: ["~/.aws/credentials"]}

Summary

Functions

Creates a new Filesystem struct.

Converts to the camelCase map expected by the CLI.

Types

t()

@type t() :: %ClaudeCode.Sandbox.Filesystem{
  allow_write: [String.t()] | nil,
  deny_read: [String.t()] | nil,
  deny_write: [String.t()] | nil
}

Functions

new(opts)

@spec new(keyword() | map()) :: t()

Creates a new Filesystem struct.

Accepts a keyword list or map (atom or string keys). Unknown keys are ignored.

to_settings_map(fs)

@spec to_settings_map(t()) :: map()

Converts to the camelCase map expected by the CLI.