claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

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

Open gatesplan opened this issue 1 year ago • 3 comments

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
Image
                                                                                                        │

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
  3. This markdown parsing issue is observed every time such performance issues are detected
  4. 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

gatesplan avatar Jul 31 '25 03:07 gatesplan

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.

github-actions[bot] avatar Dec 03 '25 10:12 github-actions[bot]

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] avatar Jan 04 '26 10:01 github-actions[bot]

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.

github-actions[bot] avatar Jan 11 '26 14:01 github-actions[bot]