diff --git a/src-tauri/src/config.rs b/src-tauri/src/config.rs index 846ec3a..6cf9b23 100644 --- a/src-tauri/src/config.rs +++ b/src-tauri/src/config.rs @@ -37,6 +37,9 @@ pub struct ClaudeStartOptions { #[serde(default)] pub disable_cron: bool, + + #[serde(default = "default_include_git_instructions")] + pub include_git_instructions: bool, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -174,6 +177,9 @@ pub struct HikariConfig { #[serde(default)] pub disable_cron: bool, + + #[serde(default = "default_include_git_instructions")] + pub include_git_instructions: bool, } impl Default for HikariConfig { @@ -221,6 +227,7 @@ impl Default for HikariConfig { task_loop_commit_prefix: "feat".to_string(), task_loop_include_summary: false, disable_cron: false, + include_git_instructions: true, } } } @@ -265,6 +272,10 @@ fn default_task_loop_commit_prefix() -> String { "feat".to_string() } +fn default_include_git_instructions() -> bool { + true +} + #[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] #[serde(rename_all = "lowercase")] pub enum BudgetAction { @@ -360,6 +371,7 @@ mod tests { assert_eq!(config.task_loop_commit_prefix, "feat"); assert!(!config.task_loop_include_summary); assert!(!config.disable_cron); + assert!(config.include_git_instructions); } #[test] @@ -407,6 +419,7 @@ mod tests { task_loop_commit_prefix: "fix".to_string(), task_loop_include_summary: true, disable_cron: true, + include_git_instructions: false, }; let json = serde_json::to_string(&config).unwrap(); @@ -425,6 +438,7 @@ mod tests { assert_eq!(deserialized.task_loop_commit_prefix, "fix"); assert!(deserialized.task_loop_include_summary); assert!(deserialized.disable_cron); + assert!(!deserialized.include_git_instructions); } #[test] diff --git a/src-tauri/src/wsl_bridge.rs b/src-tauri/src/wsl_bridge.rs index be994b9..01807e7 100644 --- a/src-tauri/src/wsl_bridge.rs +++ b/src-tauri/src/wsl_bridge.rs @@ -315,6 +315,11 @@ impl WslBridge { cmd.env("CLAUDE_CODE_DISABLE_CRON", "1"); } + // Disable built-in git instructions if requested + if !options.include_git_instructions { + cmd.env("CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS", "1"); + } + cmd } else { // Running on Windows - use wsl with bash login shell to ensure PATH is loaded @@ -372,6 +377,11 @@ impl WslBridge { claude_cmd.push_str("CLAUDE_CODE_DISABLE_CRON=1 "); } + // Disable built-in git instructions if requested + if !options.include_git_instructions { + claude_cmd.push_str("CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1 "); + } + claude_cmd.push_str( "claude --output-format stream-json --input-format stream-json --verbose", ); diff --git a/src/lib/commands/slashCommands.test.ts b/src/lib/commands/slashCommands.test.ts index 86d8e95..46269e7 100644 --- a/src/lib/commands/slashCommands.test.ts +++ b/src/lib/commands/slashCommands.test.ts @@ -65,6 +65,7 @@ vi.mock("$lib/stores/config", () => ({ use_worktree: false, disable_1m_context: false, max_output_tokens: null, + include_git_instructions: true, }), }, })); diff --git a/src/lib/commands/slashCommands.ts b/src/lib/commands/slashCommands.ts index 6e65822..05d4361 100644 --- a/src/lib/commands/slashCommands.ts +++ b/src/lib/commands/slashCommands.ts @@ -66,6 +66,7 @@ async function changeDirectory(path: string): Promise { use_worktree: config.use_worktree ?? false, disable_1m_context: config.disable_1m_context ?? false, max_output_tokens: config.max_output_tokens ?? null, + include_git_instructions: config.include_git_instructions ?? true, }, }); @@ -143,6 +144,7 @@ async function startNewConversation(): Promise { use_worktree: config.use_worktree ?? false, disable_1m_context: config.disable_1m_context ?? false, max_output_tokens: config.max_output_tokens ?? null, + include_git_instructions: config.include_git_instructions ?? true, }, }); diff --git a/src/lib/components/ConfigSidebar.svelte b/src/lib/components/ConfigSidebar.svelte index 969b4c2..4e56359 100644 --- a/src/lib/components/ConfigSidebar.svelte +++ b/src/lib/components/ConfigSidebar.svelte @@ -59,6 +59,7 @@ use_worktree: false, disable_1m_context: false, disable_cron: false, + include_git_instructions: true, max_output_tokens: null, trusted_workspaces: [], background_image_path: null, @@ -566,6 +567,22 @@

+ +
+ +

+ When disabled, sets CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1 to + remove Claude's built-in commit and PR workflow guidance from its system prompt +

+
+