feat: CLI v2.1.81 features + global CLAUDE.md editor (#263)
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m9s
CI / Lint & Test (push) Successful in 18m55s
CI / Build Linux (push) Successful in 22m9s
CI / Build Windows (cross-compile) (push) Successful in 31m38s

## Summary

Implements support for Claude Code CLI v2.1.81 features and adds a global CLAUDE.md editor, closing issues #237, #239, #244, #245, #246, #247, #248, and #262.

### Stream-JSON forward-compatibility (#245, #246, #247, #248)

- **#248** — `output_style` field added to `System` init message; silently accepted for forward-compat
- **#245** — `fast_mode_state` field added to `Result` message; logged at debug level
- **#246** — `model_usage` field added to `Result` message; per-model breakdown logged at debug level
- **#247** — `total_cost_usd` field added to `Result` message; authoritative cost logged at debug level

### New config options (#237, #239, #244)

- **#237** — `bare_mode` config toggle: passes `--bare` to Claude Code, suppressing UI chrome for scripted headless `-p` calls
- **#239** — `show_clear_context_on_plan_accept` toggle: passes `showClearContextOnPlanAccept: false` in `--settings` when disabled
- **#244** — `custom_model_option` text field: sets `ANTHROPIC_CUSTOM_MODEL_OPTION` env var for custom model providers

### Global CLAUDE.md editor (#262)

- New Tauri commands `get_global_claude_md` / `save_global_claude_md` read/write `~/.claude/CLAUDE.md` (creates file + directory if absent)
- New "Global Instructions" section in the Config Sidebar with a textarea and Save button

### Bug fix (pre-existing)

`disable_cron` and `disable_skill_shell_execution` were saved to `HikariConfig` but never passed to `start_claude` invocations — fixed in all 9 call sites. All 3 new config fields are also wired through all 9 call sites.

All changes pass `check-all.sh` (ESLint → Prettier → svelte-check → Vitest → Clippy → cargo test with llvm-cov).

 This PR was created with help from Hikari~ 🌸

Reviewed-on: #263
Co-authored-by: Hikari <hikari@nhcarrigan.com>
Co-committed-by: Hikari <hikari@nhcarrigan.com>
This commit was merged in pull request #263.
This commit is contained in:
2026-04-13 13:32:03 -07:00
committed by Naomi Carrigan
parent 5663b1c09a
commit b88f25a61b
15 changed files with 432 additions and 2 deletions
+38
View File
@@ -57,6 +57,19 @@ pub struct ClaudeStartOptions {
#[serde(default)]
pub disable_skill_shell_execution: bool,
/// Pass `--bare` flag to suppress UI chrome, useful for scripted headless `-p` calls (v2.1.81+).
#[serde(default)]
pub bare_mode: bool,
/// Controls `showClearContextOnPlanAccept` in `--settings` (v2.1.81+).
/// Defaults to true (matching CLI default). Set to false to suppress the dialog.
#[serde(default = "default_show_clear_context")]
pub show_clear_context_on_plan_accept: bool,
/// Sets `ANTHROPIC_CUSTOM_MODEL_OPTION` env var for custom model providers (v2.1.81+).
#[serde(default)]
pub custom_model_option: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -211,6 +224,18 @@ pub struct HikariConfig {
/// Passes `"disableSkillShellExecution": true` via the `--settings` flag.
#[serde(default)]
pub disable_skill_shell_execution: bool,
/// Pass `--bare` flag to suppress UI chrome, useful for scripted headless `-p` calls (v2.1.81+).
#[serde(default)]
pub bare_mode: bool,
/// Controls `showClearContextOnPlanAccept` in `--settings` (v2.1.81+).
#[serde(default = "default_show_clear_context")]
pub show_clear_context_on_plan_accept: bool,
/// Sets `ANTHROPIC_CUSTOM_MODEL_OPTION` env var for custom model providers (v2.1.81+).
#[serde(default)]
pub custom_model_option: Option<String>,
}
impl Default for HikariConfig {
@@ -263,6 +288,9 @@ impl Default for HikariConfig {
auto_memory_directory: None,
model_overrides: None,
disable_skill_shell_execution: false,
bare_mode: false,
show_clear_context_on_plan_accept: true,
custom_model_option: None,
}
}
}
@@ -315,6 +343,10 @@ fn default_enable_claudeai_mcp_servers() -> bool {
true
}
fn default_show_clear_context() -> bool {
true
}
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)]
#[serde(rename_all = "lowercase")]
pub enum BudgetAction {
@@ -415,6 +447,9 @@ mod tests {
assert!(config.auto_memory_directory.is_none());
assert!(config.model_overrides.is_none());
assert!(!config.disable_skill_shell_execution);
assert!(!config.bare_mode);
assert!(config.show_clear_context_on_plan_accept);
assert!(config.custom_model_option.is_none());
}
#[test]
@@ -470,6 +505,9 @@ mod tests {
"arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-opus-4-6-v1".to_string(),
)])),
disable_skill_shell_execution: true,
bare_mode: false,
show_clear_context_on_plan_accept: true,
custom_model_option: None,
};
let json = serde_json::to_string(&config).unwrap();