[BUG] /agents command incorrectly parses/renders markdown in agent instructions

Resolved 💬 3 comments Opened Jul 31, 2025 by gatesplan Closed Jan 4, 2026

## Bug Description
When checking agent instructions using the /agents command, markdown syntax is incorrectly processed, resulting
in missing content sections and fragmented text display.

## Specific Pattern Observed

  1. YAML header section displays normally
  2. Markdown headers (#) immediately after YAML are stripped/missing
  3. Regular text content appears partially with broken sentence structure
  4. Markdown components like # are selectively filtered out
  5. Content appears fragmented and incomplete

## Visual Evidence
The /agents command output shows:

  • YAML frontmatter renders correctly
  • Content appears fragmented (e.g., "ection", "on, complexity", "dependencies, interfaces, error patterns")
  • Missing context and broken sentence flow
  • Incomplete instruction display

<img width="1260" height="969" alt="Image" src="https://github.com/user-attachments/assets/d1a1353c-ca39-4e5f-ab84-eae5a4b74d31" />


## Steps to Reproduce

  1. Use Claude Code for some time with agent interactions
  2. When Claude Code's behavior becomes erratic (subagents not following instructions properly, unpredictable

responses, etc.), check /agents command

  1. This markdown parsing issue is observed every time such performance issues are detected
  2. Compare with direct file reading of the same agent files - they show complete content

## Workarounds and Recovery

  • /reset or restarting Claude does NOT resolve the issue
  • /clear command does NOT resolve the issue
  • Completely closing the command prompt and restarting sometimes resolves it (but not always)
  • When complete restart doesn't work, waiting approximately 1 hour often resolves the issue
  • Interesting observation: On one occasion, the issue suddenly resolved exactly at the 50-minute mark (may be

coincidental, but worth noting)

## Impact

  • Agent instructions appear incomplete to users
  • May affect Claude's internal processing of agent capabilities
  • Direct file reading shows complete content correctly
  • Correlates with Claude Code performance degradation
  • Standard reset/clear commands cannot resolve the issue

## Environment

  • Platform: Windows (win32)
  • Operating System: Windows
  • Claude Code version: Latest

## Expected Behavior
/agents command should display complete agent instructions including all markdown formatting and headers

## Actual Behavior
Markdown headers are stripped, content is fragmented, and instructions appear incomplete with broken sentence
structure

## Additional Notes

  • This appears to be tied to Claude Code's internal state or session management
  • The issue manifests when Claude Code's behavior becomes unpredictable or subagents fail to follow instructions

properly

  • Standard troubleshooting commands (reset/clear) are ineffective
  • May be related to session timeout or cache invalidation mechanisms (possibly explaining the ~50-minute recovery

observation)

  • Direct file access shows complete content, indicating the issue is in the display/parsing layer of the

/agents command

View original on GitHub ↗

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