Skip to content

fix: use absolute paths in --allowedTools for sensitive file editing (Refs: beans-huwr)#166

Merged
hmans merged 1 commit into
mainfrom
beans/famous-pike-t850
Mar 20, 2026
Merged

fix: use absolute paths in --allowedTools for sensitive file editing (Refs: beans-huwr)#166
hmans merged 1 commit into
mainfrom
beans/famous-pike-t850

Conversation

@hmans
Copy link
Copy Markdown
Owner

@hmans hmans commented Mar 20, 2026

Summary

  • Agent sessions in act mode were still getting permission prompts when editing .claude/rules/* and CLAUDE.md files, despite the fix in fix: allow agent sessions to edit Claude config files in act mode (Refs: beans-huwr) #164
  • Root cause: --allowedTools patterns used relative globs (e.g. Edit(.claude/**)) but Claude Code's Edit/Write tools operate on absolute file paths, so the patterns never matched
  • Fix: construct patterns using session.WorkDir (e.g. Edit(/path/to/workdir/.claude/**)) and pass each with its own --allowedTools flag

Test plan

  • mise build and spawn an agent in act mode via Beans UI
  • Have it edit a .claude/rules/*.md file — should succeed without permission prompts
  • Verify mise test passes

… editing (Refs: beans-huwr)

- The previous fix used relative glob patterns (e.g. `Edit(.claude/**)`) which
  never matched because Claude Code's Edit/Write tools use absolute file paths
- Now constructs patterns using session.WorkDir (e.g. `Edit(/path/.claude/**)`)
- Each pattern gets its own --allowedTools flag to avoid variadic arg ambiguity
@hmans hmans merged commit 7eedcdc into main Mar 20, 2026
1 check passed
@hmans hmans deleted the beans/famous-pike-t850 branch March 20, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant