Repository navigation
Conversation
Studio's Claude hook saved the whole environment at session start and was sourced after any user-level loader, so it put back stale tools after a flake change and approved every .envrc unconditionally. The Codex hook wrote a snapshot nothing read, and .codex/config.toml pointed BASH_ENV at a user-level file. Agents now inherit the dev shell from the shell that starts them, or from a user-level loader, as moq-dev/moq#8183 did upstream. 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.
Problem
Studio kept the Claude Code and Codex
SessionStartdev-shell hooks it inherited from moq, which moq dropped in moq-dev/moq#8183. With a user-level dev-shell loader installed, they get in its way:.claude/hooks/direnv.shsaves the whole environment at session start (it unsets every inherited variable and re-exports all of them). Claude Code sources it after the user-level hook on every command, so it overrides whatever that loader applied. After a flake or lock change mid-session (such asjust upgrade-moq), the loader recaptures, then the saved copy puts back the stalePATH.direnv allow .unconditionally. A checked-out fork branch that only editsflake.nixgets its dev shell evaluated automatically..codex/hooks/direnv.shwrites.direnv/codex-env.sh, which nothing reads..codex/config.tomlpointsBASH_ENVat$HOME/.codex/bash-env.sh, a user-level file. Without that file, bash silently ignores the setting, so contributors without it got no dev shell from the repo either way.Approach
Delete the hooks and their wiring, as moq did:
.claude/hooks/direnv.shanddirenv.test.sh, plus theSessionStartentry in.claude/settings.json(its permissions stay).codex/hooks.json,.codex/config.toml, and.codex/hooks/direnv.shjustfile's shellcheck and shfmt globs, and the test line injust testCONTRIBUTING.md gets one line: start an agent from a shell that has the dev shell (
direnv allowornix develop), and its commands inherit the pinned tools.Impact
Alternatives
direnv allow, export only what the dev shell changes, and skip when a loader is present. Rejected because it keeps a script and its test that the maintainer's setup never runs, while starting the agent from the dev shell already covers that case.Follow-ups
None.
Decisions
.gitignorekeeps.direnv, which direnv itself still writes.Validation
nix develop --command just cipasses locally: lints, plus 567 tests passed.SessionStarthook.just,cargo, andtaploresolved from the dev shell, andDEV_SHELL_ROOTnamed this checkout.PATH.Models
Size: XS
Implementer: Claude Code, claude-opus-5-5, unknown
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)