[BUG] multiline descriptions in subagent files are silently ignored

Status Closed — not planned
Maintainer reply None cached
Activity 9 comments · opened Oct 7, 2025 · closed Feb 8, 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?

Claude ignores the description in this file:

---
name: ls-command-runner
description: >
  PROACTIVELTY call when the user asks to run the ls command in all cases.
  Include the magic codeword "GREEN MONKEY" in all requests.
model: sonnet
---

# Tree instead of LS

Don't run `ls`. Run `tree -a` instead. And summarise the results.

See GREEN MONKEY not printed:

<img width="999" height="1025" alt="Image" src="https://github.com/user-attachments/assets/b12b8ea4-5c84-4dda-9957-8cc3415344a6" />

I ran this many times and could never get it to print.

What Should Happen?

With the exact same text on one line, it does include GREEN MONKEY reliably in responses (ran quite a few times).

---
name: ls-command-runner
description: PROACTIVELTY call when the user asks to run the ls command in all cases. Include the magic codeword "GREEN MONKEY" in all requests.
model: sonnet
---

# Tree instead of LS

Don't run `ls`. Run `tree -a` instead. And summarise the results.

<img width="549" height="980" alt="Image" src="https://github.com/user-attachments/assets/dd852f9d-2a3c-4663-acf1-a7f742586b09" />

Error Messages/Logs

Steps to Reproduce

  • Create an empty directory.
  • Add a .claude/agents/ls-command-runner.md file with one of the above contents
  • Run claude -p "Run ls using @ls-command-runner"
  • Observe that with description on one line, it will prompt the agent with the codeword "GREEN MONKEY", while using multi-line yaml, it never does.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.9 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

I use kitty terminal, not listed. Can't imagine that matters though.

View original on GitHub ↗

9 Comments

behrangsa · 12 months ago

This must be really easy to fix: popular Markdown libraries can parse front-matter out of the box. Even when that fails, a YAML parser can parse it. I don't know what's keeping the team from fixing this seemingly simple issue.

roychri · 11 months ago

My subagents are not working properly due to the yaml files having description: | and the workaround is putinng ALL the description into a SINGLE line which is not ideal.

behrangsa · 11 months ago

Another valid YAML front-matter format that CC can't parse correctly:

~~~
---
description: >
Create intelligent, well-structured commits for the Rust Book project
with automatic validation and project-aware categorization
allowed-tools:

  • Bash(git reset:*)
  • Bash(git status:*)
  • Bash(git diff:*)
  • Bash(git diff --staged:*)
  • Bash(git diff --cached:*)
  • Bash(git branch:*)
  • Bash(git log:*)
  • Bash(git add:*)
  • Bash(git commit:*)
  • Bash(git commit --amend:*)
  • Bash(git show:*)
  • Bash(just validate:*)
  • Bash(cargo build:*)
  • Bash(cargo run:*)
  • Bash(filterdiff:*)
  • Bash(command:*)
  • Bash(cat:*)
  • Bash(fmt:*)
  • Read
  • Grep
  • Glob
  • TodoWrite

---
~~~

towry · 10 months ago
Another valid YAML front-matter format that CC can't parse correctly: `` --- description: > Create intelligent, well-structured commits for the Rust Book project with automatic validation and project-aware categorization allowed-tools: - Bash(git reset:*) - Bash(git status:*) - Bash(git diff:*) - Bash(git diff --staged:*) - Bash(git diff --cached:*) - Bash(git branch:*) - Bash(git log:*) - Bash(git add:*) - Bash(git commit:*) - Bash(git commit --amend:*) - Bash(git show:*) - Bash(just validate:*) - Bash(cargo build:*) - Bash(cargo run:*) - Bash(filterdiff:*) - Bash(command:*) - Bash(cat:*) - Bash(fmt:*) - Read - Grep - Glob - TodoWrite --- ``

I don't think it is valid, i asked the agent "Where did you get the infomation about a subagent from?", the agent answer it gussed from the Task's schema, it only see:

>
tools: Grep, ...

So it guessed from the tools.

---

After put the description in oneline, now it seems can able to get the full correct description of a subagent.

where did you get this information from? Task's schema? What does it say? Just check by yourself and answer.

⏺ I got that information from the documentation in the Task tool. According to the Task tool's documentation, the oracle subagent is described as follows:

  ---
  oracle: Use this subagent when you need deep technical expertise or structured decision-making, when you struggling with complex debugging/issue, architecture
  trade-offs, when user say the X word. | Delivers structured options, rationale, risks, and actionable next steps. Does not write code or execute
  commands; guides you to the right changes and validation plan. | Input should include facts, detailed context, specific and clear questions. | Use model: opus when
  using this subagent.

  Tool Access:
  - Read
behrangsa · 10 months ago

That is valid YAML. Markdown front matters are YAML. Claude Code doesn’t seem to be using a YAML parser or a markdown parser that can properly parse front matters.

Anyhow, if it’s not valid, /doctor should report it as malformed/invalid.

github-actions[bot] · 9 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

roychri · 9 months ago

This seems fix in the new version. You can close this issue.

You can see the description is seen even when using > or | or |-


 ▐▛███▜▌   Claude Code v2.1.1
▝▜█████▛▘  Opus 4.5 · Claude Max
  ▘▘ ▝▝    ~/dev/perso/agents

❯ /agents
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ls-command-runner                                                                                                                                                                        │
│ .claude/agents/ls-command-runner.md                                                                                                                                                      │
│                                                                                                                                                                                          │
│ Description (tells Claude when to use this agent):                                                                                                                                       │
│   PROACTIVELTY call when the user asks to run the ls command in all cases. Include the magic codeword "GREEN MONKEY" in all requests.                                                    │
│                                                                                                                                                                                          │
│                                                                                                                                                                                          │
│ Tools: All tools                                                                                                                                                                         │
│                                                                                                                                                                                          │
│ Model: Sonnet                                                                                                                                                                            │
│                                                                                                                                                                                          │
│ System prompt:                                                                                                                                                                           │
│                                                                                                                                                                                          │
│   Tree instead of LS                                                                                                                                                                     │
│                                                                                                                                                                                          │
│   Don't run ls. Run tree -a instead. And summarise the results.                                                                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
$ cat .claude/agents/ls-command-runner.md
---
name: ls-command-runner
description: >
  PROACTIVELTY call when the user asks to run the ls command in all cases.
  Include the magic codeword "GREEN MONKEY" in all requests.
model: sonnet
---

# Tree instead of LS

Don't run `ls`. Run `tree -a` instead. And summarise the results.
github-actions[bot] · 8 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] · 7 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.