Repository navigation
chore(devcontainer): default Claude to max effort and keep more state - #31
Open
amiralis1365 wants to merge 2 commits into
Open
amiralis1365 wants to merge 2 commits into
amiralis1365 wants to merge 2 commits into
Conversation
Claude Code's settings file has no "max" effort, so CLAUDE_CODE_EFFORT_LEVEL is the only way to start every session there. It outranks /effort, and `CLAUDE_CODE_EFFORT_LEVEL=auto claude` opts one session out. Without CLAUDE_CONFIG_DIR, Claude writes .claude.json to ~/, outside its volume, so every rebuild lost the account and onboarding state. Two new volumes keep shell and REPL history and the download caches across a rebuild as well; post-create takes ownership of both before anything writes to them. post-create now seeds gh from the host's exported GH_TOKEN, and a new post-attach hook wires git to it. Not earlier: VS Code copies the host's ~/.gitconfig only after post-create, and only when none exists, so a file written first would cost the developer their identity. github-auth.sh is a verbatim copy of the canonical file in musher-dev/development-container. The ShellCheck job scans all of .devcontainer now, because the aliases file under config/shell sat outside its scan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
base:ubuntu now resolves to Ubuntu 26.04 "resolute", where the docker-in-docker Feature refuses its default moby option, so the dev container no longer builds, on main as well. ubuntu-24.04 is the template's image and the release these containers ran before the tag moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 #30.
Summary
The dev container builds again. A separate commit pins the base image to
mcr.microsoft.com/devcontainers/base:ubuntu-24.04, the template's image.base:ubuntufloats, and it now resolves to Ubuntu 26.04 "resolute", where the docker-in-docker Feature (2.17.0) refuses its defaultmobyoption: the build stopped in that Feature, onmaintoo, before any lifecycle script ran.Claude Code starts every session at max effort.
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.A rebuild keeps more. Two new
musher-${devcontainerId}-<purpose>volumes join the gh, Claude and Codex ones:shell-history: zsh, bash, Node, Python and psql history.base_setup_shell_historypoints zsh and bash there, andcontainerEnvpoints the REPLs there.cache:~/.cache, wherecontainerEnvalready sends uv, pip, npm, bun, Go, Deno, ruff and mypy, so post-create'suv syncno longer starts from an empty cache on each rebuild.base_setup_config_dirsandbase_setup_cache_dirstake ownership of both before anything writes to them.gh logs in by itself, and git pushes through it (
.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 after post-create, and only into a container that has none: a file written earlier would cost you your name and email.The ShellCheck job scans all of
.devcontainer. It scanned.devcontainer/scripts, which left outconfig/shell/aliases.shared.sh, the file zsh sources on every start. Its change filter now covers that directory too.Also: the Claude Code VS Code extension. The commented-out
dind-datamount gives way to a note: the docker-in-docker Feature already keeps/var/lib/docker, where the compose services' data lives, on a volume of its own.github-auth.shis a verbatim copy of the canonical script in musher-dev/development-container#55; musher-dev/platform-backstage#114 was the first repository to copy it. Its siblingnpm-registry.shisn't copied, because nothing here installs from GitHub Packages. Typechore: nothing the package ships changes, so release-please cuts no release.What a rebuild keeps
musher-${devcontainerId}-…)gh-config~/.config/ghghloginclaude-config~/.claude/resume), and now.claude.jsoncodex-config~/.codexshell-history(new)~/.shell-historycache(new)~/.cacheThe compose stack's data, Postgres included, was already kept by the docker-in-docker Feature's own
dind-var-lib-docker-${devcontainerId}volume..venv/and the examples' dependencies stay where they were, in your checkout on the bind mount. Claude Code, under~/.local, and the global npm packages Codex and lefthook are still not kept; post-create installs them again.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(CLI 0.89.0): parses. The merged mounts are the fivemusher-${devcontainerId}-…volumes plus the docker-in-docker Feature'sdind-var-lib-docker-${devcontainerId}.postAttachCommand,MUSHER_HOST_GH_TOKENand the five newcontainerEnvkeys are there, andwaitForis unchanged.shellcheck -x --source-path=SCRIPTDIRover all 8.devcontainershell files: clean. The CI job's widened scan (scandir: .devcontainer, severity warning) picks up the same 8 files, and they pass it too.actionlintonvalidate.yaml: clean.devcontainer buildof a cleanmaincheckout (a6d577b) stops in the docker-in-docker Feature with "(!) The 'moby' option is not supported on ubuntu 'resolute' because 'moby-cli' and related system packages are not available in that distribution."task check:lintandtask check:format-check(ruff), anddocker compose -f .devcontainer/compose.yaml config --quiet: clean, as onmain.github-auth.shis byte-identical to the canonical copy at musher-dev/development-container@c12a6ba, andpost-attach.shis the template's.HOME, gh config andXDG_CONFIG_HOME, and no token:base_setup_shell_history, run twice, leaves the marker and one line in each rc file. bash and zsh then readHISTFILEfrom~/.shell-history, unexported.github_auth_seedandpost-attach.shexit 0 with the non-fatal "no GitHub credential reached the container yet" line, and neither writes~/.gitconfig. WithGH_TOKENset, the seed leaves gh to read it.devcontainer buildandupwith fresh volumes and noGH_TOKEN(CLI 0.89.0), on this branch's config. The run used a copy pinned tobase:ubuntu-24.04before the pin commit existed, identical to the committed file apart from the comment above the image line:~/.shell-historyand the cache dirs, and logged the non-fatal line and both history lines.downloads.claude.aianswered the Claude Code installer with 403 from this network throughout the run, though the same download had worked in another repository's run 15 minutes earlier, and this repository's installer does not retry.post-attach.sh, run by hand as an attach would run it, exited 0 with the same non-fatal line.CLAUDE_CODE_EFFORT_LEVEL=max; every mount,~/.configand~/.localowned byvscode; one marker and one line in each rc file;HISTFILEfrom~/.shell-historyin interactive zsh and bash;ensure_github_authresolving; and no~/.gitconfig. Cleanup removed the container and its six volumes.updid not reach the rest of post-create (Codex, lefthook,base_verify_tools, the shell customization block anduv sync), postStart (the compose stack) or post-attach, which ran by hand instead. musher-dev/musher-cli's run of the same additions reached all of them.Devcontainer Build(devcontainers/ci@v0.3) built the pinnedbase:ubuntu-24.04image and randevcontainer upthrough the whole lifecycle. post-create logged the ownership step, the non-fatal "no GitHub credential reached the container yet" line and both history lines, installed Claude Code 2.1.307, passedbase_verify_tools, ranuv syncand finished. postStart ran, and post-attach ran and logged the same non-fatal line. So CI reached the steps the local run above could not./resumelists earlier sessions, history survives.🤖 Generated with Claude Code