[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

  1. Create a custom subagent in project scope.
  2. Go to /agents submenu, select the agent and edit the agents instructions after is has been created via "open in editor". For example, add HI THERE in the description field.
  3. Check the subagents .md file, you will see that the change has been saved to disk.
  4. in the same claude session, go to edit model and change the model of the subagent
  5. Check the subagents .md file - 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_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗