Sandbox allowWrite treats absolute paths as relative to ~/.claude/
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 4 comments · opened Mar 11, 2026 · closed Mar 11, 2026
Bug Description
When configuring custom sandbox filesystem write paths in ~/.claude/settings.json, absolute paths are resolved as if they are relative to ~/.claude/, resulting in doubled/incorrect paths at runtime.
Steps to Reproduce
- Add absolute paths to
~/.claude/settings.json:
"sandbox": {
"enabled": true,
"filesystem": {
"allowWrite": [
"/home/user/.claude/learning",
"/home/user/.claude/knowledge/projects"
]
}
}
- Start a Claude Code session
- Observe the runtime sandbox restrictions in the system prompt — the write allowlist shows:
"/home/user/.claude/home/user/.claude/learning"
"/home/user/.claude/home/user/.claude/knowledge/projects"
- Any tool attempting to write to
/home/user/.claude/learning/fails with permission errors because the sandbox is looking for the doubled path.
Expected Behavior
Absolute paths in allowWrite should be honored as-is. /home/user/.claude/learning should appear as /home/user/.claude/learning in the runtime sandbox, not /home/user/.claude/home/user/.claude/learning.
Workaround
Use relative paths instead of absolute paths. These get correctly resolved when the base is prepended:
"allowWrite": [
"learning",
"knowledge/projects"
]
Environment
- Claude Code CLI (latest as of 2025-03-11)
- Linux (Ubuntu)
- Sandbox enabled via settings.json
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
The issue with absolute paths being treated as relative to ~.claude/ is a common path resolution bug in sandboxed environments.
Solution approach:
OpenClaw's sandbox implementation uses a command validation layer that normalizes paths before execution - this prevents the relative/absolute confusion entirely by enforcing a canonical path representation.
Not a bug — sandbox paths need a
~/or//prefix to be treated as home-relative or absolute. Without a prefix, paths resolve relative to the settings file's directory (~/.claude/), which caused the doubling. Documented behavior, just unintuitive. Closing.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.