Skip to content

Claude Code installer outputs garbled text in GitHub Actions logs #882

@davidnegley

Description

@davidnegley

Description

The Claude Code installer outputs ANSI escape sequences that get corrupted when displayed in GitHub Actions logs, resulting in garbled, unreadable text.

Current Behavior

When the claude-code-action runs in a GitHub Actions workflow, the installation step produces corrupted output like:

Installing Clude Cde nive build2.1.25...
Seting uplauncher and shellintegration.
✔Clade Code successfullyinstalled!
Lcation: ~/.local/bin/claud

Instead of the expected:

Installing Claude Code native build 2.1.25...
Setting up launcher and shell integration.
✔ Claude Code successfully installed!
Location: ~/.local/bin/claude

What We've Tried

We attempted to disable ANSI output by setting standard environment variables at the job level:

jobs:
  claude-pr-review:
    runs-on: ubuntu-latest
    env:
      TERM: dumb
      NO_COLOR: 1
    steps:
      - name: PR Review
        uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

However, the Claude Code installer doesn't respect these environment variables, and the output remains garbled.

Root Cause

The issue appears to be that:

  1. The Claude Code installer outputs ANSI escape sequences for formatting (colors, cursor positioning, etc.)
  2. GitHub Actions log viewer doesn't properly render these sequences
  3. Instead of stripping them out cleanly, they get partially rendered, causing text corruption

Proposed Solutions

  1. Respect NO_COLOR and TERM environment variables - This is the standard approach used by most CLI tools (see https://no-color.org/)

  2. Add a parameter to disable fancy output - For example:

    - uses: anthropics/claude-code-action@v1
      with:
        plain_output: true
  3. Pass a flag to the installer - If the installer supports it, pass a --no-ansi or --plain flag when these environment variables are detected

Related Issues

  • claude-code#15509 - Feature request for --no-ansi flag (which would also solve this issue)

Impact

  • Log readability: CI/CD logs are essential for debugging and monitoring, and garbled text makes them difficult to read
  • Professional appearance: Corrupted output looks unprofessional in build logs
  • Consistency: Most modern CLI tools respect NO_COLOR and TERM environment variables

Environment

  • GitHub Actions runner: ubuntu-latest
  • claude-code-action version: v1
  • Observed across multiple repositories and workflow configurations

Thank you for considering this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:installationbugSomething isn't workingp2Non-showstopper bug or popular feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions