Commit d6f8783
feat(write): add external directory permission check
Without this patch, the write tool had a TODO comment for checking
external directory permissions but the implementation was incomplete.
This meant that write operations to paths outside the working
directory would proceed without requesting user permission.
This is a problem because write operations outside the project
directory could be security-sensitive, and users should be informed
and able to approve or deny such operations.
This patch solves the problem by implementing the external directory
permission check using `ctx.ask()` with the `external_directory`
permission type, following the same pattern used in other tools like
bash. The check includes the parent directory pattern and provides
appropriate metadata for permission message formatting.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent cefbfbd commit d6f8783
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | | - | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
0 commit comments