[Feature Request] Add session-level effort override without persisting to default configuration

Status Fixed / completed
Reported on v2.1.170
Maintainer reply ✓ Yes — bcherny
Activity 4 comments · opened Jun 10, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Bug Description
would be nice to be able to switch effort for just a session without changing the default. I'd much rather have a default of xhigh and bump it to max or scale it down in a session without it leaking into every new session

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.170
  • Feedback ID: 269f7a30-d756-42a8-beaa-5dbe957d4657

Errors

[]

View original on GitHub ↗

3 Comments

JackMBurch · 1 month ago

Yeah, this would be super helpful. Finding myself constantly having to change the default back.

JackMBurch · 1 month ago

Here's a / command and script I wrote to allow you to easily change the default effort level back after changing the effort level in a session in case anyone finds it helpful:

/default-effort — change Claude Code's default effort without touching your current session

The problem: Claude Code's /effort <level> changes both the current session's effort and the persisted default that every new session inherits. That coupling can't be disabled. So there's no built-in way to bump just the current session without also changing the default for all future sessions.

The fix: a small slash command, /default-effort [level], that patches only the persisted default. Running it does not affect your current session (the default is read at session start, not hot-reloaded — verified). With no argument it resets the default to medium.

/effort high           # session + default both go high (built-in behavior)
/default-effort medium # default drops back to medium; current session stays high
/default-effort        # same as: /default-effort medium

It works because the default is a single key, "effortLevel", in ~/.claude/settings.json. The command just surgically rewrites that one key.

Requirements

  • jq installed (which jq).

Setup — 2 files

1. ~/.claude/scripts/set-default-effort.sh

#!/usr/bin/env bash
# set-default-effort.sh — set the DEFAULT effort level for NEW Claude Code sessions.
# Patches only the "effortLevel" key in ~/.claude/settings.json. Does NOT change the
# effort of the currently running session. No argument resets the default to "medium".
# Usage: set-default-effort.sh [low|medium|high]
set -euo pipefail

SETTINGS="${CLAUDE_SETTINGS:-$HOME/.claude/settings.json}"
VALID=(low medium high)   # levels /effort accepts; extend this line if more are added
level="${1:-medium}"

ok=0
for v in "${VALID[@]}"; do [[ "$level" == "$v" ]] && ok=1 && break; done
if [[ "$ok" -ne 1 ]]; then
  printf 'error: invalid effort level: %q\n' "$level" >&2
  printf 'valid levels: %s\n' "${VALID[*]}" >&2
  exit 1
fi

command -v jq >/dev/null 2>&1 || { echo "error: jq not found on PATH" >&2; exit 1; }
[[ -f "$SETTINGS" ]] || { echo "error: settings file not found: $SETTINGS" >&2; exit 1; }
jq empty "$SETTINGS" >/dev/null 2>&1 || {
  echo "error: $SETTINGS is not valid JSON; refusing to write" >&2; exit 1; }

tmp="$(mktemp "${SETTINGS}.XXXXXX")"
trap 'rm -f "$tmp"' EXIT
jq --arg l "$level" '.effortLevel = $l' "$SETTINGS" > "$tmp"
jq empty "$tmp" >/dev/null 2>&1 || {
  echo "error: produced invalid JSON; aborting without writing" >&2; exit 1; }
mv "$tmp" "$SETTINGS"
trap - EXIT

echo "Default effort for new sessions set to: $level"

2. ~/.claude/commands/default-effort.md

---
description: Set the default effort level for new Claude Code sessions (does not affect the current session)
argument-hint: "[low|medium|high]  (default: medium)"
allowed-tools: Bash(bash:*)
---
Run `bash $HOME/.claude/scripts/set-default-effort.sh $ARGUMENTS` and report the resulting
default effort to the user.

Important: this changes only the default that *new* sessions inherit (the `effortLevel` key
in `~/.claude/settings.json`). It does NOT change the current session's effort. To change the
current session, use the built-in `/effort` command (which also updates this default).

Install

mkdir -p ~/.claude/scripts ~/.claude/commands
# then save the two files above to those paths, and:
chmod +x ~/.claude/scripts/set-default-effort.sh

Reload commands in Claude Code (/reload-skills, or start a new session) and you're set.

Notes

  • Safe by design: validates the level, refuses to write if settings.json is missing/malformed, and writes atomically (temp file + mv) so your settings can't be corrupted mid-write.
  • You can also run it straight from a shell: bash ~/.claude/scripts/set-default-effort.sh high.
  • If Claude Code adds new effort levels later, add them to the VALID=(...) line.
bcherny collaborator · 14 days ago

You can do this with the --effort flag: claude --effort max (or low, medium, high, xhigh) applies to that session only and does not change your saved default. Keep effortLevel in settings.json (or set it once with /effort) as your baseline, and pass --effort when you want a one-off bump or drop.

Docs: https://code.claude.com/docs/en/cli-reference and https://code.claude.com/docs/en/model-config#adjust-effort-level

🤖 Generated with Claude Code

Showing cached comments. Read the full discussion on GitHub ↗