Skip to content

CLAUDE_CONFIG_DIR not passed to subprocess env, breaking non-default config locations #1098

@halindrome

Description

@halindrome

Bug Description

When CLAUDE_CONFIG_DIR is set to a non-default location (e.g., ~/.config/claude-code/ instead of ~/.claude/), the Claude subprocess fails to authenticate because CLAUDE_CONFIG_DIR is not included in the subprocess environment allowlist.

This results in "Not logged in - Please run login" errors in the Web UI, even when the user is fully authenticated via claude auth status.

Root Cause

packages/core/src/utils/env-allowlist.ts defines SUBPROCESS_ENV_ALLOWLIST — the set of env vars passed to Claude Code subprocesses. CLAUDE_CONFIG_DIR is missing from this list, so when a user has their Claude config in a non-default directory, the subprocess falls back to ~/.claude/ and can't find credentials.

Steps to Reproduce

  1. Set CLAUDE_CONFIG_DIR to a non-default path (e.g., ~/.config/claude-code/)
  2. Authenticate with claude /login
  3. Start Archon with bun run dev
  4. Send a message via the Web UI
  5. Observe "Not logged in" error

Fix

Add 'CLAUDE_CONFIG_DIR' to the SUBPROCESS_ENV_ALLOWLIST in packages/core/src/utils/env-allowlist.ts, alongside the other Claude auth/config variables:

  // Claude auth and config
+ 'CLAUDE_CONFIG_DIR',
  'CLAUDE_USE_GLOBAL_AUTH',
  'CLAUDE_API_KEY',

Environment

  • macOS (Darwin)
  • Claude Code 2.1.101
  • Auth method: Claude Max (OAuth via claude.ai)
  • CLAUDE_CONFIG_DIR=/Users/.../.config/claude-code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions