fix: allow agent sessions to edit Claude config files in act mode (Refs: beans-huwr)#164
Merged
Conversation
…fs: beans-huwr) - Add --allowedTools for Edit/Write on CLAUDE.md and .claude/** paths - These files are classified as "sensitive" by Claude Code and blocked even with --dangerously-skip-permissions - Update TestBuildClaudeArgs_ActMode to verify the new allowedTools
3 tasks
hmans
added a commit
that referenced
this pull request
Mar 20, 2026
…(Refs: beans-huwr) (#166) ## Summary - Agent sessions in act mode were still getting permission prompts when editing `.claude/rules/*` and `CLAUDE.md` files, despite the fix in #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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--dangerously-skip-permissions) were unable to edit Claude's own config files (.claude/rules/*.md,CLAUDE.md) because Claude Code classifies them as "sensitive files (project rules)" and requires explicit permission — which can't be granted in non-interactive mode.--allowedToolswithEdit(CLAUDE.md),Write(CLAUDE.md),Edit(.claude/**),Write(.claude/**)when spawning agents in act mode, pre-approving edits to these paths.Test plan
TestBuildClaudeArgs_ActModeupdated to verify--allowedToolsentries are present.claude/rules/*.mdfile — should succeed without permission prompts