Add permissionMode to code-writing agents#4174
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4174 +/- ##
=======================================
Coverage 69.29% 69.29%
=======================================
Files 466 466
Lines 46774 46774
=======================================
+ Hits 32411 32414 +3
+ Misses 11872 11870 -2
+ Partials 2491 2490 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Agents with Write and Edit tools but no permissionMode inherit the parent's default mode, which requires interactive approval for each file operation. When running as subprocesses the prompts get auto-denied, causing agents to create _new.go copies instead of editing files in place. Set permissionMode: acceptEdits on all four code-writing agents and update the golang-code-writer description and prompt to explicitly prefer editing existing files over creating new ones. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d57a568 to
e884b27
Compare
rdimitrov
approved these changes
Mar 17, 2026
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
_new.gofile copies instead of editing existing files in place. The root cause is that agents withoutpermissionModeinherit the parent'sdefaultmode, which requires interactive approval for each Edit/Write operation. When running as subprocesses, those prompts get auto-denied, so the agent falls back to creating new files as a workaround.permissionMode: acceptEditsto all four code-writing agents so file modifications are auto-approved._new.gocopies.Type of change
Test plan
Verified by inspecting the agent frontmatter to confirm
permissionMode: acceptEditsis present in all four agents. The fix addresses a runtime permission behavior — the agents will now auto-approve Edit/Write operations instead of falling back to creating new files.Changes
.claude/agents/golang-code-writer.mdpermissionMode: acceptEdits, update description to cover editing existing code, add "File Modification Rules" section.claude/agents/unit-test-writer.mdpermissionMode: acceptEdits.claude/agents/site-reliability-engineer.mdpermissionMode: acceptEdits.claude/agents/documentation-writer.mdpermissionMode: acceptEditsDoes this introduce a user-facing change?
No direct user-facing change. Improves Claude Code agent behavior so code-writing agents edit files in place instead of creating
_new.gocopies.Generated with Claude Code