command-code 1.46.0 → 1.47.1
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/CHANGELOG.md +11 -2
- package/dist/bundled/command-code-knowledge/reference/byok.md +2 -2
- package/dist/bundled/command-code-knowledge/reference/custom-slash-commands.md +9 -9
- package/dist/bundled/command-code-knowledge/reference/headless.md +12 -12
- package/dist/bundled/command-code-knowledge/reference/hooks.md +16 -16
- package/dist/bundled/command-code-knowledge/reference/memory.md +12 -12
- package/dist/bundled/command-code-knowledge/reference/permissions.md +7 -7
- package/dist/bundled/command-code-knowledge/reference/plan-mode.md +26 -26
- package/dist/bundled/command-code-knowledge/reference/sessions.md +41 -41
- package/dist/bundled/command-code-knowledge/reference/skills.md +2 -2
- package/dist/bundled/command-code-knowledge/reference/tools.md +21 -4
- package/dist/bundled/config/SKILL.md +1 -1
- package/dist/bundled/config/references/settings.md +1 -1
- package/dist/bundled/mod-builder/reference/overview.md +5 -5
- package/dist/bundled/mod-builder/reference/verify.md +3 -3
- package/dist/cli.mjs +3 -3
- package/package.json +1 -1
- package/vsix/commandcode-vscode.vsix +0 -0
|
@@ -8,9 +8,9 @@ Every conversation you have with Command Code is a **session**: a durable transc
|
|
|
8
8
|
|
|
9
9
|
## What is a session?
|
|
10
10
|
|
|
11
|
-
A session is a single append-only **JSONL file
|
|
11
|
+
A session is a single append-only **JSONL file**, one JSON record per line. The first line is a header (session id, creation time, working directory); every line after it is an entry: your messages, the model's replies (with token usage and cost), model and effort changes, compaction summaries, and more.
|
|
12
12
|
|
|
13
|
-
Entries form a **tree
|
|
13
|
+
Entries form a **tree** rather than a flat list. Each entry points at its parent, so a session can hold multiple branches of the same conversation. This is what powers `/rewind`, `/tree`, and forking. The file itself is never rewritten in place: navigating history just moves a pointer, and new entries are appended.
|
|
14
14
|
|
|
15
15
|
### Where session files live
|
|
16
16
|
|
|
@@ -39,7 +39,7 @@ Alongside the transcript, a session can have sidecar files:
|
|
|
39
39
|
/session-file
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
`/session-file` prints the current session id and the absolute path of its transcript. In terminals that support hyperlinks the path is clickable. If you haven't sent a message yet you'll see a `(not created yet)` note
|
|
42
|
+
`/session-file` prints the current session id and the absolute path of its transcript. In terminals that support hyperlinks the path is clickable. If you haven't sent a message yet you'll see a `(not created yet)` note; the transcript is created on the first save.
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
@@ -47,9 +47,9 @@ Alongside the transcript, a session can have sidecar files:
|
|
|
47
47
|
|
|
48
48
|
Sessions are designed so you never lose committed work:
|
|
49
49
|
|
|
50
|
-
- **Per-turn commit:** Every completed turn is appended to the transcript as it commits
|
|
50
|
+
- **Per-turn commit:** Every completed turn is appended to the transcript as it commits, not on exit. Kill the process mid-run and everything up to the last committed turn is on disk.
|
|
51
51
|
- **A turn either commits or is lost:** There is no torn state: an interrupted turn simply doesn't make it into the file, and the session resumes cleanly from the previous commit.
|
|
52
|
-
- **User messages survive failed turns:** If a turn dies on a model/API error, your message that opened it is still written to disk
|
|
52
|
+
- **User messages survive failed turns:** If a turn dies on a model/API error, your message that opened it is still written to disk, so a session that errored on its very first turn still shows up in `/resume`.
|
|
53
53
|
- **Empty sessions leave no file:** A brand-new session buffers in memory until the first assistant reply, so opening Command Code and quitting without a real exchange doesn't litter your session catalog.
|
|
54
54
|
- **Torn files never block startup:** If a transcript is damaged, corrupted lines are skipped and the session still loads.
|
|
55
55
|
|
|
@@ -64,7 +64,7 @@ Sessions are designed so you never lose committed work:
|
|
|
64
64
|
/clear
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
`/clear` starts a new session with empty context. The previous session stays on disk, fully resumable with `/resume`. `/new` is an alias
|
|
67
|
+
`/clear` starts a new session with empty context. The previous session stays on disk, fully resumable with `/resume`. `/new` is an alias: same command, same menu row.
|
|
68
68
|
|
|
69
69
|
### At launch
|
|
70
70
|
|
|
@@ -91,12 +91,12 @@ cmd --no-session # throwaway session, nothing written to disk
|
|
|
91
91
|
/resume
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
`/resume` (alias `/sessions`) opens the session picker
|
|
94
|
+
`/resume` (alias `/sessions`) opens the session picker, the same picker you get from `cmd -r` with no argument. It supports search, renaming (without leaving the picker), deleting sessions, and filtering by the git branch a session was started on. Forked sessions show their provenance (`fork of <parent>`), and the session you're currently in is highlighted and can't be deleted.
|
|
95
95
|
|
|
96
96
|
Two kinds of sessions are hidden from the picker:
|
|
97
97
|
|
|
98
|
-
- **Headless (`cmd -p`) sessions**
|
|
99
|
-
- **In-memory (`--no-session`) sessions**
|
|
98
|
+
- **Headless (`cmd -p`) sessions** carry no title and stay out of the picker and `--continue`, but an exact session id still resumes them.
|
|
99
|
+
- **In-memory (`--no-session`) sessions** were never written to disk.
|
|
100
100
|
|
|
101
101
|
### At launch
|
|
102
102
|
|
|
@@ -149,7 +149,7 @@ Three commands let one conversation become many. They differ in **what comes wit
|
|
|
149
149
|
in the tree you already have
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
### `/fork [name]
|
|
152
|
+
### `/fork [name]`: copy everything
|
|
153
153
|
|
|
154
154
|
```bash
|
|
155
155
|
# In Command Code session
|
|
@@ -157,27 +157,27 @@ Three commands let one conversation become many. They differ in **what comes wit
|
|
|
157
157
|
/fork payments-experiment
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
`/fork` copies the **entire session**
|
|
160
|
+
`/fork` copies the **entire session** into a new session and switches to it. That means the full tree with every branch, plus checkpoints and file backup history, so `/rewind` keeps working in the fork. The original is left untouched and resumable.
|
|
161
161
|
|
|
162
162
|
Lineage is recorded on the fork's meta: `parentSessionId` (the source session) and `branchPoint` (the stable message id of the last source message at the fork point), so the picker can render `fork of <parent>` provenance. Names are optional (up to 200 characters) and must be unique.
|
|
163
163
|
|
|
164
|
-
### `/clone
|
|
164
|
+
### `/clone`: copy the current branch only
|
|
165
165
|
|
|
166
166
|
```bash
|
|
167
167
|
# In Command Code session
|
|
168
168
|
/clone
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
`/clone` duplicates just the **active branch** of the conversation (from the current point back to the root) into a brand-new session file and switches into it. Unlike `/fork`, checkpoints and file history are deliberately not copied
|
|
171
|
+
`/clone` duplicates just the **active branch** of the conversation (from the current point back to the root) into a brand-new session file and switches into it. Unlike `/fork`, checkpoints and file history are deliberately not copied. A clone is "duplicate the conversation", and `/rewind` in the clone legitimately starts empty. The new file's header records the source transcript as its `parentSession`.
|
|
172
172
|
|
|
173
|
-
### `/tree
|
|
173
|
+
### `/tree`: browse the whole tree
|
|
174
174
|
|
|
175
175
|
```bash
|
|
176
176
|
# In Command Code session
|
|
177
177
|
/tree
|
|
178
178
|
```
|
|
179
179
|
|
|
180
|
-
`/tree` opens the session-tree navigator: every branch of the session,
|
|
180
|
+
`/tree` opens the session-tree navigator: every branch of the session, including inactive ones. From there you can jump to **any point** in the tree, fold segments, search, attach labels to entries, and cycle display filters (`default`, `no-tools`, `user-only`, `labeled-only`). When you navigate away from a branch, Command Code can generate a **branch summary** so the work you're leaving behind stays findable. You can confirm, customize, or skip the summary (and set a default in `/config`).
|
|
181
181
|
|
|
182
182
|
---
|
|
183
183
|
|
|
@@ -191,7 +191,7 @@ Lineage is recorded on the fork's meta: `parentSessionId` (the source session) a
|
|
|
191
191
|
| `/status` | Show comprehensive environment status |
|
|
192
192
|
| `/trace` | Copy the current OpenTelemetry trace id (for support); works mid-turn, and persisted trace ids survive resume |
|
|
193
193
|
|
|
194
|
-
Names must be unique within a project
|
|
194
|
+
Names must be unique within a project; renaming to a taken name is rejected. The name also becomes your terminal tab title, and it's what `-r <name>` resolves.
|
|
195
195
|
|
|
196
196
|
---
|
|
197
197
|
|
|
@@ -219,39 +219,39 @@ Each row in the selector shows when the checkpoint was taken, a preview of the m
|
|
|
219
219
|
|
|
220
220
|
Checkpoints with no file changes only offer **Conversation only**.
|
|
221
221
|
|
|
222
|
-
Rewinding removes the messages after the checkpoint **and the checkpoint itself
|
|
222
|
+
Rewinding removes the messages after the checkpoint **and the checkpoint itself**. You land *before* the message that opened it. The context token count updates to reflect the shorter conversation.
|
|
223
223
|
|
|
224
|
-
Rewinds persist. If you rewind and then quit, the rewound state is what you'll see when you resume the session later
|
|
224
|
+
Rewinds persist. If you rewind and then quit, the rewound state is what you'll see when you resume the session later. It isn't a preview.
|
|
225
225
|
|
|
226
226
|
### What a file rewind does to your working tree
|
|
227
227
|
|
|
228
|
-
A **Code only** or **Both** rewind
|
|
228
|
+
A **Code only** or **Both** rewind does more than undo edits. It puts the tree back the way it was:
|
|
229
229
|
|
|
230
230
|
| If a file was… | After the rewind |
|
|
231
231
|
| -------------- | ---------------- |
|
|
232
232
|
| **Modified** after the checkpoint | Restored to its contents at the checkpoint |
|
|
233
|
-
| **Created** after the checkpoint | **Deleted
|
|
233
|
+
| **Created** after the checkpoint | **Deleted**, since it didn't exist at the checkpoint |
|
|
234
234
|
| **Deleted** after the checkpoint | Restored |
|
|
235
235
|
|
|
236
|
-
Backups are taken before each `write_file` or `edit_file` call and replayed newest-first, so a run of edits to the same file lands back on its oldest state. Backups are byte-faithful, so binary files (images, compiled artifacts) survive a backup–restore round-trip unchanged
|
|
236
|
+
Backups are taken before each `write_file` or `edit_file` call and replayed newest-first, so a run of edits to the same file lands back on its oldest state. Backups are byte-faithful, so binary files (images, compiled artifacts) survive a backup–restore round-trip unchanged, with no special handling needed.
|
|
237
237
|
|
|
238
238
|
### Restores are verified before they run
|
|
239
239
|
|
|
240
|
-
Command Code checks every backup in the set can actually be restored *before* writing anything, so a rewind either applies in full or not at all
|
|
240
|
+
Command Code checks every backup in the set can actually be restored *before* writing anything, so a rewind either applies in full or not at all; it won't leave you half-restored. If a file can't be restored, you're told which one and why.
|
|
241
241
|
|
|
242
242
|
### Limits and pausing
|
|
243
243
|
|
|
244
244
|
Checkpoints are kept for **30 days**, capped at **200 backups per session**. Backups live in `~/.commandcode/file-history/<session-id>/`, and identical content is stored once no matter how many checkpoints reference it.
|
|
245
245
|
|
|
246
|
-
File backups are capped at **10MB per file**. An oversized file is never read or backed up
|
|
246
|
+
File backups are capped at **10MB per file**. An oversized file is never read or backed up, and because it was never captured, a rewind **leaves it exactly as it is** rather than deleting it. Once a session hits the 200-backup cap, or 30 days pass, older checkpoints age out.
|
|
247
247
|
|
|
248
|
-
If the disk runs low, checkpointing **pauses for the whole session** rather than silently degrading file by file, and you'll see a notice. Checkpoints already taken stay usable, and checkpointing resumes on its own
|
|
248
|
+
If the disk runs low, checkpointing **pauses for the whole session** rather than silently degrading file by file, and you'll see a notice. Checkpoints already taken stay usable, and checkpointing resumes on its own, with a second notice, once enough space is free.
|
|
249
249
|
|
|
250
250
|
---
|
|
251
251
|
|
|
252
252
|
## Session scratchpad
|
|
253
253
|
|
|
254
|
-
Each session gets a **scratchpad
|
|
254
|
+
Each session gets a **scratchpad**, a per-session temporary workspace for intermediate files that don't belong in your project: analysis notes, throwaway scripts, generated data.
|
|
255
255
|
|
|
256
256
|
```text theme={null}
|
|
257
257
|
/tmp/commandcode-<uid>/<sanitized-cwd>/<session-id>/scratchpad
|
|
@@ -261,7 +261,7 @@ Each session gets a **scratchpad**: a per-session temporary workspace for interm
|
|
|
261
261
|
- **Shared with sub-agents:** Every sub-agent in the session sees the same directory, so agents can hand intermediate results to each other by file name.
|
|
262
262
|
- **Survives compaction:** After history compaction, a bounded metadata-only **manifest** of the scratchpad is re-injected, so the model remembers which working files still exist on disk without re-reading them.
|
|
263
263
|
- **Follows launch-time forks:** Forking at launch with `--fork-session` copies the source session's scratchpad into the fork, so the branched conversation keeps its working files.
|
|
264
|
-
- **Cleaned up with retention:** Scratchpads older than 30 days are swept, and deleting a session deletes its scratchpad. It's temp space
|
|
264
|
+
- **Cleaned up with retention:** Scratchpads older than 30 days are swept, and deleting a session deletes its scratchpad. It's temp space; keep durable deliverables in the project itself.
|
|
265
265
|
|
|
266
266
|
The whole tree can be relocated with the `COMMANDCODE_SCRATCHPAD_BASE` environment variable. Provisioning is fail-open: if the scratchpad can't be created safely, the feature silently disables and the session runs normally without it.
|
|
267
267
|
|
|
@@ -277,14 +277,14 @@ Disable it entirely in `settings.json`:
|
|
|
277
277
|
|
|
278
278
|
## Sharing and exporting
|
|
279
279
|
|
|
280
|
-
### `/share
|
|
280
|
+
### `/share`: live share link
|
|
281
281
|
|
|
282
282
|
```bash
|
|
283
283
|
# In Command Code session
|
|
284
284
|
/share
|
|
285
285
|
```
|
|
286
286
|
|
|
287
|
-
`/share` uploads the conversation, copies a share URL to your clipboard, and
|
|
287
|
+
`/share` uploads the conversation, copies a share URL to your clipboard, and keeps the shared page **live**: every turn committed after sharing is streamed to the link automatically. Resuming a previously shared session re-arms the live updates. Run `/share` again to re-copy the existing link.
|
|
288
288
|
|
|
289
289
|
```bash
|
|
290
290
|
# In Command Code session
|
|
@@ -293,7 +293,7 @@ Disable it entirely in `settings.json`:
|
|
|
293
293
|
|
|
294
294
|
`/unshare` deletes the share and stops the live updates.
|
|
295
295
|
|
|
296
|
-
### `/share gist
|
|
296
|
+
### `/share gist`: GitHub gist
|
|
297
297
|
|
|
298
298
|
```bash
|
|
299
299
|
# In Command Code session
|
|
@@ -304,7 +304,7 @@ Disable it entirely in `settings.json`:
|
|
|
304
304
|
|
|
305
305
|
`/share gist [html|jsonl|md]` renders the session and posts it as a **secret GitHub gist** via the `gh` CLI, then copies the gist URL. The default format comes from `/config`'s "Default share gist format" setting.
|
|
306
306
|
|
|
307
|
-
### `/export
|
|
307
|
+
### `/export`: write a file
|
|
308
308
|
|
|
309
309
|
```bash
|
|
310
310
|
# In Command Code session
|
|
@@ -315,7 +315,7 @@ Disable it entirely in `settings.json`:
|
|
|
315
315
|
|
|
316
316
|
With no path, the file is written as `command-code-session-<first 8 chars of id>.<format>` using `/config`'s "Default export format" (`html` when unset). `jsonl` exports the raw transcript.
|
|
317
317
|
|
|
318
|
-
### `/copy
|
|
318
|
+
### `/copy`: clipboard
|
|
319
319
|
|
|
320
320
|
```bash
|
|
321
321
|
# In Command Code session
|
|
@@ -330,7 +330,7 @@ With no path, the file is written as `command-code-session-<first 8 chars of id>
|
|
|
330
330
|
|
|
331
331
|
When the conversation approaches the context limit, Command Code compacts history (automatically, or on `/compact`). Two guarantees matter for sessions:
|
|
332
332
|
|
|
333
|
-
- **The on-disk log is never rewritten:** Compaction appends a compaction entry (the summary plus a pointer to the first entry kept verbatim) to the transcript tree. Your full history stays in the file
|
|
333
|
+
- **The on-disk log is never rewritten:** Compaction appends a compaction entry (the summary plus a pointer to the first entry kept verbatim) to the transcript tree. Your full history stays in the file; context building just reads through the compaction entry, and `/tree` can still reach everything.
|
|
334
334
|
- **Savings persist across resumes:** Cumulative compaction stats (event count, total tokens saved, last event) are written to the session's meta on every compaction, so the "total this session" figure `/compact` reports survives `--resume`.
|
|
335
335
|
|
|
336
336
|
---
|
|
@@ -343,7 +343,7 @@ When the conversation approaches the context limit, Command Code compacts histor
|
|
|
343
343
|
|
|
344
344
|
- **One picker, not two.** `/resume` and `/sessions` open the same unified picker rather than separate interactive/print views, so there's one mental model for "where are my sessions."
|
|
345
345
|
- **Rewind is destructive on purpose, but reversible.** Restoring is instant and irreversible in the moment, but because it's just moving between checkpoints, you can rewind forward again if you change your mind.
|
|
346
|
-
- **Print sessions are real sessions.** They're saved and resumable, just hidden from the picker by default
|
|
346
|
+
- **Print sessions are real sessions.** They're saved and resumable, just hidden from the picker by default. Automation output doesn't have to mean throwaway state.
|
|
347
347
|
|
|
348
348
|
---
|
|
349
349
|
|
|
@@ -353,7 +353,7 @@ When the conversation approaches the context limit, Command Code compacts histor
|
|
|
353
353
|
|
|
354
354
|
1. Ensure you've sent at least one message in the session
|
|
355
355
|
2. Check if checkpointing is paused (you'll have seen a disk-space notice)
|
|
356
|
-
3. Verify the session has file modifications
|
|
356
|
+
3. Verify the session has file modifications; a checkpoint with no file changes only offers a conversation restore
|
|
357
357
|
|
|
358
358
|
### Restore failed
|
|
359
359
|
|
|
@@ -371,11 +371,11 @@ When the conversation approaches the context limit, Command Code compacts histor
|
|
|
371
371
|
|
|
372
372
|
## Tips
|
|
373
373
|
|
|
374
|
-
- **Name sessions you'll come back to:** `/rename auth-refactor` (or launch with `-n`) makes `cmd -r auth-refactor` a one-liner later
|
|
375
|
-
- **Fork before risky experiments:** `cmd -c --fork-session` or `/fork` gives you a full copy
|
|
374
|
+
- **Name sessions you'll come back to:** `/rename auth-refactor` (or launch with `-n`) makes `cmd -r auth-refactor` a one-liner later, and a bare `/rename` will generate a decent title for you.
|
|
375
|
+
- **Fork before risky experiments:** `cmd -c --fork-session` or `/fork` gives you a full copy, checkpoints included, while the original stays pristine.
|
|
376
376
|
- **Use `/clone` to tidy up:** After heavy rewinding, `/clone` extracts just the branch you kept into a clean new session.
|
|
377
377
|
- **Label important points in `/tree`:** Labels survive forks and make long trees navigable.
|
|
378
|
-
- **Let the scratchpad absorb clutter:** Ask for throwaway scripts and intermediate outputs in the scratchpad
|
|
378
|
+
- **Let the scratchpad absorb clutter:** Ask for throwaway scripts and intermediate outputs in the scratchpad: no permission prompts, no files polluting your repo, and it's cleaned up automatically.
|
|
379
379
|
- **`/share` before pairing:** The link updates live as the session continues, so a teammate can follow along in real time.
|
|
380
380
|
- **Grab `/trace` when something breaks:** The trace id is what support needs, it's copyable mid-turn, and past ids survive a resume.
|
|
381
381
|
|
|
@@ -383,7 +383,7 @@ When the conversation approaches the context limit, Command Code compacts histor
|
|
|
383
383
|
|
|
384
384
|
## See also
|
|
385
385
|
|
|
386
|
-
- [Headless Mode](./headless.md)
|
|
387
|
-
- [Interactive Mode](https://commandcode.ai/docs/interactive-mode)
|
|
388
|
-
- [Context & Compaction](https://commandcode.ai/docs/context)
|
|
389
|
-
- [Permissions](./permissions.md)
|
|
386
|
+
- [Headless Mode](./headless.md): resuming and naming sessions from scripts and CI.
|
|
387
|
+
- [Interactive Mode](https://commandcode.ai/docs/interactive-mode): the full session experience.
|
|
388
|
+
- [Context & Compaction](https://commandcode.ai/docs/context): how history is summarized as it grows.
|
|
389
|
+
- [Permissions](./permissions.md): how permission decisions apply as you resume or fork a session.
|
|
@@ -20,7 +20,7 @@ Skills use **progressive disclosure** to manage context efficiently:
|
|
|
20
20
|
|
|
21
21
|
1. **Discovery**: Command Code loads only the name, description, and file path of each skill at startup.
|
|
22
22
|
2. **Activation**: When a task matches a skill or invoked directly with `/skill-name`, Command Code reads its full `SKILL.md` instructions.
|
|
23
|
-
3. **Execution**: Command Code follows the instructions, optionally loading referenced files as needed
|
|
23
|
+
3. **Execution**: Command Code follows the instructions, optionally loading referenced files as needed.
|
|
24
24
|
|
|
25
25
|
This keeps Command Code fast while giving access to more context on demand.
|
|
26
26
|
|
|
@@ -622,7 +622,7 @@ allowed-tools: Read Bash(python:*)
|
|
|
622
622
|
| `metadata` | No | Arbitrary key-value mapping for additional metadata (author, version, etc.). |
|
|
623
623
|
| `allowed-tools` | No | Space-delimited list (or YAML array) of pre-approved tools the skill may use. (Experimental) |
|
|
624
624
|
|
|
625
|
-
Command Code
|
|
625
|
+
Command Code also honors these extension fields. Several mirror the Agent Skills / Claude Code frontmatter so a skill authored for another agent loads unchanged; tools that don't recognize a field ignore it safely:
|
|
626
626
|
|
|
627
627
|
| Field | Required | Behavior |
|
|
628
628
|
| -------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -40,12 +40,29 @@ Read a file as a bounded, line-numbered window. Read-only; never prompts.
|
|
|
40
40
|
|
|
41
41
|
What it does beyond "read a file":
|
|
42
42
|
|
|
43
|
-
- **Format-aware**: images
|
|
43
|
+
- **Format-aware**: images come back as real image blocks the model can see; Jupyter notebooks render as tagged cells with outputs; Word, PowerPoint, Excel, OpenDocument, RTF, EPUB and PDF files are extracted to Markdown; SVG reads as text. The full list is below.
|
|
44
44
|
- **Bounded by design**: 128 KB byte cap, 2000-line window, 2000-char per-line clamp - with truncation notes that embed the exact `offset` to continue from.
|
|
45
45
|
- **Typo-tolerant**: on a miss it retries macOS filename variants (curly apostrophes, NFD normalization) and then suggests siblings ("Did you mean…?") using substring and edit-distance matching.
|
|
46
46
|
- **Efficient**: memory-capped streaming reads, and re-reading an unchanged file returns a dedup stub instead of burning context.
|
|
47
47
|
- **Honest about safety**: device and stream paths (`/dev/zero`, `/dev/stdin`, `/proc/<pid>/fd/*`, …) are blocked; every read is recorded in the session's read ledger, which the write tools check later.
|
|
48
48
|
|
|
49
|
+
#### What it reads
|
|
50
|
+
|
|
51
|
+
| Kind | Extensions | What comes back |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| Text and code | anything not listed below, plus `.svg` and `.rtf` | Line-numbered text window (`offset`/`limit`, negative `offset` reads the tail). |
|
|
54
|
+
| Images | `.png` `.jpg` `.jpeg` `.gif` `.webp` `.bmp` `.tiff` | The image itself, attached for vision-capable models (compressed, with the scale factor disclosed when downscaled). |
|
|
55
|
+
| Jupyter notebooks | `.ipynb` | Tagged cells with their outputs; plots attached as images; oversized outputs replaced by a `jq` pointer. |
|
|
56
|
+
| Word | `.docx` `.docm` `.doc` | Markdown: headings, lists, tables, windowed by `offset`/`limit` like text. |
|
|
57
|
+
| PowerPoint | `.pptx` `.pptm` `.ppsx` `.ppsm` `.ppt` `.pps` `.pot` | Markdown per slide, speaker notes included. |
|
|
58
|
+
| Excel | `.xlsx` `.xlsm` `.xlsb` `.xls` | Markdown tables per sheet. |
|
|
59
|
+
| OpenDocument | `.odt` `.ods` `.odp` | Markdown, as for the Office equivalents. |
|
|
60
|
+
| RTF, EPUB | `.rtf` `.epub` | Markdown. `.rtf` reads as plain text when no converter is available. |
|
|
61
|
+
| PDF | `.pdf` | Markdown from the text layer. A scanned or image-only PDF says which pages have no text and gives the `pdftoppm` command to render them; reading the rendered pages attaches them as images. |
|
|
62
|
+
| Other binary | `.zip` `.tar` `.gz` `.exe` `.dll` `.so` `.dylib` `.wasm` and other known binary types | A one-line note with the MIME type and size. Bytes are never loaded. |
|
|
63
|
+
|
|
64
|
+
Document extraction runs through a native converter that is not shipped with the CLI. The first document read on a machine installs it (needs network, a second or two); every later read and every later session reuses it, and a new release upgrades it on the next read. Where it cannot be installed (offline, unsupported platform) the read falls back to the binary note above, and `.rtf` to plain text. Documents are read as a rendering, never as bytes, so `write_file` will not overwrite a `.docx` with the Markdown that came out of it.
|
|
65
|
+
|
|
49
66
|
#### Multi-file reads
|
|
50
67
|
|
|
51
68
|
Pass `paths` (or a single glob pattern in `file_path`) and the contents come back concatenated under `// File: <path> (<type>)` headers, preceded by a `Read X/Y files` summary:
|
|
@@ -54,11 +71,11 @@ Pass `paths` (or a single glob pattern in `file_path`) and the contents come bac
|
|
|
54
71
|
{"paths": ["/repo/src/index.ts", "/repo/src/**/*.test.ts"]}
|
|
55
72
|
```
|
|
56
73
|
|
|
57
|
-
`file_path` and `paths` are two separate fields on purpose rather than one union-typed field: providers translate JSON-Schema unions inconsistently
|
|
74
|
+
`file_path` and `paths` are two separate fields on purpose rather than one union-typed field: providers translate JSON-Schema unions inconsistently: Gemini rejects a function declaration whose parameter sets `any_of` alongside `description`/`items`, failing the whole request. `paths` satisfies the schema's `file_path` requirement through the tool's `requiredAlternatives`, so a multi-file call needs no placeholder.
|
|
58
75
|
|
|
59
|
-
Literal paths are read as named; glob patterns are filtered by `exclude`, the default exclusions and `.gitignore`.
|
|
76
|
+
Literal paths are read as named; glob patterns are filtered by `exclude`, the default exclusions and `.gitignore`. Documents are extracted to Markdown (capped per file at 128 KB, with a hint to read the file alone for the rest); other binary files are noted with their type and size instead of being inlined. Per-file errors are reported inline and never fail the whole call; every match is boundary-checked individually (symlink and `..` escapes are dropped); and an aggregate ~100 KB cap (one tool-output budget) reports exactly which files were skipped, so a wide glob narrows instead of flooding the context.
|
|
60
77
|
|
|
61
|
-
This absorbed the former `read_multiple_files` tool
|
|
78
|
+
This absorbed the former `read_multiple_files` tool; one tool schema instead of two keeps roughly 540 tokens out of every request (~1,685 → ~1,147), and models no longer have to choose between two near-identical read tools. Calls that still arrive under the old name are rewritten to `read_file` (its `include` renames onto `paths`, and `targetDirectory` / `gitIgnore` / `defaultExclude` onto the merged schema's snake_case options), so nothing breaks mid-conversation.
|
|
62
79
|
|
|
63
80
|
### `read_directory`
|
|
64
81
|
|
|
@@ -13,6 +13,6 @@ Use the deterministic CLI instead of editing settings files by hand.
|
|
|
13
13
|
4. For writes, choose the explicit `user` or `project` scope supported by the setting — the `scope` column in [settings.md](references/settings.md) says which one each takes. Never guess a scope.
|
|
14
14
|
5. Report the previous value, new value, and written scope.
|
|
15
15
|
|
|
16
|
-
A running session adopts
|
|
16
|
+
A running session adopts most changes at the start of its next round, so report the write as applied without claiming the live session already reloaded it. The exception is `model`: a running session keeps its current model, so a `model` write is the default for new sessions and takes effect in the running session only after a `/model` switch or a restart. For a live model change in the current session, use `/model <id>` instead.
|
|
17
17
|
|
|
18
18
|
Never hand-edit invalid JSON or invent a setting key.
|
|
@@ -6,7 +6,7 @@ The executable registry is authoritative. Run `cmd config list --scope effective
|
|
|
6
6
|
|
|
7
7
|
| Key | Scope | Type | Values | Description |
|
|
8
8
|
| --- | --- | --- | --- | --- |
|
|
9
|
-
| `model` | user | string | known model id | The default main-loop model. A
|
|
9
|
+
| `model` | user | string | known model id | The default main-loop model for new sessions. A running session keeps its current model. Use /model to change the running session. |
|
|
10
10
|
| `permissions.defaultMode` | user | enum | `default`, `plan`, `auto-accept`, `dont-ask` | Default permission mode for tool usage. A long-lived host may also apply the change to its current session. "bypass" cannot be set here. |
|
|
11
11
|
| `theme` | user | enum | `dark`, `light`, `auto` | Terminal color theme (same setting as /theme). Auto automatically detects your terminal background and uses light or dark to match. |
|
|
12
12
|
| `compact-mode` | user | enum | `default`, `fast` | Auto-compact aggressiveness when context fills up (same setting as /compact-mode). |
|
|
@@ -236,8 +236,8 @@ Embedders wire the same machinery directly: `createModHost` + `loadMods` + `crea
|
|
|
236
236
|
|
|
237
237
|
The rest of this page is the complete reference, in order:
|
|
238
238
|
|
|
239
|
-
- [ModApi reference](./api.md#mod-api-reference)
|
|
240
|
-
- [Hooks and events](./hooks-and-events.md#hooks-and-events)
|
|
241
|
-
- [UI surface](./ui.md#ui-surface)
|
|
242
|
-
- [Packaging and install](./packaging.md#packaging-and-install)
|
|
243
|
-
- [Verify a mod](./verify.md#verify-a-mod)
|
|
239
|
+
- [ModApi reference](./api.md#mod-api-reference): every field, registration verb, and live method.
|
|
240
|
+
- [Hooks and events](./hooks-and-events.md#hooks-and-events): the mutating lifecycle, the `AgentEvent` catalog.
|
|
241
|
+
- [UI surface](./ui.md#ui-surface): dialogs, footer status, editor widgets, custom feed rendering.
|
|
242
|
+
- [Packaging and install](./packaging.md#packaging-and-install): `cmd mods add`, manifests, filtering, scopes.
|
|
243
|
+
- [Verify a mod](./verify.md#verify-a-mod): load it, list it, test it, ship it.
|
|
@@ -38,9 +38,9 @@ Run rm -rf /tmp/scratch-dir
|
|
|
38
38
|
|
|
39
39
|
Expected result:
|
|
40
40
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
41
|
+
- The mod's confirm dialog appears before the shell command runs
|
|
42
|
+
- Declining blocks the tool - the model sees the block reason and adapts
|
|
43
|
+
- No `tool_running` fires for the blocked call
|
|
44
44
|
|
|
45
45
|
## 4. Iterate with /reload
|
|
46
46
|
|