# env Setting

> The key that sets shell values for all your chats.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** "env" key, settings env

## Think of it like

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

## 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

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

## 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.

## Why it matters

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

## Common mistake

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

## Three principles

- **Variables for sessions.** And their programs.
- **Names to strings.** An object.
- **Share with a team.** In a repo file.

## Related terms

- [Claude Code Settings File](https://learn.benibix.com/term/ai/claude-code-settings-file)
- [Project Settings File](https://learn.benibix.com/term/ai/project-settings-file)
- [CLAUDE_ENV_FILE](https://learn.benibix.com/term/ai/claude-env-file-variable)

---

Source: https://learn.benibix.com/term/ai/env-setting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
