From 3f57937d54d08c8d17886c6ea1f24646d2a58204 Mon Sep 17 00:00:00 2001 From: Hikari Date: Wed, 6 May 2026 13:37:13 -0700 Subject: [PATCH] feat: expose effort level setting in UI (#269) Adds `--effort ` CLI flag support with a dropdown selector in the config sidebar. Valid options are low, medium, high, xhigh (Opus 4.7 only), and max. --- src-tauri/src/config.rs | 12 +++++++++++ src-tauri/src/wsl_bridge.rs | 15 +++++++++++++ src/lib/commands/slashCommands.ts | 2 ++ src/lib/components/ConfigSidebar.svelte | 24 +++++++++++++++++++++ src/lib/components/ElicitationModal.svelte | 1 + src/lib/components/InputBar.svelte | 1 + src/lib/components/PermissionModal.svelte | 1 + src/lib/components/StatusBar.svelte | 3 +++ src/lib/components/TaskLoopPanel.svelte | 1 + src/lib/components/UserQuestionModal.svelte | 1 + src/lib/stores/config.test.ts | 3 +++ src/lib/stores/config.ts | 3 +++ 12 files changed, 67 insertions(+) diff --git a/src-tauri/src/config.rs b/src-tauri/src/config.rs index 9ca2af7..157aec3 100644 --- a/src-tauri/src/config.rs +++ b/src-tauri/src/config.rs @@ -70,6 +70,11 @@ pub struct ClaudeStartOptions { /// Sets `ANTHROPIC_CUSTOM_MODEL_OPTION` env var for custom model providers (v2.1.81+). #[serde(default)] pub custom_model_option: Option, + + /// Passes `--effort ` to set the effort level (v2.1.111+). + /// Valid values: "low", "medium", "high", "xhigh" (Opus 4.7 only), "max". None uses CLI default. + #[serde(default)] + pub effort_level: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -236,6 +241,11 @@ pub struct HikariConfig { /// Sets `ANTHROPIC_CUSTOM_MODEL_OPTION` env var for custom model providers (v2.1.81+). #[serde(default)] pub custom_model_option: Option, + + /// Passes `--effort ` to set the effort level (v2.1.111+). + /// Valid values: "low", "medium", "high", "xhigh" (Opus 4.7 only), "max". None uses CLI default. + #[serde(default)] + pub effort_level: Option, } impl Default for HikariConfig { @@ -291,6 +301,7 @@ impl Default for HikariConfig { bare_mode: false, show_clear_context_on_plan_accept: true, custom_model_option: None, + effort_level: None, } } } @@ -508,6 +519,7 @@ mod tests { bare_mode: false, show_clear_context_on_plan_accept: true, custom_model_option: None, + effort_level: None, }; let json = serde_json::to_string(&config).unwrap(); diff --git a/src-tauri/src/wsl_bridge.rs b/src-tauri/src/wsl_bridge.rs index 4197fdf..2267af2 100644 --- a/src-tauri/src/wsl_bridge.rs +++ b/src-tauri/src/wsl_bridge.rs @@ -308,6 +308,14 @@ impl WslBridge { cmd.arg("--bare"); } + // Add effort level if specified (v2.1.111+) + if let Some(ref level) = options.effort_level { + if !level.is_empty() { + cmd.arg("--effort"); + cmd.arg(level); + } + } + // Pass combined settings via --settings flag if any settings are specified { let has_memory_dir = options @@ -532,6 +540,13 @@ impl WslBridge { claude_cmd.push_str(" --bare"); } + // Add effort level if specified (v2.1.111+) + if let Some(ref level) = options.effort_level { + if !level.is_empty() { + claude_cmd.push_str(&format!(" --effort {}", level)); + } + } + // Pass combined settings via --settings flag if any settings are specified { let has_memory_dir = options diff --git a/src/lib/commands/slashCommands.ts b/src/lib/commands/slashCommands.ts index 4bef72e..a41d921 100644 --- a/src/lib/commands/slashCommands.ts +++ b/src/lib/commands/slashCommands.ts @@ -77,6 +77,7 @@ async function changeDirectory(path: string): Promise { bare_mode: config.bare_mode ?? false, show_clear_context_on_plan_accept: config.show_clear_context_on_plan_accept ?? true, custom_model_option: config.custom_model_option || null, + effort_level: config.effort_level || null, }, }); @@ -164,6 +165,7 @@ async function startNewConversation(): Promise { bare_mode: config.bare_mode ?? false, show_clear_context_on_plan_accept: config.show_clear_context_on_plan_accept ?? true, custom_model_option: config.custom_model_option || null, + effort_level: config.effort_level || null, }, }); diff --git a/src/lib/components/ConfigSidebar.svelte b/src/lib/components/ConfigSidebar.svelte index d057762..eb34cf5 100644 --- a/src/lib/components/ConfigSidebar.svelte +++ b/src/lib/components/ConfigSidebar.svelte @@ -78,6 +78,7 @@ task_loop_auto_commit: false, task_loop_commit_prefix: "feat", task_loop_include_summary: false, + effort_level: null, }); let showCustomThemeEditor = $state(false); @@ -716,6 +717,29 @@

+ +
+ + +

+ Passes --effort to tune speed vs. intelligence. Requires Claude + Code v2.1.111+. +

+
+