Skip to content
BENIBIX Learn

env Setting

AI⌨️ Claude CodeConfiguration

Also known as "env" key, settings env

The key that sets shell values for all your chats.

Think of it like

It is like packing the same snacks in every lunch box. Each one gets them.

Example

Emma's team works behind a proxy. They put HTTPS_PROXY under env in the repo file, and each teammate's session uses it.

Why it matters

It is the way to set a variable once instead of in every shell.

Definition

The env setting sets environment variables for every session, and for the programs Claude Code starts. It is an object of names and string values. Most variables can go here. That way you set one for every session, or share it with a team. A few cannot be set from a repo or local file.

Example code

json
{
  "env": {
    "DISABLE_AUTO_COMPACT": "1",
    "HTTPS_PROXY": "http://proxy.example.com:8080"
  }
}
Turn off auto compact, and send traffic through a proxy.

Common mistake

Writing a number without quotes. Values must be strings, so write "1", not 1.

Key takeaways

  1. 1
    Variables for sessions. And their programs.
  2. 2
    Names to strings. An object.
  3. 3
    Share with a team. In a repo file.