Skip to content

Commit 4f357ae

Browse files
docs: update Claude Code documentation
1 parent 8b35fdc commit 4f357ae

2 files changed

Lines changed: 76 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
---
3030

31-
> **Last docs pull:** <!-- LAST_UPDATED -->2026-07-02 21:14 UTC / 14:14 PT / 17:14 ET / 23:14 CET / 02:44+1 IST / 06:14+1 JST<!-- /LAST_UPDATED -->
31+
> **Last docs pull:** <!-- LAST_UPDATED -->2026-07-02 23:12 UTC / 16:12 PT / 19:12 ET / 01:12 CET / 04:42+1 IST / 08:12+1 JST<!-- /LAST_UPDATED -->
3232
3333
A GitHub Actions workflow runs every hour, downloads the latest docs, and commits any changes automatically.
3434

‎claude-code-docs/workflows.md‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,81 @@ The following prompt runs a saved workflow with a list of issue numbers:
180180

181181
Claude passes the list as structured data, so the script can call array and object methods on `args` directly without parsing it first. If `args` is omitted, the global is `undefined` inside the script.
182182

183+
## Example workflow prompts
184+
185+
A workflow fits best when the task is larger than one agent can hold in context, or when the same step needs to run across many items. The prompts below show common shapes. Each one asks Claude to write and run a workflow for that task; you don't write the script yourself.
186+
187+
### Audit many files for the same issue
188+
189+
Fan out one agent per file, then collect and verify the findings.
190+
191+
```text
192+
> use a workflow to audit every route handler under src/routes/ for missing authentication checks, and adversarially verify each finding before reporting it
193+
```
194+
195+
### Keep fixing until a check passes
196+
197+
Run a checker, fix what failed, and repeat until it passes or stops making progress.
198+
199+
```text
200+
> use a workflow to run npx tsc --noEmit and keep fixing the reported errors until the type check passes or two rounds in a row make no progress
201+
```
202+
203+
### Migrate many files in parallel
204+
205+
Discover the files to migrate, transform each one in an isolated copy so edits don't conflict, and verify each result.
206+
207+
```text
208+
> use a workflow to migrate every component under src/components/ from styled-components to Tailwind, working on each file in its own isolated copy
209+
```
210+
211+
### Review every changed file and write one summary
212+
213+
Run a reviewer per file, then hand all the findings to one agent that ranks and deduplicates them.
214+
215+
```text
216+
> use a workflow to review every file changed in this PR for correctness issues, then merge the per-file findings into one ranked summary
217+
```
218+
219+
### Research a topic across many sources
220+
221+
Fan out readers across changelogs, issues, and docs, then synthesize. The bundled `/deep-research` workflow does this; you can also describe a narrower version.
222+
223+
```text
224+
> use a workflow to research how our three competitors handle rate limiting: read their public docs and recent changelog entries in parallel, then compare the approaches
225+
```
226+
227+
### Find issues until the list stops growing
228+
229+
Keep searching in rounds and stop when new rounds turn up nothing new.
230+
231+
```text
232+
> use a workflow to find flaky tests in this repo: run the suite repeatedly, record which tests fail intermittently, and stop once two rounds in a row find nothing new
233+
```
234+
235+
### What the saved script looks like
236+
237+
When you [save a workflow](#save-the-workflow-for-reuse), the file in `.claude/workflows/` holds a `meta` block followed by a script body that orchestrates subagents. You usually don't need to edit it, but here is the shape of a small one so you can recognize what Claude generated:
238+
239+
```javascript
240+
export const meta = {
241+
name: 'audit-routes',
242+
description: 'Audit every route handler for missing auth checks',
243+
}
244+
245+
const found = await agent('List every .ts file under src/routes/.', {
246+
schema: { type: 'object', required: ['files'], properties: { files: { type: 'array', items: { type: 'string' } } } },
247+
})
248+
249+
const audits = await pipeline(found.files, file =>
250+
agent(`Audit ${file} for missing authentication checks.`, { label: file }),
251+
)
252+
253+
return audits.filter(Boolean)
254+
```
255+
256+
The body is plain JavaScript with top-level `await`. `agent()` spawns one subagent and `pipeline()` runs one per item in a list. If you want to edit a script by hand, ask Claude to walk you through the change, or see the Workflow tool entry in the [Agent SDK reference](/en/agent-sdk/typescript) for the full set of options.
257+
183258
## How a workflow runs
184259

185260
The workflow runtime executes the script in an isolated environment, separate from your conversation. Intermediate results stay in script variables instead of landing in Claude's context.

0 commit comments

Comments
 (0)