Detect CI-like tools like Claude Code
For LLM-based tools it is also great to show a more concise output without much ado, same as with CI, and even more so - for LLM tools every single token counts and costs.
For Claude Code it is:
CLAUDECODE=1
https://github.com/anthropics/claude-code/issues/531
Hi, thanks for the suggestion and the PR.
The question is - does it make sense to mix the detection for CI environments with AI environments? Doesn't this have somehow different usecases? When you are in Claude Code, do you always want to behave like you are inside CI?
Yep, I always want it to behave with minimal output: these progress dots and whatnot are a waste of the context window.
It actually tries to do that most of the time with head, grep and such, but sometime I run the command and forget to add any limiters, and it... Well, bombs the context window.