@@ -207,7 +207,7 @@ the model.
207207
208208| Concern | Built-in surface |
209209| --- | --- |
210- | Files and directories | ` read ` , ` write ` , ` edit ` , ` patch ` , ` ls ` , ` glob ` , ` grep ` with ranged or resumable operations and compare-and-swap mutation |
210+ | Files and directories | Budgeted single/multi-file ` read ` , ` write ` , previewable CAS ` edit ` , ` patch ` , ` ls ` , order-selectable paginated ` glob ` , and mode-selectable ` grep ` |
211211| Commands and source control | Bounded ` bash ` plus typed ` git ` operations, cancellation, and Unix process-group termination |
212212| Code intelligence | ` code_symbols ` , ` code_navigation ` , and ` code_diagnostics ` ; source reading and mutation remain in file tools |
213213| Web evidence | Multi-engine ` web_search ` and bounded ` web_fetch ` with structured failures, fallback, source normalization, and SSRF protections |
@@ -219,6 +219,51 @@ idempotent, resumable, cancellation-safe, paginated, output-kind, and parallel
219219limits. ` batch ` parallelizes only calls that declare safe read-only behavior;
220220mutations and unknown tools are serialized.
221221
222+ ### Context-efficient repository tools
223+
224+ ` read ` can pack 1-32 known text files into one ordered response. The shared
225+ budget includes headers and the continuation itself, so the result reaches the
226+ model intact instead of relying on downstream truncation:
227+
228+ ``` json
229+ {
230+ "files" : [
231+ { "path" : " src/lib.rs" },
232+ { "path" : " src/config.rs" , "offset" : 40 , "limit" : 80 }
233+ ],
234+ "max_output_bytes" : 65536
235+ }
236+ ```
237+
238+ If the budget fills, copy ` metadata.batch.continuation ` back into ` files ` .
239+ Offsets and remaining per-file limits are advanced without repeating completed
240+ lines. One missing or unreadable member is reported in its own segment while
241+ the other files continue.
242+
243+ ` grep.output_mode ` controls how much evidence enters the context:
244+
245+ | Mode | Result |
246+ | --- | --- |
247+ | ` content ` | Matching lines with optional context (default) |
248+ | ` files_with_matches ` | Lexically cursor-paginated matching paths only |
249+ | ` count ` | Lexically cursor-paginated matching-line counts per file |
250+ | ` summary ` | Full-scan line and file totals without rendered matches |
251+
252+ The non-content modes ask built-in workspace backends to count matches without
253+ constructing discarded match text. ` glob ` retains a backend's recency or
254+ relevance order by default; request ` sort: "path" ` when cursor pages require
255+ stable lexical ordering.
256+
257+ Use ` edit ` with ` dry_run: true ` to receive the exact before/after diff without
258+ writing. The dry run is declared read-only and can be safely batched. Apply the
259+ result with ` expected_replacements ` and optionally ` max_replacements ` to reject
260+ stale or unexpectedly broad changes before the compare-and-swap write.
261+
262+ These repository-context ergonomics were informed by
263+ [ FastCtx] ( https://github.com/yc-duan/fastctx ) . Their implementation here stays
264+ inside A3S Code's workspace abstractions, capability declarations, permission
265+ path, remote-backend contracts, and structured metadata.
266+
222267### Sandbox and credential boundaries
223268
224269Hosts can attach a ` BashSandbox ` . The fail-closed local ` SrtBashSandbox ` limits
0 commit comments