Skip to content

MCP comment tool escapes ! in HTML comments, making markers visible #971

@otavio

Description

@otavio

Bug

When using mcp__github_comment__update_claude_comment to post a comment containing an HTML comment marker like <!-- claude-code-review -->, the ! character gets escaped to \!, resulting in <\!-- claude-code-review --> being stored in the comment body.

Since <\!-- is not valid HTML comment syntax, GitHub renders it as visible text instead of hiding it.

Reproduction

  1. Configure a workflow that uses claude-code-action with a prompt instructing Claude to include <!-- some-marker --> in a comment body via mcp__github_comment__update_claude_comment
  2. Trigger the workflow
  3. Observe the posted comment contains <\!-- some-marker --> (with \!)

Expected behavior

The HTML comment <!-- some-marker --> should be posted verbatim, so GitHub hides it as intended.

Actual behavior

The ! is escaped to \!, producing <\!-- some-marker --> which renders as visible text.

Root cause

This is likely bash history expansion escaping the ! character when the comment body passes through a shell context with double quotes. In bash, ! triggers history expansion inside double-quoted strings and gets escaped to \!.

Example

Environment

  • anthropics/claude-code-action@v1
  • --model claude-opus-4-6
  • Using track_progress and mcp__github_comment__update_claude_comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmcpp3Minor bug or general feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions