Claude Code workflow example
A real ultracode workflow
A sanitized Workflow script recovered from an actual local Claude session. It fans out repository inspections, adversarially verifies each summary, and synthesizes a structured report.
What this demonstrates
- Three explicit phases: Inspect, Verify, and Synthesize.
- Parallel fan-out: one inspection agent per project using
parallel(). - Pipelined verification: each inspection is independently challenged using
pipeline(). - Structured handoffs: JSON schemas constrain every agent result.
- Final synthesis: a dedicated agent turns verified evidence into a concise report.
The original session’s repository names, organizations, local paths, timestamps, branch details, commit hashes, session IDs, and result payloads have been omitted. The orchestration code below is otherwise representative of the workflow Claude wrote in that session.
Workflow script
export const meta = {
name: 'summarize-five-recent-projects',
description: 'Inspect the five most recently active distinct Git projects and summarize their changes',
phases: [
{ title: 'Inspect', detail: 'Review related worktrees, recent commits, and local changes' },
{ title: 'Verify', detail: 'Check summaries against commit and diff evidence' },
{ title: 'Synthesize', detail: 'Produce concise project-level summaries' }
]
}
const INSPECTION_SCHEMA = {
type: 'object',
properties: {
name: { type: 'string' },
activity: { type: 'string' },
branches: { type: 'array', items: { type: 'string' } },
headline: { type: 'string' },
changes: { type: 'array', items: { type: 'string' } },
workingTrees: { type: 'array', items: { type: 'string' } },
evidence: { type: 'array', items: { type: 'string' } },
caveats: { type: 'array', items: { type: 'string' } }
},
required: [
'name', 'activity', 'branches', 'headline',
'changes', 'workingTrees', 'evidence', 'caveats'
],
additionalProperties: false
}
const VERIFY_SCHEMA = {
type: 'object',
properties: {
name: { type: 'string' },
accurate: { type: 'boolean' },
correctedHeadline: { type: 'string' },
correctedChanges: { type: 'array', items: { type: 'string' } },
correctionNotes: { type: 'array', items: { type: 'string' } }
},
required: [
'name', 'accurate', 'correctedHeadline',
'correctedChanges', 'correctionNotes'
],
additionalProperties: false
}
phase('Inspect')
const inspected = await parallel(
args.projects.map(project => () => agent(
`Read-only inspection of the distinct Git project ${project.name}
(${project.origin}). Related local working directories:
${project.paths.join(', ')}. Activity timestamp: ${project.activity}.
For every listed directory, inspect branch name, git status,
recent 5-8 commits with dates and stats/name-status, and
uncommitted diffs. Treat related worktrees as one project:
summarize the main functional/infrastructure changes across
active branches without double-counting shared commits.
Clearly distinguish committed changes from current uncommitted
work. Use abbreviated commit hashes in evidence.`,
{
label: `inspect:${project.name}`,
phase: 'Inspect',
schema: INSPECTION_SCHEMA,
effort: 'high'
}
))
)
phase('Verify')
const pairs = inspected
.filter(Boolean)
.map((inspection, index) => ({
inspection,
project: args.projects[index]
}))
const verified = await pipeline(
pairs,
pair => agent(
`Adversarially verify this project-change summary against the
Git repositories at ${pair.project.paths.join(', ')}.
Try to refute overstated, duplicated, or unsupported claims
by checking git log/diff/status. Return corrected wording where
needed. Summary: ${JSON.stringify(pair.inspection)}`,
{
label: `verify:${pair.project.name}`,
phase: 'Verify',
schema: VERIFY_SCHEMA,
effort: 'high'
}
),
(verification, pair) => ({ ...pair, verification })
)
phase('Synthesize')
const FINAL_SCHEMA = {
type: 'object',
properties: {
projects: {
type: 'array',
items: {
type: 'object',
properties: {
name: { type: 'string' },
activity: { type: 'string' },
branches: { type: 'string' },
headline: { type: 'string' },
bullets: { type: 'array', items: { type: 'string' } },
workingTree: { type: 'string' },
evidence: { type: 'string' }
},
required: [
'name', 'activity', 'branches', 'headline',
'bullets', 'workingTree', 'evidence'
],
additionalProperties: false
}
},
methodology: { type: 'string' },
caveat: { type: 'string' }
},
required: ['projects', 'methodology', 'caveat'],
additionalProperties: false
}
const final = await agent(
`Create a concise report for the user from these inspections and
adversarial checks. Preserve the input project activity order.
Prefer corrected verification wording when accurate=false.
Explain branches/worktrees compactly. Include 2-4 meaningful
bullets per project, current working-tree state, and abbreviated
commit evidence. Avoid a raw commit dump.
Data: ${JSON.stringify(verified.filter(Boolean))}`,
{
label: 'synthesize:five-projects',
phase: 'Synthesize',
schema: FINAL_SCHEMA,
effort: 'high'
}
)
return {
inspections: inspected.filter(Boolean),
verified: verified.filter(Boolean),
final
}
Sanitized input shape
The original invocation supplied five real repositories. This fictional equivalent shows the expected argument structure without exposing those projects:
{
"projects": [
{
"name": "example-api",
"origin": "https://github.com/example/example-api",
"activity": "recent",
"paths": [
"/Users/example/Developer/example-api",
"/Users/example/Developer/example-api-feature"
]
}
]
}
Why the structure is useful
The workflow separates discovery from judgment. Inspection agents maximize coverage, verification agents are explicitly told to refute unsupported claims, and the synthesis agent only receives structured results. That makes the final report more reliable than asking one agent to inspect every repository and summarize everything in a single pass.