You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [0.14.1] - 2026-04-09
9
+
10
+
### Fixed
11
+
-**Thinking configuration**: Use `--thinking adaptive` / `--thinking disabled` CLI flags instead of mapping to `--max-thinking-tokens`. Previously, `ThinkingConfigAdaptive` was mapped to `--max-thinking-tokens 32000` (fixed budget) and `ThinkingConfigDisabled` to `--max-thinking-tokens 0`, which put the CLI into the wrong mode. Only `ThinkingConfigEnabled` now uses `--max-thinking-tokens`. (Parity with [Python SDK #796](https://github.com/anthropics/claude-agent-sdk-python/pull/796))
12
+
13
+
### Added
14
+
-**`exclude_dynamic_sections`** on `SystemPromptPreset`: When set to `true`, the CLI strips per-user dynamic sections (working directory, auto-memory, git status) from the preset system prompt and re-injects them into the first user message. This makes the system prompt byte-identical across users, enabling cross-user prompt-caching hits. Sent via `excludeDynamicSections` in the initialize control message; older CLIs silently ignore it. (Parity with [Python SDK #797](https://github.com/anthropics/claude-agent-sdk-python/pull/797))
> **Note:** When `system_prompt` is `nil` (the default), the SDK passes `--system-prompt ""` to the CLI, which suppresses the default Claude Code system prompt. To use the default system prompt, use a `SystemPromptPreset`.
752
752
753
+
### Cross-User Prompt Caching
754
+
755
+
When running a multi-user fleet with shared preset prompts, enable `exclude_dynamic_sections` to make the system prompt byte-identical across users for prompt-caching hits:
When set, the CLI strips per-user dynamic sections (working directory, auto-memory, git status) from the system prompt and re-injects them into the first user message instead. Older CLIs silently ignore this option.
768
+
753
769
## Budget Control
754
770
755
771
Use `max_budget_usd` to set a spending cap for your queries:
@@ -1565,9 +1581,9 @@ end
1565
1581
|`PermissionResultAllow`| Permission callback result to allow tool use |
1566
1582
|`PermissionResultDeny`| Permission callback result to deny tool use |
Copy file name to clipboardExpand all lines: plugins/claude-agent-ruby/skills/claude-agent-ruby/references/options.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,14 @@ Notes:
22
22
23
23
## Core knobs
24
24
25
-
-`system_prompt`: Set an overall instruction as a string, or use `ClaudeAgentSDK::SystemPromptPreset.new(preset: 'claude_code', append: '...')` to extend a preset prompt.
25
+
-`system_prompt`: Set an overall instruction as a string, use `ClaudeAgentSDK::SystemPromptPreset.new(preset: 'claude_code', append: '...', exclude_dynamic_sections: true)` to extend a preset (with optional cross-user caching), or use `ClaudeAgentSDK::SystemPromptFile.new(path: '/path/to/prompt.txt')` to load from a file.
26
26
-`model`: Select the model.
27
27
-`fallback_model`: Use when the primary model is unavailable.
28
28
-`max_turns`: Cap the number of turns.
29
29
-`max_budget_usd`: Cap total spend (USD).
30
30
-`include_partial_messages`: Include partial assistant messages in the stream when supported.
31
31
-`cwd`: Run Claude Code in a specific working directory.
32
-
-`max_thinking_tokens`: Stored for API parity, but not currently passed through to Claude CLI.
32
+
-`max_thinking_tokens`: Deprecated — use `thinking:` instead (`ThinkingConfigAdaptive`, `ThinkingConfigEnabled`, or `ThinkingConfigDisabled`). Falls back to `--max-thinking-tokens` when `thinking` is unset.
Copy file name to clipboardExpand all lines: skills/references/options.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Notes:
22
22
23
23
## Core knobs
24
24
25
-
-`system_prompt`: Set an overall instruction as a string, use `ClaudeAgentSDK::SystemPromptPreset.new(preset: 'claude_code', append: '...')` to extend a preset, or use `ClaudeAgentSDK::SystemPromptFile.new(path: '/path/to/prompt.txt')` to load from a file.
25
+
-`system_prompt`: Set an overall instruction as a string, use `ClaudeAgentSDK::SystemPromptPreset.new(preset: 'claude_code', append: '...', exclude_dynamic_sections: true)` to extend a preset (with optional cross-user caching), or use `ClaudeAgentSDK::SystemPromptFile.new(path: '/path/to/prompt.txt')` to load from a file.
26
26
-`model`: Select the model.
27
27
-`fallback_model`: Use when the primary model is unavailable.
28
28
-`max_turns`: Cap the number of turns.
@@ -31,7 +31,7 @@ Notes:
31
31
-`session_id`: Specify a custom session ID upfront (string).
32
32
-`include_partial_messages`: Include partial assistant messages in the stream when supported.
33
33
-`cwd`: Run Claude Code in a specific working directory.
34
-
-`max_thinking_tokens`: Stored for API parity, but not currently passed through to Claude CLI.
34
+
-`max_thinking_tokens`: Deprecated — use `thinking:` instead (`ThinkingConfigAdaptive`, `ThinkingConfigEnabled`, or `ThinkingConfigDisabled`). Falls back to `--max-thinking-tokens` when `thinking` is unset.
0 commit comments