CLAUDE_CODE_INVESTIGATE_FIRST
Updated by Alex Sorokoletov
CLAUDE_CODE_INVESTIGATE_FIRST is a Claude Code environment variable: Instructs the agent to read and investigate before acting — enforcing "read before write." Converts an agent that might immediately start editing into one that first gathers context. Likely injected as a meta-instruction into the system prompt. Removed between v2.1.222 and v2.1.224, so current releases ignore it. It is not in the official reference.
| Status | Removed between v2.1.222 and v2.1.224 |
|---|---|
| Added | Added between v2.1.118 and v2.1.123 |
| Category | Other |
| Official docs | Not listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_INVESTIGATE_FIRST=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_INVESTIGATE_FIRST": "<value>"
}
}Release notes that mention it
Related variables
CLAUDE_CODE_EXIT_AFTER_FIRST_RENDER: Exit after first UI render (testing).CLAUDE_SLOW_FIRST_BYTE_MS: Default 30,000ms.CLAUDE_CODE_CCR_FOLD_FIRST_TURN_RESCANANTHROPIC_BETAS: Comma-separated beta feature headers.ANTHROPIC_CUSTOM_HEADERS: Custom HTTP headers (newline-separated Key: Value).ANTHROPIC_FEDERATION_RULE_IDANTHROPIC_ORGANIZATION_IDANTHROPIC_WORKSPACE_ID
Frequently asked questions
What does CLAUDE_CODE_INVESTIGATE_FIRST do?
Instructs the agent to read and investigate before acting — enforcing "read before write." Converts an agent that might immediately start editing into one that first gathers context. Likely injected as a meta-instruction into the system prompt.
Which Claude Code version has CLAUDE_CODE_INVESTIGATE_FIRST?
Removed between v2.1.222 and v2.1.224, so current releases ignore it.
How do I set CLAUDE_CODE_INVESTIGATE_FIRST?
Export it before starting Claude Code (export CLAUDE_CODE_INVESTIGATE_FIRST=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.
All variables, searchable: Claude Code environment variables.