CLAUDE_CODE_CONFIG_WATCH_EVENTS
Updated by Alex Sorokoletov
CLAUDE_CODE_CONFIG_WATCH_EVENTS is a Claude Code environment variable: On Linux, when set, watches config files with filesystem events instead of interval polling; ignored on other platforms. Added in v2.1.288 and still present in v2.1.332. It is not in the official reference.
| Status | Present in v2.1.332 |
|---|---|
| Added | Added in v2.1.288 |
| 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_CONFIG_WATCH_EVENTS=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_CONFIG_WATCH_EVENTS": "<value>"
}
}Related variables
CLAUDE_CODE_CONFIG_LOCK_WAIT_MS: Milliseconds to keep retrying for the config lock when a caller-only lock is in use; defaults to 0.CLAUDE_CODE_CONFIG_PROBE: Marks the run as an IDE config probe; when set, the AWS and GCP auth refreshes are skipped.CLAUDE_CODE_EMIT_USER_PROMPT_SUBMIT_HOOK_EVENTS: When set, enables emitting start and end hook events for user prompt submission; the value is read once and then cleared.CLAUDE_CODE_HOST_OWNED_CONFIG_DIR: Names a config directory managed by the host application; when it matches the config directory and that config is empty or broken, starts with default settings silently instead of warning.CLAUDE_CODE_MANAGED_CONFIG_PREFETCH: Turns on a hedged prefetch of the organization's managed settings during startup, so the first managed-settings fetch runs earlier in the launch sequence.CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG: Limits what a session's own Claude Code files may do.CLAUDE_CONFIG_DIR: Custom config directory.CLAUDE_SECURESTORAGE_CONFIG_DIR: Sets the directory for secure credential storage, using ~/.claude when set to an empty string and a default location when unset; the value is passed to child processes.
Frequently asked questions
What does CLAUDE_CODE_CONFIG_WATCH_EVENTS do?
On Linux, when set, watches config files with filesystem events instead of interval polling; ignored on other platforms.
Which Claude Code version has CLAUDE_CODE_CONFIG_WATCH_EVENTS?
Added in v2.1.288 and still present in v2.1.332.
How do I set CLAUDE_CODE_CONFIG_WATCH_EVENTS?
Export it before starting Claude Code (export CLAUDE_CODE_CONFIG_WATCH_EVENTS=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.