claude-code-modes 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -15
- package/package.json +1 -1
- package/prompts/base/env.md +2 -12
- package/prompts/chill/env.md +2 -11
- package/prompts/flow/env.md +2 -11
- package/prompts/lean/actions.md +1 -1
- package/prompts/lean/core.md +1 -1
- package/prompts/lean/env.md +2 -12
- package/prompts/modifiers/tool-restraint.md +1 -2
- package/prompts/straight/actions.md +1 -1
- package/prompts/straight/env.md +2 -12
- package/src/assemble.ts +21 -6
- package/src/build-info.ts +1 -1
- package/src/build-prompt.ts +4 -4
- package/src/cli.ts +5 -16
- package/src/embedded-prompts.ts +14 -63
- package/src/env.ts +30 -10
- package/src/resolve.ts +2 -5
- package/src/types.ts +6 -3
package/README.md
CHANGED
|
@@ -82,6 +82,7 @@ claude-mode muse # Creative latitude — treat the request as inspiration
|
|
|
82
82
|
claude-mode flow # Deep engagement on hard problems — calm, curious, bounded (flow base)
|
|
83
83
|
claude-mode tinker # Loose, generative prototyping — fun and fast, don't gold-plate (flow base)
|
|
84
84
|
claude-mode spark # Maximum expression — creative vision with wit and personality (chill base)
|
|
85
|
+
claude-mode straight # Direct judgment, no sugarcoating or private shorthand (straight base + style)
|
|
85
86
|
claude-mode none # Strip all behavioral opinions, use your own CLAUDE.md
|
|
86
87
|
```
|
|
87
88
|
|
|
@@ -100,16 +101,18 @@ claude-mode none # Strip all behavioral opinions, use your own CLAUDE.md
|
|
|
100
101
|
| `flow` | autonomous | architect | adjacent | Deep engagement on a genuinely hard problem — reads widely, modifies narrowly |
|
|
101
102
|
| `tinker` | autonomous | pragmatic | unrestricted | Prototyping and creative coding — loose, generative, fun; a sketch, not a cathedral |
|
|
102
103
|
| `spark` | autonomous | architect | unrestricted | Maximum expression — muse's creative vision plus wit and personality |
|
|
104
|
+
| `straight` | autonomous | pragmatic | adjacent | Candid technical work — challenge bad premises, state judgments plainly, keep explanations self-contained |
|
|
103
105
|
| `none` | — | — | — | Strip all behavioral instructions, use your own |
|
|
104
106
|
|
|
105
107
|
### Bases
|
|
106
108
|
|
|
107
109
|
By default the base is chosen for you. `claude-mode` reads which model the session will
|
|
108
110
|
run on and assembles the same *shape* of prompt Claude Code itself would send that model:
|
|
109
|
-
the **lean** base for models that receive upstream's lean assembly (Opus 5, Opus
|
|
110
|
-
Fable 5, Mythos 5), and **standard** for
|
|
111
|
-
|
|
112
|
-
tool-restraint
|
|
111
|
+
the **lean** base for models that receive upstream's lean assembly (Opus 5.5, Opus 5,
|
|
112
|
+
Opus 4.8, Sonnet 5.5, Fable 5.1, Fable 5, Mythos 5.1, Mythos 5), and **standard** for
|
|
113
|
+
everything else. It also layers on the extra sections upstream sends particular models:
|
|
114
|
+
delivering-work, corrections, and tool-restraint on Opus 5, and delivering-work on
|
|
115
|
+
Fable 5.1 and Mythos 5.1.
|
|
113
116
|
|
|
114
117
|
```bash
|
|
115
118
|
claude-mode create # auto — picks lean or standard from your model
|
|
@@ -117,7 +120,7 @@ claude-mode create --base lean # force the lean base
|
|
|
117
120
|
claude-mode create --base standard # force the full upstream-derived base
|
|
118
121
|
```
|
|
119
122
|
|
|
120
|
-
Naming a base explicitly opts out of detection entirely, including
|
|
123
|
+
Naming a base explicitly opts out of detection entirely, including those extra sections.
|
|
121
124
|
The lean base is roughly a sixth the size of standard's head: one `# Harness` block in
|
|
122
125
|
place of the separate System, Doing tasks, Executing actions, Using your tools, and
|
|
123
126
|
Tone and style sections.
|
|
@@ -141,8 +144,27 @@ The **flow** base takes chill's calm floor and adds back the engagement and appe
|
|
|
141
144
|
claude-mode create --base flow # Calm + engaged, with any preset
|
|
142
145
|
```
|
|
143
146
|
|
|
147
|
+
The **straight** base makes correctness more important than agreement. It checks the user's premise, calls out bad or unnecessary approaches directly, and uses literal technical English without turning rudeness into a persona:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
claude-mode create --base straight # Direct behavioral base with any preset
|
|
151
|
+
```
|
|
152
|
+
|
|
144
153
|
You can also create your own base — see [Custom bases](#custom-bases) below.
|
|
145
154
|
|
|
155
|
+
### Response styles
|
|
156
|
+
|
|
157
|
+
A response style changes user-visible writing without replacing the selected base or axes:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
claude-mode create --style declaudified # Answer first; remove filler and stock technical prose
|
|
161
|
+
claude-mode create --style straight # Add direct judgment and self-contained technical explanations
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`declaudified` removes Claude-shaped prose: filler, metadiscourse, invented labels, and dead technical metaphors. `straight` includes those principles and adds anti-sycophancy: no sugarcoating, praise padding, false balance, or agreement for its own sake. It criticizes the work rather than the person.
|
|
165
|
+
|
|
166
|
+
Both styles treat the response as the shared record. They do not assume the user saw private tool calls or file output, and they explain repository-specific names before relying on them. The `straight` preset selects both the straight base and straight style; `--base straight` and `--style straight` remain independently usable.
|
|
167
|
+
|
|
146
168
|
## What problems does this solve?
|
|
147
169
|
|
|
148
170
|
Claude Code's default prompt tells Claude to:
|
|
@@ -164,24 +186,28 @@ prompts/
|
|
|
164
186
|
base/ Standard base (derived from upstream Claude Code)
|
|
165
187
|
chill/ Alternative base (emotion-research-informed, leaner)
|
|
166
188
|
flow/ Alternative base (chill's calm + restored engagement)
|
|
167
|
-
lean/ Upstream's lean assembly (what Opus
|
|
189
|
+
lean/ Upstream's lean assembly (what Opus 4.8 and most Claude 5 models actually receive)
|
|
190
|
+
straight/ Direct, anti-sycophantic base derived from the lean prompt shape
|
|
168
191
|
axis/ Behavioral prompts organized by three axes
|
|
192
|
+
style/ User-visible writing styles (declaudified, straight)
|
|
169
193
|
modifiers/ Behavioral layers (bold, debug, methodical, director, readonly, context-pacing, speak-plain, tdd, muse, flow, playful, delivering-work, corrections, tool-restraint)
|
|
170
194
|
```
|
|
171
195
|
|
|
172
|
-
Each base has a `base.json` manifest — a flat JSON array declaring fragment order with `"axes"` and `"modifiers"` as reserved insertion points. The standard and lean bases are validated against Claude Code **v2.1.
|
|
196
|
+
Each base has a `base.json` manifest — a flat JSON array declaring fragment order with `"axes"` and `"modifiers"` as reserved insertion points. The standard and lean bases are validated against Claude Code **v2.1.286**.
|
|
173
197
|
|
|
174
198
|
The behavioral layer is composed from three independent axes — **agency** (how much initiative), **quality** (what code standard), and **scope** (how far beyond the request). Presets are just named combinations of these three values.
|
|
175
199
|
|
|
176
200
|
When you run `claude-mode create`, the tool:
|
|
177
201
|
1. Resolves the preset to axis values (autonomous / architect / unrestricted)
|
|
178
202
|
2. Reads the base infrastructure fragments + the matching axis fragments
|
|
179
|
-
3.
|
|
180
|
-
4. Writes the assembled prompt to
|
|
181
|
-
5. Spawns `claude --system-prompt-file
|
|
203
|
+
3. Fills in template variables from the session model and your environment
|
|
204
|
+
4. Writes the assembled prompt to `~/.local/state/claude-mode/prompts/<hash>.md` (honors `XDG_STATE_HOME`)
|
|
205
|
+
5. Spawns `claude --system-prompt-file <that path>` with inherited stdio
|
|
182
206
|
|
|
183
207
|
`Bun.spawn` gives Claude Code direct TTY ownership — no intermediary process sitting in between.
|
|
184
208
|
|
|
209
|
+
The prompt file is content-addressed and never deleted: Claude Code re-reads it whenever it restarts the session's process, which with background sessions (`claude-mode create -- --bg`) happens after `claude-mode` has already exited — the supervisor respawns sessions after idle stops, updates, and reboots. Identical prompts share one file, so the directory stays small.
|
|
210
|
+
|
|
185
211
|
## Customizing
|
|
186
212
|
|
|
187
213
|
Override any axis from a preset:
|
|
@@ -217,11 +243,11 @@ claude-mode create --append-system-prompt "Use Rust, not TypeScript"
|
|
|
217
243
|
Pass flags through to Claude Code:
|
|
218
244
|
|
|
219
245
|
```bash
|
|
220
|
-
claude-mode create --model sonnet # model choice also
|
|
246
|
+
claude-mode create --model sonnet # model choice also picks the base and model-specific sections
|
|
221
247
|
claude-mode create -- --verbose # anything after -- goes to claude verbatim
|
|
222
248
|
```
|
|
223
249
|
|
|
224
|
-
|
|
250
|
+
`claude-mode` resolves the model claude will actually run — from `--model` (before or after `--`), else the `ANTHROPIC_MODEL` env var, else Claude settings files (`.claude/settings.local.json`, `.claude/settings.json`, `~/.claude/settings.json`), else the newest known model — and uses it to pick the base and any model-specific sections. Working directory, platform, and model identity are left to Claude Code, which sends them as separate messages even when the system prompt is replaced.
|
|
225
251
|
|
|
226
252
|
Debug the assembled prompt:
|
|
227
253
|
|
|
@@ -245,11 +271,12 @@ claude-mode -- --version # Forwards --version to claude
|
|
|
245
271
|
|
|
246
272
|
## Config file
|
|
247
273
|
|
|
248
|
-
Create a `.claude-mode.json` in your project root to define reusable
|
|
274
|
+
Create a `.claude-mode.json` in your project root to define reusable bases, response styles, modifiers, axis values, and presets. Manage supported entries with the CLI or edit the JSON directly.
|
|
249
275
|
|
|
250
276
|
```bash
|
|
251
277
|
claude-mode config init # Create scaffold
|
|
252
278
|
claude-mode config add-modifier team-rules ./prompts/team-rules.md
|
|
279
|
+
claude-mode config add-style team-voice ./prompts/team-voice.md
|
|
253
280
|
claude-mode config add-default team-rules # Always include this modifier
|
|
254
281
|
claude-mode config add-axis quality team-standard ./prompts/team-quality.md
|
|
255
282
|
claude-mode config add-preset team --agency collaborative --quality team-standard --modifier team-rules
|
|
@@ -267,7 +294,11 @@ Example `.claude-mode.json`:
|
|
|
267
294
|
|
|
268
295
|
```json
|
|
269
296
|
{
|
|
297
|
+
"defaultStyle": "team-voice",
|
|
270
298
|
"defaultModifiers": ["team-rules"],
|
|
299
|
+
"styles": {
|
|
300
|
+
"team-voice": "./prompts/team-voice.md"
|
|
301
|
+
},
|
|
271
302
|
"modifiers": {
|
|
272
303
|
"team-rules": "./prompts/team-rules.md"
|
|
273
304
|
},
|
|
@@ -292,10 +323,12 @@ Example `.claude-mode.json`:
|
|
|
292
323
|
- **`axes`** — custom axis values (replace built-in fragments)
|
|
293
324
|
- **`presets`** — named presets composing built-in and custom values
|
|
294
325
|
|
|
295
|
-
Config also supports bases:
|
|
326
|
+
Config also supports bases and response styles:
|
|
296
327
|
|
|
297
328
|
- **`defaultBase`** — base to use when `--base` isn't specified; set it to `"auto"` to restore model-driven selection
|
|
298
329
|
- **`bases`** — named bases referencing directories with `base.json` manifests
|
|
330
|
+
- **`defaultStyle`** — response style to apply when `--style` and the selected preset do not set one
|
|
331
|
+
- **`styles`** — named response styles referencing markdown files
|
|
299
332
|
|
|
300
333
|
Config searches `.claude-mode.json` in the current directory first, then `~/.config/claude-mode/config.json` as a global fallback. All commands accept `--global` to target the global config.
|
|
301
334
|
|
|
@@ -308,6 +341,8 @@ claude-mode config add-default <name-or-path> # Add to defaultModifiers
|
|
|
308
341
|
claude-mode config remove-default <name> # Remove from defaultModifiers
|
|
309
342
|
claude-mode config add-modifier <name> <path> # Register named modifier
|
|
310
343
|
claude-mode config remove-modifier <name> # Unregister named modifier
|
|
344
|
+
claude-mode config add-style <name> <path> # Register named response style
|
|
345
|
+
claude-mode config remove-style <name> # Unregister named response style
|
|
311
346
|
claude-mode config add-axis <axis> <name> <path> # Register custom axis value
|
|
312
347
|
claude-mode config remove-axis <axis> <name> # Unregister custom axis value
|
|
313
348
|
claude-mode config add-preset <name> [flags] # Create custom preset
|
|
@@ -397,7 +432,7 @@ System prompt instructions create exactly this kind of situational context. When
|
|
|
397
432
|
|
|
398
433
|
## Limitations
|
|
399
434
|
|
|
400
|
-
- **
|
|
435
|
+
- **Print mode has no git status.** Since Claude Code v2.1.286, working directory, platform, model identity, and git status arrive as Claude Code's own conversation messages rather than in the system prompt, so the bases no longer carry them. Interactive sessions get git status from Claude Code's session context, but in print mode (`-p`) Claude Code leaves it out whenever the system prompt is replaced.
|
|
401
436
|
- **Named sub-agents ignore your prompt.** See [Sub-agent behavior](#sub-agent-behavior) below for details.
|
|
402
437
|
- **MCP server instructions work normally.** Claude Code delivers MCP instructions via message attachments, independent of the system prompt. No action needed on your part.
|
|
403
438
|
|
package/package.json
CHANGED
package/prompts/base/env.md
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
# Environment
|
|
2
|
-
|
|
3
|
-
- Primary working directory: {{CWD}}{{WORKTREE_NOTICE}}
|
|
4
|
-
- Is a git repository: {{IS_GIT}}
|
|
5
|
-
- Platform: {{PLATFORM}}
|
|
6
|
-
- Shell: {{SHELL}}
|
|
7
|
-
- OS Version: {{OS_VERSION}}
|
|
8
|
-
- You are powered by the model named {{MODEL_NAME}}. The exact model ID is {{MODEL_ID}}.
|
|
9
|
-
- Assistant knowledge cutoff is {{KNOWLEDGE_CUTOFF}}.
|
|
10
|
-
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
2
|
+
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
11
3
|
- Claude Code is available as a CLI in the terminal, desktop app (Mac/Windows), web app (claude.ai/code), and IDE extensions (VS Code, JetBrains).
|
|
12
|
-
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast
|
|
4
|
+
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast.
|
|
13
5
|
|
|
14
6
|
When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.
|
|
15
|
-
|
|
16
|
-
gitStatus: {{GIT_STATUS}}
|
package/prompts/chill/env.md
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
# Environment
|
|
2
|
-
-
|
|
3
|
-
- Git repo: {{IS_GIT}}
|
|
4
|
-
- Platform: {{PLATFORM}}
|
|
5
|
-
- Shell: {{SHELL}}
|
|
6
|
-
- OS: {{OS_VERSION}}
|
|
7
|
-
- Model: {{MODEL_NAME}} ({{MODEL_ID}})
|
|
8
|
-
- Knowledge cutoff: {{KNOWLEDGE_CUTOFF}}
|
|
9
|
-
- Claude models: the Claude 5 family and Haiku 4.5 — Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. Default to the latest models when building AI applications.
|
|
2
|
+
- Claude models: the Claude 5 family and Haiku 4.5 — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. Default to the latest models when building AI applications.
|
|
10
3
|
- Claude Code: CLI, desktop (Mac/Windows), web (claude.ai/code), IDE extensions (VS Code, JetBrains)
|
|
11
|
-
- Fast mode runs Claude Opus with faster output (no smaller model). Toggle with /fast
|
|
4
|
+
- Fast mode runs Claude Opus with faster output (no smaller model). Toggle with /fast.
|
|
12
5
|
|
|
13
6
|
Write down important info from tool results in your response — originals may be cleared later.
|
|
14
|
-
|
|
15
|
-
gitStatus: {{GIT_STATUS}}
|
package/prompts/flow/env.md
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
# Environment
|
|
2
|
-
-
|
|
3
|
-
- Git repo: {{IS_GIT}}
|
|
4
|
-
- Platform: {{PLATFORM}}
|
|
5
|
-
- Shell: {{SHELL}}
|
|
6
|
-
- OS: {{OS_VERSION}}
|
|
7
|
-
- Model: {{MODEL_NAME}} ({{MODEL_ID}})
|
|
8
|
-
- Knowledge cutoff: {{KNOWLEDGE_CUTOFF}}
|
|
9
|
-
- Claude models: the Claude 5 family and Haiku 4.5 — Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. Default to the latest models when building AI applications.
|
|
2
|
+
- Claude models: the Claude 5 family and Haiku 4.5 — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. Default to the latest models when building AI applications.
|
|
10
3
|
- Claude Code: CLI, desktop (Mac/Windows), web (claude.ai/code), IDE extensions (VS Code, JetBrains)
|
|
11
|
-
- Fast mode runs Claude Opus with faster output (no smaller model). Toggle with /fast
|
|
4
|
+
- Fast mode runs Claude Opus with faster output (no smaller model). Toggle with /fast.
|
|
12
5
|
|
|
13
6
|
Write down important info from tool results in your response — originals may be cleared later.
|
|
14
|
-
|
|
15
|
-
gitStatus: {{GIT_STATUS}}
|
package/prompts/lean/actions.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
For actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target
|
|
1
|
+
For actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.
|
package/prompts/lean/core.md
CHANGED
|
@@ -6,6 +6,6 @@ IMPORTANT: Assist with authorized security testing, defensive security, CTF chal
|
|
|
6
6
|
# Harness
|
|
7
7
|
- Text you output outside of tool use is displayed to the user as Github-flavored markdown in a terminal.
|
|
8
8
|
- Tools run behind a user-selected permission mode; a denied call means the user declined it — adjust, don't retry verbatim.
|
|
9
|
-
-
|
|
9
|
+
- {{SYSTEM_REMINDER_NOTE}} Hooks may intercept tool calls; treat hook output as user feedback.
|
|
10
10
|
- Prefer the dedicated file/search tools over shell commands when one fits. Independent tool calls can run in parallel in one response.
|
|
11
11
|
- Reference code as `file_path:line_number` — it's clickable.
|
package/prompts/lean/env.md
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
# Environment
|
|
2
|
-
|
|
3
|
-
- Primary working directory: {{CWD}}{{WORKTREE_NOTICE}}
|
|
4
|
-
- Is a git repository: {{IS_GIT}}
|
|
5
|
-
- Platform: {{PLATFORM}}
|
|
6
|
-
- Shell: {{SHELL}}
|
|
7
|
-
- OS Version: {{OS_VERSION}}
|
|
8
|
-
- You are powered by the model named {{MODEL_NAME}}. The exact model ID is {{MODEL_ID}}.
|
|
9
|
-
- Assistant knowledge cutoff is {{KNOWLEDGE_CUTOFF}}.
|
|
10
|
-
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
2
|
+
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
11
3
|
- Claude Code is available as a CLI in the terminal, desktop app (Mac/Windows), web app (claude.ai/code), and IDE extensions (VS Code, JetBrains).
|
|
12
|
-
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast
|
|
4
|
+
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast.
|
|
13
5
|
|
|
14
6
|
When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.
|
|
15
|
-
|
|
16
|
-
gitStatus: {{GIT_STATUS}}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# Tool restraint
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
- Do not launch multi-agent workflows or deep-research runs unless the user asked for them.
|
|
3
|
+
Do not spawn sub-agents, launch multi-agent workflows, or start deep-research runs unless the user, a CLAUDE.md file, or a skill asks for it.
|
|
5
4
|
|
|
6
5
|
Do the work directly in this session by default. Delegation is a tool the user opts into, not a default execution strategy.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
For actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target
|
|
1
|
+
For actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.
|
package/prompts/straight/env.md
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
# Environment
|
|
2
|
-
|
|
3
|
-
- Primary working directory: {{CWD}}{{WORKTREE_NOTICE}}
|
|
4
|
-
- Is a git repository: {{IS_GIT}}
|
|
5
|
-
- Platform: {{PLATFORM}}
|
|
6
|
-
- Shell: {{SHELL}}
|
|
7
|
-
- OS Version: {{OS_VERSION}}
|
|
8
|
-
- You are powered by the model named {{MODEL_NAME}}. The exact model ID is {{MODEL_ID}}.
|
|
9
|
-
- Assistant knowledge cutoff is {{KNOWLEDGE_CUTOFF}}.
|
|
10
|
-
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
2
|
+
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
11
3
|
- Claude Code is available as a CLI in the terminal, desktop app (Mac/Windows), web app (claude.ai/code), and IDE extensions (VS Code, JetBrains).
|
|
12
|
-
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast
|
|
4
|
+
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast.
|
|
13
5
|
|
|
14
6
|
When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.
|
|
15
|
-
|
|
16
|
-
gitStatus: {{GIT_STATUS}}
|
package/src/assemble.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync,
|
|
1
|
+
import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
2
2
|
import { join, resolve, isAbsolute } from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
4
5
|
import type { AssembleOptions, TemplateVars, ModeConfig, BaseManifest } from "./types.js";
|
|
5
6
|
import { isBuiltinBase } from "./types.js";
|
|
6
7
|
import { EMBEDDED_PROMPTS } from "./embedded-prompts.js";
|
|
@@ -179,12 +180,26 @@ export function assemblePrompt(options: AssembleOptions): string {
|
|
|
179
180
|
return substituteTemplateVars(joined, templateVars);
|
|
180
181
|
}
|
|
181
182
|
|
|
183
|
+
// Claude Code re-reads --system-prompt-file every time it starts the session's
|
|
184
|
+
// process, and with `claude --bg` that happens after claude-mode has exited: the
|
|
185
|
+
// background supervisor respawns sessions after idle stops, binary updates, and
|
|
186
|
+
// reboots. A temp file removed at exit breaks every one of those restarts, so
|
|
187
|
+
// prompts live in the state dir instead. Content addressing keeps reruns of the
|
|
188
|
+
// same mode from piling up files.
|
|
189
|
+
function promptStoreDir(): string {
|
|
190
|
+
const stateHome = process.env.XDG_STATE_HOME || join(homedir(), ".local", "state");
|
|
191
|
+
return join(stateHome, "claude-mode", "prompts");
|
|
192
|
+
}
|
|
193
|
+
|
|
182
194
|
/**
|
|
183
|
-
* Writes the assembled prompt to a
|
|
195
|
+
* Writes the assembled prompt to a content-addressed file and returns its path.
|
|
196
|
+
* The file is never cleaned up, because Claude Code may need to read it again
|
|
197
|
+
* long after claude-mode has exited. Identical prompts share one file.
|
|
184
198
|
*/
|
|
185
|
-
export function
|
|
186
|
-
const
|
|
187
|
-
const filePath = join(
|
|
199
|
+
export function writePromptFile(content: string, dir: string = promptStoreDir()): string {
|
|
200
|
+
const hash = createHash("sha256").update(content).digest("hex").slice(0, 16);
|
|
201
|
+
const filePath = join(dir, `${hash}.md`);
|
|
202
|
+
mkdirSync(dir, { recursive: true });
|
|
188
203
|
writeFileSync(filePath, content, "utf8");
|
|
189
204
|
return filePath;
|
|
190
205
|
}
|
package/src/build-info.ts
CHANGED
package/src/build-prompt.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { join } from "node:path";
|
|
|
3
3
|
import { parseCliArgs } from "./args.js";
|
|
4
4
|
import { loadConfig } from "./config.js";
|
|
5
5
|
import { resolveConfig } from "./resolve.js";
|
|
6
|
-
import { assemblePrompt,
|
|
6
|
+
import { assemblePrompt, writePromptFile } from "./assemble.js";
|
|
7
7
|
import { detectEnv, buildTemplateVars, resolveSessionModel } from "./env.js";
|
|
8
8
|
import { runConfigCommand } from "./config-cli.js";
|
|
9
9
|
import { runInspectCommand } from "./inspect.js";
|
|
@@ -117,11 +117,11 @@ function main(): void {
|
|
|
117
117
|
process.exit(0);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
//
|
|
121
|
-
const
|
|
120
|
+
// Persist the prompt where claude can re-read it after we exit
|
|
121
|
+
const promptFile = writePromptFile(prompt);
|
|
122
122
|
|
|
123
123
|
// Build the claude command
|
|
124
|
-
const claudeArgs: string[] = ["claude", "--system-prompt-file",
|
|
124
|
+
const claudeArgs: string[] = ["claude", "--system-prompt-file", promptFile];
|
|
125
125
|
|
|
126
126
|
// Forward append-system-prompt flags
|
|
127
127
|
if (parsed.forwarded.appendSystemPrompt) {
|
package/src/cli.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { rmSync } from "node:fs";
|
|
4
3
|
import { parseCliArgs } from "./args.js";
|
|
5
4
|
import { loadConfig } from "./config.js";
|
|
6
5
|
import { resolveConfig } from "./resolve.js";
|
|
7
|
-
import { assemblePrompt,
|
|
6
|
+
import { assemblePrompt, writePromptFile } from "./assemble.js";
|
|
8
7
|
import { detectEnv, buildTemplateVars, resolveSessionModel } from "./env.js";
|
|
9
8
|
import { runConfigCommand } from "./config-cli.js";
|
|
10
9
|
import { runInspectCommand } from "./inspect.js";
|
|
@@ -140,11 +139,11 @@ async function main(): Promise<void> {
|
|
|
140
139
|
process.exit(0);
|
|
141
140
|
}
|
|
142
141
|
|
|
143
|
-
//
|
|
144
|
-
const
|
|
142
|
+
// Persist the prompt where claude can re-read it after we exit
|
|
143
|
+
const promptFile = writePromptFile(prompt);
|
|
145
144
|
|
|
146
145
|
// Build claude args
|
|
147
|
-
const claudeArgs: string[] = ["--system-prompt-file",
|
|
146
|
+
const claudeArgs: string[] = ["--system-prompt-file", promptFile];
|
|
148
147
|
|
|
149
148
|
// Forward append-system-prompt flags
|
|
150
149
|
if (parsed.forwarded.appendSystemPrompt) {
|
|
@@ -173,17 +172,7 @@ async function main(): Promise<void> {
|
|
|
173
172
|
process.on("SIGINT", () => proc.kill("SIGINT"));
|
|
174
173
|
process.on("SIGTERM", () => proc.kill("SIGTERM"));
|
|
175
174
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
// Clean up temp file after claude exits
|
|
179
|
-
try {
|
|
180
|
-
const { dirname } = await import("node:path");
|
|
181
|
-
rmSync(dirname(tempFile), { recursive: true, force: true });
|
|
182
|
-
} catch {
|
|
183
|
-
// Best-effort cleanup; don't fail if temp dir is already gone
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
process.exit(exitCode);
|
|
175
|
+
process.exit(await proc.exited);
|
|
187
176
|
}
|
|
188
177
|
|
|
189
178
|
main().catch((err) => {
|
package/src/embedded-prompts.ts
CHANGED
|
@@ -85,21 +85,11 @@ When the conversation grows long, some or all of the current context is summariz
|
|
|
85
85
|
When you have enough information to act, act. Do not re-derive facts already established in the conversation, or re-litigate a decision the user has already made.
|
|
86
86
|
`,
|
|
87
87
|
"base/env.md": `# Environment
|
|
88
|
-
|
|
89
|
-
- Primary working directory: {{CWD}}{{WORKTREE_NOTICE}}
|
|
90
|
-
- Is a git repository: {{IS_GIT}}
|
|
91
|
-
- Platform: {{PLATFORM}}
|
|
92
|
-
- Shell: {{SHELL}}
|
|
93
|
-
- OS Version: {{OS_VERSION}}
|
|
94
|
-
- You are powered by the model named {{MODEL_NAME}}. The exact model ID is {{MODEL_ID}}.
|
|
95
|
-
- Assistant knowledge cutoff is {{KNOWLEDGE_CUTOFF}}.
|
|
96
|
-
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
88
|
+
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
97
89
|
- Claude Code is available as a CLI in the terminal, desktop app (Mac/Windows), web app (claude.ai/code), and IDE extensions (VS Code, JetBrains).
|
|
98
|
-
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast
|
|
90
|
+
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast.
|
|
99
91
|
|
|
100
92
|
When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.
|
|
101
|
-
|
|
102
|
-
gitStatus: {{GIT_STATUS}}
|
|
103
93
|
`,
|
|
104
94
|
"base/base.json": `[
|
|
105
95
|
"intro.md",
|
|
@@ -256,20 +246,11 @@ When the conversation grows long, some or all of it gets summarized. The summary
|
|
|
256
246
|
When you have enough information to act, act. There's no need to re-derive facts already settled in this conversation, or to reopen a decision the user has already made.
|
|
257
247
|
`,
|
|
258
248
|
"chill/env.md": `# Environment
|
|
259
|
-
-
|
|
260
|
-
- Git repo: {{IS_GIT}}
|
|
261
|
-
- Platform: {{PLATFORM}}
|
|
262
|
-
- Shell: {{SHELL}}
|
|
263
|
-
- OS: {{OS_VERSION}}
|
|
264
|
-
- Model: {{MODEL_NAME}} ({{MODEL_ID}})
|
|
265
|
-
- Knowledge cutoff: {{KNOWLEDGE_CUTOFF}}
|
|
266
|
-
- Claude models: the Claude 5 family and Haiku 4.5 — Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. Default to the latest models when building AI applications.
|
|
249
|
+
- Claude models: the Claude 5 family and Haiku 4.5 — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. Default to the latest models when building AI applications.
|
|
267
250
|
- Claude Code: CLI, desktop (Mac/Windows), web (claude.ai/code), IDE extensions (VS Code, JetBrains)
|
|
268
|
-
- Fast mode runs Claude Opus with faster output (no smaller model). Toggle with /fast
|
|
251
|
+
- Fast mode runs Claude Opus with faster output (no smaller model). Toggle with /fast.
|
|
269
252
|
|
|
270
253
|
Write down important info from tool results in your response — originals may be cleared later.
|
|
271
|
-
|
|
272
|
-
gitStatus: {{GIT_STATUS}}
|
|
273
254
|
`,
|
|
274
255
|
"flow/base.json": `[
|
|
275
256
|
"core.md",
|
|
@@ -411,20 +392,11 @@ When the conversation grows long, some or all of it gets summarized. The summary
|
|
|
411
392
|
When you have enough information to act, act. There's no need to re-derive facts already settled in this conversation, or to reopen a decision the user has already made.
|
|
412
393
|
`,
|
|
413
394
|
"flow/env.md": `# Environment
|
|
414
|
-
-
|
|
415
|
-
- Git repo: {{IS_GIT}}
|
|
416
|
-
- Platform: {{PLATFORM}}
|
|
417
|
-
- Shell: {{SHELL}}
|
|
418
|
-
- OS: {{OS_VERSION}}
|
|
419
|
-
- Model: {{MODEL_NAME}} ({{MODEL_ID}})
|
|
420
|
-
- Knowledge cutoff: {{KNOWLEDGE_CUTOFF}}
|
|
421
|
-
- Claude models: the Claude 5 family and Haiku 4.5 — Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. Default to the latest models when building AI applications.
|
|
395
|
+
- Claude models: the Claude 5 family and Haiku 4.5 — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. Default to the latest models when building AI applications.
|
|
422
396
|
- Claude Code: CLI, desktop (Mac/Windows), web (claude.ai/code), IDE extensions (VS Code, JetBrains)
|
|
423
|
-
- Fast mode runs Claude Opus with faster output (no smaller model). Toggle with /fast
|
|
397
|
+
- Fast mode runs Claude Opus with faster output (no smaller model). Toggle with /fast.
|
|
424
398
|
|
|
425
399
|
Write down important info from tool results in your response — originals may be cleared later.
|
|
426
|
-
|
|
427
|
-
gitStatus: {{GIT_STATUS}}
|
|
428
400
|
`,
|
|
429
401
|
"lean/base.json": `[
|
|
430
402
|
"core.md",
|
|
@@ -445,13 +417,13 @@ IMPORTANT: Assist with authorized security testing, defensive security, CTF chal
|
|
|
445
417
|
# Harness
|
|
446
418
|
- Text you output outside of tool use is displayed to the user as Github-flavored markdown in a terminal.
|
|
447
419
|
- Tools run behind a user-selected permission mode; a denied call means the user declined it — adjust, don't retry verbatim.
|
|
448
|
-
-
|
|
420
|
+
- {{SYSTEM_REMINDER_NOTE}} Hooks may intercept tool calls; treat hook output as user feedback.
|
|
449
421
|
- Prefer the dedicated file/search tools over shell commands when one fits. Independent tool calls can run in parallel in one response.
|
|
450
422
|
- Reference code as \`file_path:line_number\` — it's clickable.
|
|
451
423
|
`,
|
|
452
424
|
"lean/pronouns.md": `When you use a pronoun for someone — the user or anyone else you mention — and their pronouns haven't been stated, use they/them. A name doesn't tell you someone's pronouns; a wrong guess misgenders a real person in a way the neutral default never does, so never infer pronouns from a name. This applies to all user-visible text, including visible thinking.
|
|
453
425
|
`,
|
|
454
|
-
"lean/actions.md": `For actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target
|
|
426
|
+
"lean/actions.md": `For actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.
|
|
455
427
|
`,
|
|
456
428
|
"lean/session-guidance.md": `# Session-specific guidance
|
|
457
429
|
- If the user needs to run a shell command themselves (an interactive login like \`gcloud auth login\`, or something requiring their own credentials), suggest they type \`! <command>\` — the \`!\` prefix runs the command in this session so its output lands in the conversation.
|
|
@@ -464,21 +436,11 @@ When the conversation grows long, some or all of the current context is summariz
|
|
|
464
436
|
When you have enough information to act, act. Do not re-derive facts already established in the conversation, or re-litigate a decision the user has already made.
|
|
465
437
|
`,
|
|
466
438
|
"lean/env.md": `# Environment
|
|
467
|
-
|
|
468
|
-
- Primary working directory: {{CWD}}{{WORKTREE_NOTICE}}
|
|
469
|
-
- Is a git repository: {{IS_GIT}}
|
|
470
|
-
- Platform: {{PLATFORM}}
|
|
471
|
-
- Shell: {{SHELL}}
|
|
472
|
-
- OS Version: {{OS_VERSION}}
|
|
473
|
-
- You are powered by the model named {{MODEL_NAME}}. The exact model ID is {{MODEL_ID}}.
|
|
474
|
-
- Assistant knowledge cutoff is {{KNOWLEDGE_CUTOFF}}.
|
|
475
|
-
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
439
|
+
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
476
440
|
- Claude Code is available as a CLI in the terminal, desktop app (Mac/Windows), web app (claude.ai/code), and IDE extensions (VS Code, JetBrains).
|
|
477
|
-
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast
|
|
441
|
+
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast.
|
|
478
442
|
|
|
479
443
|
When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.
|
|
480
|
-
|
|
481
|
-
gitStatus: {{GIT_STATUS}}
|
|
482
444
|
`,
|
|
483
445
|
"straight/base.json": `[
|
|
484
446
|
"core.md",
|
|
@@ -552,7 +514,7 @@ In code, default to no comments. Add a comment only when the reason cannot be ma
|
|
|
552
514
|
`,
|
|
553
515
|
"straight/pronouns.md": `When you use a pronoun for someone — the user or anyone else you mention — and their pronouns haven't been stated, use they/them. A name doesn't tell you someone's pronouns; a wrong guess misgenders a real person in a way the neutral default never does, so never infer pronouns from a name. This applies to all user-visible text, including visible thinking.
|
|
554
516
|
`,
|
|
555
|
-
"straight/actions.md": `For actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target
|
|
517
|
+
"straight/actions.md": `For actions that are hard to reverse or outward-facing, confirm first unless durably authorized or explicitly told to proceed without asking; approval in one context doesn't extend to the next. Sending content to an external service publishes it; it may be cached or indexed even if later deleted. Before deleting or overwriting, look at the target. Report outcomes faithfully: if tests fail, say so with the output; if a step was skipped, say that; when something is done and verified, state it plainly without hedging.
|
|
556
518
|
`,
|
|
557
519
|
"straight/session-guidance.md": `# Session-specific guidance
|
|
558
520
|
- If the user needs to run a shell command themselves (an interactive login like \`gcloud auth login\`, or something requiring their own credentials), suggest they type \`! <command>\` — the \`!\` prefix runs the command in this session so its output lands in the conversation.
|
|
@@ -565,21 +527,11 @@ When the conversation grows long, some or all of the current context is summariz
|
|
|
565
527
|
When you have enough information to act, act. Do not re-derive facts already established in the conversation, or re-litigate a decision the user has already made.
|
|
566
528
|
`,
|
|
567
529
|
"straight/env.md": `# Environment
|
|
568
|
-
|
|
569
|
-
- Primary working directory: {{CWD}}{{WORKTREE_NOTICE}}
|
|
570
|
-
- Is a git repository: {{IS_GIT}}
|
|
571
|
-
- Platform: {{PLATFORM}}
|
|
572
|
-
- Shell: {{SHELL}}
|
|
573
|
-
- OS Version: {{OS_VERSION}}
|
|
574
|
-
- You are powered by the model named {{MODEL_NAME}}. The exact model ID is {{MODEL_ID}}.
|
|
575
|
-
- Assistant knowledge cutoff is {{KNOWLEDGE_CUTOFF}}.
|
|
576
|
-
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
530
|
+
- The most recent Claude models are the Claude 5 family and Haiku 4.5. Model IDs — Fable 5.1: 'claude-fable-5-1', Opus 5.5: 'claude-opus-5-5', Sonnet 5.5: 'claude-sonnet-5-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.
|
|
577
531
|
- Claude Code is available as a CLI in the terminal, desktop app (Mac/Windows), web app (claude.ai/code), and IDE extensions (VS Code, JetBrains).
|
|
578
|
-
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast
|
|
532
|
+
- Fast mode for Claude Code uses Claude Opus with faster output (it does not downgrade to a smaller model). It can be toggled with /fast.
|
|
579
533
|
|
|
580
534
|
When working with tool results, write down any important information you might need later in your response, as the original tool result may be cleared later.
|
|
581
|
-
|
|
582
|
-
gitStatus: {{GIT_STATUS}}
|
|
583
535
|
`,
|
|
584
536
|
"axis/agency/autonomous.md": `# Agency: Autonomous
|
|
585
537
|
|
|
@@ -1134,8 +1086,7 @@ A follow-up question about your earlier work is not, by itself, a signal that yo
|
|
|
1134
1086
|
`,
|
|
1135
1087
|
"modifiers/tool-restraint.md": `# Tool restraint
|
|
1136
1088
|
|
|
1137
|
-
|
|
1138
|
-
- Do not launch multi-agent workflows or deep-research runs unless the user asked for them.
|
|
1089
|
+
Do not spawn sub-agents, launch multi-agent workflows, or start deep-research runs unless the user, a CLAUDE.md file, or a skill asks for it.
|
|
1139
1090
|
|
|
1140
1091
|
Do the work directly in this session by default. Delegation is a tool the user opts into, not a default execution strategy.
|
|
1141
1092
|
`,
|
package/src/env.ts
CHANGED
|
@@ -20,14 +20,26 @@ function exec(command: string): string | null {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// Sections each upstream prompt bundle adds, as the modifiers that carry them.
|
|
24
|
+
// `opus_5_prompt_bundle` sends all three; `fable_5_1_prompt_bundle` sends only delivering
|
|
25
|
+
// work (its other sections are intentional omissions); `opus_5_5_prompt_bundle` sends none.
|
|
26
|
+
const OPUS_5_BUNDLE = ["delivering-work", "corrections", "tool-restraint"] as const;
|
|
27
|
+
const FABLE_5_1_BUNDLE = ["delivering-work"] as const;
|
|
28
|
+
|
|
23
29
|
// Model metadata table extracted from the Claude Code binary — update when Claude Code updates.
|
|
24
30
|
// Extraction: grep the native binary for `{id:"claude-...,display_name:...,knowledge_cutoff:...`
|
|
25
|
-
// Capabilities come from
|
|
26
|
-
//
|
|
31
|
+
// Capabilities come from upstream's prompt predicates, not the `capabilities` array verbatim:
|
|
32
|
+
// "lean-prompt" mirrors the lean predicate (which also treats Mythos 5 as lean), and
|
|
33
|
+
// "mid-conv-system" mirrors `mid_conv_system` minus upstream's Opus 4.8 and Sonnet 5 exclusions.
|
|
34
|
+
// Longer ids precede their prefixes so dated-variant matching picks the most specific entry.
|
|
27
35
|
const MODEL_TABLE: readonly ModelInfo[] = [
|
|
28
|
-
{ id: "claude-fable-5", name: "Fable 5", cutoff: "
|
|
29
|
-
{ id: "claude-mythos-5", name: "Mythos 5", cutoff: "
|
|
30
|
-
{ id: "claude-opus-5", name: "Opus 5", cutoff: "
|
|
36
|
+
{ id: "claude-fable-5-1", name: "Fable 5.1", cutoff: "June 2026", capabilities: ["lean-prompt", "mid-conv-system"], promptBundle: FABLE_5_1_BUNDLE },
|
|
37
|
+
{ id: "claude-mythos-5-1", name: "Mythos 5.1", cutoff: "June 2026", capabilities: ["lean-prompt", "mid-conv-system"], promptBundle: FABLE_5_1_BUNDLE },
|
|
38
|
+
{ id: "claude-opus-5-5", name: "Opus 5.5", cutoff: "June 2026", capabilities: ["lean-prompt", "mid-conv-system"] },
|
|
39
|
+
{ id: "claude-sonnet-5-5", name: "Sonnet 5.5", cutoff: "June 2026", capabilities: ["lean-prompt", "mid-conv-system"] },
|
|
40
|
+
{ id: "claude-fable-5", name: "Fable 5", cutoff: "January 2026", capabilities: ["lean-prompt", "mid-conv-system"] },
|
|
41
|
+
{ id: "claude-mythos-5", name: "Mythos 5", cutoff: "January 2026", capabilities: ["lean-prompt", "mid-conv-system"] },
|
|
42
|
+
{ id: "claude-opus-5", name: "Opus 5", cutoff: "May 2026", capabilities: ["lean-prompt", "mid-conv-system"], promptBundle: OPUS_5_BUNDLE },
|
|
31
43
|
{ id: "claude-opus-4-8", name: "Opus 4.8", cutoff: "January 2026", capabilities: ["lean-prompt"] },
|
|
32
44
|
{ id: "claude-opus-4-7", name: "Opus 4.7", cutoff: "January 2026" },
|
|
33
45
|
{ id: "claude-opus-4-6", name: "Opus 4.6", cutoff: "May 2025" },
|
|
@@ -43,11 +55,11 @@ const MODEL_TABLE: readonly ModelInfo[] = [
|
|
|
43
55
|
|
|
44
56
|
// Aliases resolve to the newest model of the family; opusplan executes on opus
|
|
45
57
|
const MODEL_ALIASES: Record<string, string> = {
|
|
46
|
-
opus: "claude-opus-5",
|
|
47
|
-
opusplan: "claude-opus-5",
|
|
48
|
-
sonnet: "claude-sonnet-5",
|
|
58
|
+
opus: "claude-opus-5-5",
|
|
59
|
+
opusplan: "claude-opus-5-5",
|
|
60
|
+
sonnet: "claude-sonnet-5-5",
|
|
49
61
|
haiku: "claude-haiku-4-5",
|
|
50
|
-
fable: "claude-fable-5",
|
|
62
|
+
fable: "claude-fable-5-1",
|
|
51
63
|
};
|
|
52
64
|
|
|
53
65
|
const DEFAULT_MODEL: ModelInfo = MODEL_TABLE[0];
|
|
@@ -64,7 +76,8 @@ export function resolveModel(raw: string | null | undefined): ModelInfo {
|
|
|
64
76
|
MODEL_TABLE.find((m) => m.id === id) ?? MODEL_TABLE.find((m) => id.startsWith(`${m.id}-`));
|
|
65
77
|
if (!entry) {
|
|
66
78
|
// Unknown model — likely newer than the table, so assume it inherits the newest
|
|
67
|
-
// known model's cutoff and prompt capabilities rather than inventing either
|
|
79
|
+
// known model's cutoff and prompt capabilities rather than inventing either.
|
|
80
|
+
// Prompt bundles are per-model sections, so an unknown model gets none.
|
|
68
81
|
return {
|
|
69
82
|
name: id,
|
|
70
83
|
id: has1m ? `${id}[1m]` : id,
|
|
@@ -78,6 +91,7 @@ export function resolveModel(raw: string | null | undefined): ModelInfo {
|
|
|
78
91
|
id: has1m ? `${id}[1m]` : id,
|
|
79
92
|
cutoff: entry.cutoff,
|
|
80
93
|
capabilities: entry.capabilities,
|
|
94
|
+
...(entry.promptBundle && { promptBundle: entry.promptBundle }),
|
|
81
95
|
};
|
|
82
96
|
}
|
|
83
97
|
|
|
@@ -155,6 +169,11 @@ export function buildTemplateVars(env: EnvInfo): TemplateVars {
|
|
|
155
169
|
"\n - The git stash stack is shared with the main checkout and all other worktrees, and other Claude sessions may push or pop it concurrently. Never use bare `git stash` / `git stash pop` — you could pop another session's changes. Prefer a temporary WIP commit to set work aside; if you must stash, use `git stash push -u -m \"<unique-tag>\"`, immediately capture your entry's SHA via `git stash list --format='%H %gs'`, restore with `git stash apply <sha>` (not pop), and afterwards drop the entry, re-finding its current `stash@{n}` by tag first."
|
|
156
170
|
: "";
|
|
157
171
|
|
|
172
|
+
// Upstream's lean `# Harness` bullet describes reminders by how this model receives them
|
|
173
|
+
const systemReminderNote = modelHasCapability(env.model, "mid-conv-system")
|
|
174
|
+
? "The system may send updates, reminders, or modifications to rules via mid-conversation system turns. These are system-controlled, unlike function results."
|
|
175
|
+
: "`<system-reminder>` tags in messages and tool results are injected by the harness, not the user.";
|
|
176
|
+
|
|
158
177
|
return {
|
|
159
178
|
CWD: env.cwd,
|
|
160
179
|
IS_GIT: env.isGit ? "true" : "false",
|
|
@@ -166,5 +185,6 @@ export function buildTemplateVars(env: EnvInfo): TemplateVars {
|
|
|
166
185
|
KNOWLEDGE_CUTOFF: env.model.cutoff,
|
|
167
186
|
GIT_STATUS: gitStatusBlock,
|
|
168
187
|
WORKTREE_NOTICE: worktreeNotice,
|
|
188
|
+
SYSTEM_REMINDER_NOTE: systemReminderNote,
|
|
169
189
|
};
|
|
170
190
|
}
|
package/src/resolve.ts
CHANGED
|
@@ -233,9 +233,6 @@ function resolveBase(
|
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
// Sections upstream ships alongside the lean assembly for models carrying prompt-bundle
|
|
237
|
-
const PROMPT_BUNDLE_MODIFIERS = ["delivering-work", "corrections", "tool-restraint"];
|
|
238
|
-
|
|
239
236
|
export function resolveConfig(
|
|
240
237
|
parsed: ParsedArgs,
|
|
241
238
|
loadedConfig: LoadedConfig | null,
|
|
@@ -362,8 +359,8 @@ export function resolveConfig(
|
|
|
362
359
|
|
|
363
360
|
// When the base was chosen for us, also mirror the extra sections upstream would
|
|
364
361
|
// send this model. An explicit --base means the user picked the shape themselves.
|
|
365
|
-
if (fromModel &&
|
|
366
|
-
applyModifiers(
|
|
362
|
+
if (fromModel && model.promptBundle) {
|
|
363
|
+
applyModifiers([...model.promptBundle], loadedConfig, modifierPaths, "prepend");
|
|
367
364
|
}
|
|
368
365
|
|
|
369
366
|
return {
|
package/src/types.ts
CHANGED
|
@@ -89,10 +89,10 @@ export interface ModeConfig {
|
|
|
89
89
|
/**
|
|
90
90
|
* Prompt-shaping capabilities Claude Code reads off the session model.
|
|
91
91
|
* - "lean-prompt": upstream sends the lean assembly instead of the standard one
|
|
92
|
-
* - "
|
|
93
|
-
*
|
|
92
|
+
* - "mid-conv-system": the lean assembly describes reminders as mid-conversation
|
|
93
|
+
* system turns rather than `<system-reminder>` tags
|
|
94
94
|
*/
|
|
95
|
-
export const MODEL_CAPABILITIES = ["lean-prompt", "
|
|
95
|
+
export const MODEL_CAPABILITIES = ["lean-prompt", "mid-conv-system"] as const;
|
|
96
96
|
export type ModelCapability = (typeof MODEL_CAPABILITIES)[number];
|
|
97
97
|
|
|
98
98
|
export interface ModelInfo {
|
|
@@ -100,6 +100,8 @@ export interface ModelInfo {
|
|
|
100
100
|
id: string;
|
|
101
101
|
cutoff: string;
|
|
102
102
|
capabilities?: readonly ModelCapability[];
|
|
103
|
+
/** Modifiers mirroring the extra sections upstream sends this model (its `*_prompt_bundle`) */
|
|
104
|
+
promptBundle?: readonly BuiltinModifier[];
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
export interface EnvInfo {
|
|
@@ -127,6 +129,7 @@ export interface TemplateVars {
|
|
|
127
129
|
KNOWLEDGE_CUTOFF: string;
|
|
128
130
|
GIT_STATUS: string;
|
|
129
131
|
WORKTREE_NOTICE: string;
|
|
132
|
+
SYSTEM_REMINDER_NOTE: string;
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
export interface AssembleOptions {
|