Silent failure (exit 0, empty output) with CLAUDE_CONFIG_DIR isolation on 2.1.123+

Resolved 💬 1 comment Opened May 16, 2026 by kitepon-rgb Closed Jun 14, 2026

Summary

When running claude -p ... with CLAUDE_CONFIG_DIR set to a non-default
directory, versions 2.1.123 and later silently produce empty output and
exit 0 with no error. Version 2.1.91 works correctly with the same setup.

Environment

  • Container: node:24-slim (Debian)
  • Working version: 2.1.91
  • Broken versions: 2.1.123 → 2.1.143 (latest as of 2026-05-16)

Reproduction

mkdir /tmp/isolated-config
cp ~/.claude/.credentials.json /tmp/isolated-config/.credentials.json
chmod 600 /tmp/isolated-config/.credentials.json

docker run --rm \
  -v ~/.claude:/home/node/.claude:ro \
  -v /tmp/isolated-config:/home/node/isolated-config:ro \
  -e CLAUDE_CONFIG_DIR=/home/node/isolated-config \
  --user node \
  node:24-slim sh -c '
    npm install -g @anthropic-ai/claude-code@2.1.143 >/dev/null 2>&1
    claude -p "reply only OK" --model haiku --dangerously-skip-permissions
    echo "exit=$?"
  '

Expected

OK
exit=0

Actual

(empty stdout)
exit=0

total_cost_usd in the streaming result event is 0, and all usage
token counters are 0.

Observation

With --debug, the CLI successfully reads .credentials.json, builds
an Authorization: Bearer ... header, and issues a GET to
/api/oauth/profile. The process then exits without performing the
actual chat completion. No error is printed to stdout or stderr.

Removing CLAUDE_CONFIG_DIR and using only the default $HOME/.claude/
path with the same credentials works correctly.

Workaround

Pin to @anthropic-ai/claude-code@2.1.91. This is unsustainable as it
prevents access to newer features (e.g. xhigh effort level introduced
in a later version).

Impact

A 24/7 bot using CLAUDE_CONFIG_DIR to isolate its Claude session
from user-scope MCP / CLAUDE.md / skills (a documented isolation
strategy) is silently dead on upgrade — all chat / cron / extraction
calls return empty. The lack of any error message makes the failure
mode very hard to diagnose.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗