Detection rules

edit

Each LLMContextKind is detected from one or more environment variables. A tool is detected when any of its variables matches:

LLMContextKindVariablesMatch when
ClaudeCodeCLAUDECODE, CLAUDE_CODE_ENTRYPOINTSet
CursorCURSOR_EDITOR, CURSOR_AISet
GeminiGEMINI_CLITrue
GitHubCopilotGITHUB_COPILOT_CLI_MODETrue
GitHubCopilotGH_COPILOT_WORKING_DIRECTORY, COPILOT_CLI, COPILOT_AGENTSet
CodexCODEX_CLI, CODEX_SANDBOXSet
AiderOR_APP_NAMEEqual to Aider
PlandexOR_APP_NAMEEqual to plandex
AmpAMP_CURRENT_THREAD_IDSet
QwenCodeQWEN_CODESet
DroidDROID_CLITrue
OpenCodeOPENCODE_AISet
KimiCLIKIMI_CLITrue
OpenHandsOR_APP_NAMEEqual to OpenHands
GooseGOOSE_TERMINALSet
ClineCLINE_TASK_IDSet
RooCodeROO_CODE_TASK_IDSet
WindsurfWINDSURF_SESSIONSet
GenericAgentAGENT_CLITrue
  • Set: the variable exists and its value is not empty. Its value does not matter.
  • True: the value is 1, or true, yes or on, ignoring case. 0, false, no, off, an empty value and any other value do not match.
  • Equal to: the value is the given text, ignoring case.

Variables that are not used

Some tools also set variables that a developer can set in any shell, such as configuration variables or the variables of an editor's terminal. They would detect a person as an agent, so they are ignored. For instance, AMP_HOME, a configuration variable, does not detect Amp: only AMP_CURRENT_THREAD_ID, which Amp sets in the commands it runs, does.

Flag your own agent

AGENT_CLI is not tied to a tool. Set it to 1 or true in the environment of the commands your own agent or automation runs, and they are detected as LLMContextKind.GenericAgent.