#environment variables
5 articles
-
Compact earlier or never: Claude Code's /autocompact, autoCompactWindow, and CLAUDE_AUTOCOMPACT_PCT_OVERRIDE
How to change when Claude Code auto-compacts: /autocompact and autoCompactWindow, the --autocompact flag, the percent override, their precedence, and autoCompactEnabled.
-
Fix Claude Code Bash timeouts and truncated output: BASH_DEFAULT_TIMEOUT_MS and bashOutputMaxChars
Why Claude Code's Bash tool stops at 2 minutes or cuts long output, and how to tune it with BASH_DEFAULT_TIMEOUT_MS, BASH_MAX_TIMEOUT_MS, and bashOutputMaxChars.
-
Keep API keys out of the commands Codex runs: the shell_environment_policy setting
Control which environment variables reach the commands Codex CLI runs with shell_environment_policy: inherit values, default handling of KEY/SECRET/TOKEN names, filters, and set.
-
Pin environment variables in Claude Code's settings.json with the env key: precedence and pitfalls
How the env key in Claude Code's settings.json works: it overrides shell variables, applies to every session and subprocess, and when a saved change reaches a running session.
-
Why the CLAUDE.md in a --add-dir directory is not loaded, and the setting that fixes it
A --add-dir directory does not load its CLAUDE.md by default. What CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD changes, which files it covers, and how to make it permanent.