[BUG] run with agent parameter is not holding agent's frontmatter when resume.

Status Open
Maintainer reply None cached
Activity 1 comment · opened Jul 25, 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?

After I run new session with custom agent definition, send it background or exit in serveral way, and attach/resume to them cause corrupted session. One or more configuration in agent definition has been broken status.

What Should Happen?

Claude should sum up files needed, write them into context, and attach/resume with full of custom agent definition.

Error Messages/Logs

Steps to Reproduce

  1. create custom agent file in ~/.claude/agents/custom.md
  2. run claude with that agent claude --agent custom
  3. sit current session on background by left key or exit (ctrl + c twice) and attach by claude agents or claude --resume.
  4. see custom agent definition is loaded as is.

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

v2.1.220

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

start claude --agent orch (orch is my custom agent defined)

<img width="1920" height="247" alt="Image" src="https://github.com/user-attachments/assets/3a57ce4d-2c99-4c2f-8548-f2b957884565" />

start claude --agent orch, and press left arrow key

<img width="1920" height="249" alt="Image" src="https://github.com/user-attachments/assets/417c7026-a837-41e3-940c-13a4b7f547ba" />

and press enter to enter previous agent session

<img width="1894" height="987" alt="Image" src="https://github.com/user-attachments/assets/e7ee25e7-0dba-44fd-a412-8a82984c159f" />

frontmatter is gone. background idle agent is counted as 1 unless I am attached to that.

start claude --agent orch, prompt ping, exit by pressing ctrl + c twice, and attach previous session using uuid

<img width="1920" height="674" alt="Image" src="https://github.com/user-attachments/assets/dfef0ade-3801-49a9-b0a4-b14a67dd1b14" />

model is falls back to default model sonnet 4.6 not opus 4.8

start claude --agent orch, prompt ping, exit by pressing ctrl + c twice, attach previous session using uuid, and press left arrow key

<img width="1920" height="359" alt="Image" src="https://github.com/user-attachments/assets/d09c952c-fc8c-4cc3-a214-3ad0e531d6c9" />

look like agent name is preserved.

start claude --agent orch, prompt ping, exit by pressing ctrl + c twice, attach previous session using uuid , press left arrow key, and enter orch agent again

<img width="1919" height="982" alt="Image" src="https://github.com/user-attachments/assets/e042f246-769c-497d-b011-69c44577e9d1" />

frontmatter's color valueis corrupted (blue not purple). and if I do prompt here. ~/.claude/rules/*.md files are ignored. AI Agent know rules existance itself if ask, but not follow it.

start claude --agent orch, exit by pressing ctrl + c twice (no prompt is passed), attach previous session using claude --resume, and select top session because no uuid value is printed.

<img width="1920" height="218" alt="Image" src="https://github.com/user-attachments/assets/b1e89ab3-8c5a-493c-b562-63edb18c0273" />

frontmatter seems completely ignored. no opus naming, no color, not model defined in orch.

start claude --agent orch, exit by pressing ctrl + c twice (no prompt is passed), attach previous session using claude --resume, select top session, exit by pressing ctrl + c twice again, and attach previous session using uuid

<img width="1920" height="327" alt="Image" src="https://github.com/user-attachments/assets/23d249d4-7210-48bb-b32f-e3de900761e0" />

uuid is printed but it is not active(or idle) session uuid which is not found.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗