generated from nhcarrigan/template
feat(settings): add includeGitInstructions toggle
Adds an 'Include git instructions' toggle to the Agent Settings panel. When disabled, sets CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS=1 on the Claude process to remove built-in commit and PR workflow guidance from its system prompt. Resolves #209.
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user