Repository navigation
chore(devcontainer): default Claude to max effort and keep more state - #196
Merged
Merged
Conversation
Claude Code's settings file accepts an effortLevel of low to xhigh and drops "max", so only CLAUDE_CODE_EFFORT_LEVEL can make max the default. It outranks /effort too; `CLAUDE_CODE_EFFORT_LEVEL=auto claude` opts a session out. CLAUDE_CONFIG_DIR keeps .claude.json in the claude-config volume. It landed in ~/ instead, so every rebuild lost the account and onboarding state. Two new volumes keep shell history and ~/.cache, where containerEnv already sends bun and npm. post-create takes ownership of both before anything writes, and appends one HISTFILE line to each rc file; NODE_REPL_HISTORY joins them on the volume. The image's Python is 3.12, which reads no PYTHON_HISTORY, and it has no psql, so neither is set. gh had a volume, but nothing ever logged it in. post-create now seeds it from the host's exported GH_TOKEN and writes no git config, because VS Code copies the host's ~/.gitconfig only into a container that has none. A new post-attach hook asks VS Code's forwarded credential helper when gh still has no token, then points git's github.com credential at gh. lib/github-auth.sh is a verbatim copy of the canonical script in musher-dev/development-container. Also adds the Claude Code VS Code extension. Codex stays opt-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Ali <amirali.sadrzadeh@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #195.
Summary
containerEnvsetsCLAUDE_CODE_EFFORT_LEVEL=max, because the settings file'seffortLevelaccepts onlylowtoxhighand quietly dropsmax. The variable outranks/effort, so start a lighter session asCLAUDE_CODE_EFFORT_LEVEL=auto claude..claude.jsonsurvives a rebuild.CLAUDE_CONFIG_DIR=/home/vscode/.claudekeeps it in theclaude-configvolume, beside the credentials and the/resumetranscripts. Until now it landed in~/and was lost.musher-${devcontainerId}-shell-history(zsh and bash history, whichbase_setup_shell_historypoints there, and Node's REPL history, throughNODE_REPL_HISTORY) and-cache(~/.cache, wherecontainerEnvalready sends bun and npm). Both are inbase_setup_config_dirs/base_setup_cache_dirs, which take ownership before anything writes..devcontainer/scripts/lib/github-auth.sh):github_auth_seedthrough a newbase_setup_github_seed, right after the ownership steps. It stores a token from the host's exportedGH_TOKEN(MUSHER_HOST_GH_TOKEN) and writes no git config.post-attach.shcallsensure_github_auth. If gh still has no token, it asks VS Code's forwarded credential helper. Then it clears the helper lines the host's.gitconfigbrought for the host's own gh, and runsgh auth setup-git. This waits for an attach because VS Code copies the host's~/.gitconfigonly when it attaches, and only into a container that has none: a file written earlier would cost you your name and email.MUSHER_INSTALL_CODEX=1in.devcontainer/.env); its pin and its volume were already here.github-auth.shis a verbatim copy of the canonical script in musher-dev/development-container#55. The first repository to use it is musher-dev/platform-backstage#114. Typechore: nothing underspecifications/changes, so no family is released.What a rebuild keeps
musher-${devcontainerId}-…)gh-config~/.config/ghghloginclaude-config~/.claude/resume), and now.claude.jsoncodex-config~/.codexshell-history(new)~/.shell-historycache(new)~/.cachecontainerEnvpoints there, and every other tool's XDG cache, mise's and Claude Code's among themtools/node_modules/,dist/and the git hooks stay where they were, in your checkout on the bind mount.Before and after your first rebuild
.claude.jsonused to live outside the volume, so Claude Code may run its first-run steps once more after this rebuild. It keeps them from then on.repoandread:orgscopes, as some credential managers' tokens do, rungh auth loginonce. Thegh-configvolume keeps it.Test plan
devcontainer read-configuration --include-merged-configuration(CLI 0.89.0): parses, and the merged mounts are the five volumes, no Feature adding one.shellcheck -x --source-path=SCRIPTDIRover all 9.devcontainerscripts: clean.task check:shelland CI's ShellCheck job (scandir: .devcontainer/scripts) already cover both new files.task lint(format, config, rulesets, commits, docs, links, ADRs, markdown, spelling, shell, workflows): clean, as onmain.conventions check --fail-on warningat the pinned 0.7.0: no findings, as onmain.task check, which the pre-push hook runs: passed.Signed-off-bymatches its author.devcontainer build --frozen-lockfile: succeeds. No Feature changed, sodevcontainer-lock.jsonis untouched. CI'sFeature Lockfilejob runs the same build but no lifecycle hook, so the next item ran locally.devcontainer up, with noGH_TOKENorGITHUB_TOKENpassed in:CLAUDE_CODE_EFFORT_LEVEL=max,CLAUDE_CONFIG_DIR=/home/vscode/.claude, andNODE_REPL_HISTORYpoints at the volume. The image's Python is 3.12.3, which reads noPYTHON_HISTORY, and it has nopsql, so neither variable is set.~/.configand~/.localare owned byvscode.~/.configalready exists in the image, so no mount makes Docker create a root-owned parent..claude.jsoninside the volume, at~/.claude/.claude.json; there is no~/.claude.json.~/.shell-history.~/.gitconfigafter create and attach.MUSHER_HOST_GH_TOKENthat GitHub refuses is logged and skipped, and the seed still exits 0. A secondpost-attach.shexits 0.MUSHER_INSTALL_CODEXis unset.task bundlebuiltdist/.bun installhad nothing to do, because the clone'stools/node_modulesalready existed.ShellCheck,Feature LockfileandCommits / Sign-offincluded.Record pending releaseskips, because it runs only on release-please branches./resumelists earlier sessions, history survives.🤖 Generated with Claude Code