Skip to content

compose: persist the clayde container's top-level Claude config - #109

Merged
max-tet merged 1 commit into
mainfrom
fix/persist-claude-json-mount
Oct 16, 2026
Merged

max-tet merged 1 commit into
mainfrom
fix/persist-claude-json-mount

Conversation

@ClaydeCode

Copy link
Copy Markdown
Owner

Summary

  • The clayde service mounts ~/clayde-claude to /home/clayde/.claude, but never sets CLAUDE_CONFIG_DIR, so the CLI's top-level config file (.claude.json, which holds per-project trust state) defaults to $HOME/.claude.json — a path outside that mount, living only in the container's ephemeral layer.
  • Every container restart wipes that file. The next scheduled/Pebble job then hits Claude configuration file not found at: /home/clayde/.claude.json, and once the CLI regenerates a fresh default, it no longer has hasTrustDialogAccepted for /home/clayde/knowledge_base — so settings.local.json's permissions.allow entries get silently ignored (no human available to re-accept the trust dialog in a headless run).
  • Fix: set CLAUDE_CONFIG_DIR=/home/clayde/.claude on the clayde service, matching the mount and the one-time host login (CLAUDE_CONFIG_DIR=~/clayde-claude claude login) the README already documents. This makes the top-level config file live inside the already-persisted directory mount instead of defaulting to an unmounted path.
  • Confirms via production logs: this exact failure hit last night's freeshard-expert-testing-rigor scheduled one-off task — it failed outright (job 14cff920), and being a one-off, it's already marked done and won't retry.

Test plan

  • docker compose up -d to deploy, confirm the container starts clean
  • Restart the container (docker compose restart clayde) and confirm the next job does not hit "Claude configuration file not found"
  • Confirm settings.local.json permissions are honored (no "workspace has not been trusted" warning) on the run after restart

CLAUDE_CONFIG_DIR was never set on the running container, so the CLI's
top-level config file (project trust state among it) defaulted to
$HOME/.claude.json, a path outside the ~/clayde-claude mount. Every
container restart wiped it, surfacing as "Claude configuration file
not found" on the next job and silently dropped settings.local.json
permissions afterward, since headless runs can't re-accept the trust
dialog. Set CLAUDE_CONFIG_DIR=/home/clayde/.claude to match the mount
and the one-time host login, as the README already describes it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@max-tet
max-tet merged commit 1a49698 into main Oct 16, 2026
3 checks passed
@max-tet
max-tet deleted the fix/persist-claude-json-mount branch October 16, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants