[BUG] Editing project custom agent: Changing model deletes all previous changes in the instruction file
Resolved 💬 3 comments Opened Jan 6, 2026 by rbardak Closed Feb 21, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When I edit a custom agents instructions through /agents -> my-custom-agent -> Edit agent -> open in editor (vim)
and afterwards change the model via edit model, the changes I have made previously are not only forgotten, they are overwritten on disk.
What Should Happen?
All edits should be remembered.
Error Messages/Logs
None - this is a silent bug.
Steps to Reproduce
- Create a custom subagent in project scope.
- Go to
/agentssubmenu, select the agent and edit the agents instructions after is has been created via "open in editor". For example, addHI THEREin the description field. - Check the subagents
.mdfile, you will see that the change has been saved to disk. - in the same claude session, go to
edit modeland change the model of the subagent - Check the subagents
.mdfile - you will see that the change in the description has been reverted, and only the model has changed.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
IntelliJ IDEA terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗