From 03d91ffdddb6791bf9201894b2ee9c4e2c194eb3 Mon Sep 17 00:00:00 2001 From: Teigen Date: Thu, 16 Apr 2026 15:54:59 +0800 Subject: [PATCH 1/3] feat: add thinking effort setting for new sessions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow configuring CLAUDE_CODE_EFFORT_LEVEL (low/medium/high/max) from Settings → Claude Permissions. Applied as envOverride on session creation. --- src/web/public/index.html | 11 +++++++++++ src/web/public/session-ui.js | 4 ++++ src/web/public/settings-ui.js | 2 ++ 3 files changed, 17 insertions(+) diff --git a/src/web/public/index.html b/src/web/public/index.html index 50daf7c7..963af0c7 100644 --- a/src/web/public/index.html +++ b/src/web/public/index.html @@ -1095,6 +1095,17 @@

App Settings

Use 1M token context window (model: opus[1m]) for all new sessions +
+ + + Set CLAUDE_CODE_EFFORT_LEVEL for all new sessions (default = no override) +
Nice Priority
diff --git a/src/web/public/session-ui.js b/src/web/public/session-ui.js index 86fccf80..dc1e79b1 100644 --- a/src/web/public/session-ui.js +++ b/src/web/public/session-ui.js @@ -323,6 +323,10 @@ Object.assign(CodemanApp.prototype, { if (caseSettings.agentTeams || globalSettings.agentTeamsEnabled) { envOverrides.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS = '1'; } + const thinkingEffort = globalSettings.thinkingEffort; + if (thinkingEffort) { + envOverrides.CLAUDE_CODE_EFFORT_LEVEL = thinkingEffort; + } const hasEnvOverrides = Object.keys(envOverrides).length > 0; const useOpus1m = caseSettings.opusContext1m || globalSettings.opusContext1mEnabled; const modelOverride = useOpus1m ? 'opus[1m]' : ''; diff --git a/src/web/public/settings-ui.js b/src/web/public/settings-ui.js index 3ee0ab24..a29a52be 100644 --- a/src/web/public/settings-ui.js +++ b/src/web/public/settings-ui.js @@ -334,6 +334,7 @@ Object.assign(CodemanApp.prototype, { // Claude Permissions settings document.getElementById('appSettingsAgentTeams').checked = settings.agentTeamsEnabled ?? false; document.getElementById('appSettingsOpusContext1m').checked = settings.opusContext1mEnabled ?? false; + document.getElementById('appSettingsThinkingEffort').value = settings.thinkingEffort ?? ''; // CPU Priority settings const niceSettings = settings.nice || {}; document.getElementById('appSettingsNiceEnabled').checked = niceSettings.enabled ?? false; @@ -1134,6 +1135,7 @@ Object.assign(CodemanApp.prototype, { // Claude Permissions settings agentTeamsEnabled: document.getElementById('appSettingsAgentTeams').checked, opusContext1mEnabled: document.getElementById('appSettingsOpusContext1m').checked, + thinkingEffort: document.getElementById('appSettingsThinkingEffort').value, // CPU Priority settings nice: { enabled: document.getElementById('appSettingsNiceEnabled').checked, From 534899bc2b667de29b604e8a415d6f4db0ce5f53 Mon Sep 17 00:00:00 2001 From: Teigen Date: Tue, 21 Apr 2026 23:36:27 +0800 Subject: [PATCH 2/3] feat: add xhigh effort option and /effort max mobile shortcut Add XHigh option to Thinking Effort dropdown (between High and Max), and add a Max quick button to the mobile keyboard accessory bar that sends /effort max as a slash command. --- src/web/public/index.html | 1 + src/web/public/keyboard-accessory.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/web/public/index.html b/src/web/public/index.html index 963af0c7..0a744e40 100644 --- a/src/web/public/index.html +++ b/src/web/public/index.html @@ -1102,6 +1102,7 @@

App Settings

+ Set CLAUDE_CODE_EFFORT_LEVEL for all new sessions (default = no override) diff --git a/src/web/public/keyboard-accessory.js b/src/web/public/keyboard-accessory.js index e58aebba..4785eda7 100644 --- a/src/web/public/keyboard-accessory.js +++ b/src/web/public/keyboard-accessory.js @@ -92,6 +92,7 @@ const KeyboardAccessoryBar = { + @@ -125,7 +126,7 @@ const KeyboardAccessoryBar = { this.handleAction(action, btn); // Refocus terminal so keyboard stays open (tap blurs terminal → keyboard dismisses → toolbar shifts) - const refocusActions = new Set(['scroll-up', 'scroll-down', 'arrow-left', 'arrow-right', 'tab', 'shift-tab', 'ctrl-o', 'opt-enter', 'esc']); + const refocusActions = new Set(['scroll-up', 'scroll-down', 'arrow-left', 'arrow-right', 'tab', 'shift-tab', 'ctrl-o', 'opt-enter', 'esc', 'effort-max']); if (refocusActions.has(action) || ((action === 'clear' || action === 'compact') && this._confirmAction)) { if (typeof app !== 'undefined' && app.terminal) { @@ -184,6 +185,9 @@ const KeyboardAccessoryBar = { case 'ctrl-o': this.sendKey('\x0f'); break; + case 'effort-max': + this.sendCommand('/effort max'); + break; case 'init': this.sendCommand('/init'); break; From 3cf486730ba6b564d188c6708345f6012027f4ee Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 28 Apr 2026 02:20:11 +0200 Subject: [PATCH 3/3] fix: allowlist thinkingEffort in SettingsUpdateSchema Without this, PUT /api/settings rejects the new field with INVALID_INPUT (schema is .strict()), so the dropdown's value never persists. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/web/schemas.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/web/schemas.ts b/src/web/schemas.ts index 87629d1e..bdc964f6 100644 --- a/src/web/schemas.ts +++ b/src/web/schemas.ts @@ -267,6 +267,7 @@ export const SettingsUpdateSchema = z tunnelEnabled: z.boolean().optional(), tabTwoRows: z.boolean().optional(), agentTeamsEnabled: z.boolean().optional(), + thinkingEffort: z.string().max(20).optional(), // UI visibility showFontControls: z.boolean().optional(), showSystemStats: z.boolean().optional(),