ci-detector icon indicating copy to clipboard operation
ci-detector copied to clipboard

Detect CI-like tools like Claude Code

Open sanmai opened this issue 5 months ago • 2 comments

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

sanmai avatar Jul 18 '25 08:07 sanmai

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?

OndraM avatar Jul 18 '25 10:07 OndraM

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.

sanmai avatar Jul 18 '25 10:07 sanmai