CLAUDE_CODE_INVESTIGATE_FIRST

Updated by

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.

StatusRemoved between v2.1.222 and v2.1.224
AddedAdded between v2.1.118 and v2.1.123
CategoryOther
Official docsNot listed

How to set it

For one session, export it in the shell that starts Claude Code:

export CLAUDE_CODE_INVESTIGATE_FIRST=<value>
claude

To 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

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.