Skip to content

fix: allow agent sessions to edit Claude config files in act mode (Refs: beans-huwr)#164

Merged
hmans merged 1 commit into
mainfrom
beans/severe-crow-tko8
Mar 20, 2026
Merged

fix: allow agent sessions to edit Claude config files in act mode (Refs: beans-huwr)#164
hmans merged 1 commit into
mainfrom
beans/severe-crow-tko8

Conversation

@hmans
Copy link
Copy Markdown
Owner

@hmans hmans commented Mar 20, 2026

Summary

  • Agent sessions running in act mode (--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.
  • Fix: pass --allowedTools with Edit(CLAUDE.md), Write(CLAUDE.md), Edit(.claude/**), Write(.claude/**) when spawning agents in act mode, pre-approving edits to these paths.

Test plan

  • Existing TestBuildClaudeArgs_ActMode updated to verify --allowedTools entries are present
  • All agent package tests pass
  • Manual: spawn an agent in act mode via Beans UI and have it edit a .claude/rules/*.md file — should succeed without permission prompts

…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
@hmans hmans merged commit 7a43a18 into main Mar 20, 2026
1 check passed
@hmans hmans deleted the beans/severe-crow-tko8 branch March 20, 2026 15:07
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
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