feat(effort): add effort_lock setting to allow Claude Code /effort in-chat#3705
Closed
ckumar1 wants to merge 1 commit intogastownhall:mainfrom
Closed
feat(effort): add effort_lock setting to allow Claude Code /effort in-chat#3705ckumar1 wants to merge 1 commit intogastownhall:mainfrom
ckumar1 wants to merge 1 commit intogastownhall:mainfrom
Conversation
…-chat When gt sets CLAUDE_CODE_EFFORT_LEVEL in agent env, Claude Code locks the effort tier for the session and refuses to honor the in-chat /effort command. Some operators want gt to seed the role default but still let the agent change tier mid-session. Add `effort_lock: bool` to TownSettings and RigSettings (rig overrides town; default true preserves existing behavior). When set to false, gt omits CLAUDE_CODE_EFFORT_LEVEL from agent env entirely; Claude Code starts at its own default and /effort works. - internal/config/types.go: add EffortLock *bool to TownSettings/RigSettings. - internal/config/loader.go: add ResolveEffortLock(townRoot, rigPath) bool. - internal/config/env.go: gate the env var write on ResolveEffortLock. - internal/config/env_test.go: cover the new behavior + unset-defaults-to-true. Executed-By: gastown/crew/woodhouse
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Summary
Today gt always sets
CLAUDE_CODE_EFFORT_LEVELin the agent's environment, which causes Claude Code to lock the effort tier for the session and refuse the in-chat/effortcommand. Some operators want to seed the role default but still let the agent change tier mid-session via/effort. This PR makes the lock optional via a neweffort_locksetting.Motivation
The current behavior is appropriate for tightly-managed fleets where operators want strict per-role effort and don't want agents bumping themselves to higher tiers ad-hoc. But for solo operators and exploratory work, Claude Code's
/effortis a natural in-chat knob, and the env-var lock surfaces as a confusing error: "Not applied: CLAUDE_CODE_EFFORT_LEVEL=high overrides effort this session". Today the only escape hatches aregt start --effortorGT_EFFORT, both of which require restarting the session.Changes
internal/config/types.go: addEffortLock *boolto bothTownSettingsandRigSettings. Pointer for tri-state (nil = use default).internal/config/loader.go: addResolveEffortLock(townRoot, rigPath) bool— rig overrides town, defaults totrueso existing fleets see no behavior change.internal/config/env.go: gate theenv["CLAUDE_CODE_EFFORT_LEVEL"] = effortwrite onResolveEffortLockreturning true.internal/config/env_test.go: tests foreffort_lock=false(env var omitted) and unset (defaults to locked).Behavior
effort_lock/effortin-chattruefalseWhen
effort_lock=false, the role-resolved effort isn't applied at startup. Operators who want both — start at the role default AND allow/effort— would need a follow-up that passes effort via Claude Code's--effortCLI flag instead of via env var (potentially overridable by/effort); that's deliberately out of scope here so the change stays minimal and predictable.Configuration
In
<townRoot>/settings/config.jsonor<rigPath>/settings/config.json:{ "effort_lock": false }Testing
go test ./internal/config/...— green, including the two new test cases.effort_lock: falsein town settings, started a Claude session and ran/effort highin-chat — applied successfully (no override message). With the setting removed, the override message returns.Checklist
EffortLocknil → locked, same as before).