[BUG] Setting CI environment variable to empty string disables colors

Resolved 💬 4 comments Opened Mar 11, 2026 by maclockard Closed Apr 9, 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?

If you set the environment variable CI to an empty string, color is disabled for claude:

<img width="668" height="225" alt="Image" src="https://github.com/user-attachments/assets/861ea3a2-2d50-4c7f-88d1-2fabd93e3c45" />

What Should Happen?

Claude should treat empty string as the same as the environment variable being unset, like so:

<img width="587" height="159" alt="Image" src="https://github.com/user-attachments/assets/07f490a3-04a3-475d-8c00-dbf1297e068b" />

Error Messages/Logs

Steps to Reproduce

  1. Run export CI=""
  2. Run claude
  3. See that there is no color

You can also run env -u CI claude to confirm that color comes back when CI is unset

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.72

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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