Composer
Composer groups related changes across multiple files into a session you review as a unified diff, then apply or reject atomically. Uses the compose_files tool.
When the agent reaches for it
Section titled “When the agent reaches for it”Agent mode picks Composer when work is genuinely multi-file:
- Scaffold a new feature (component + tests + types + styles)
- Refactor a function signature + update all callers
- Apply a pattern consistently across the codebase
- Create or restructure boilerplate
You don’t invoke Composer directly — the agent decides.
Tool shape
Section titled “Tool shape”{ "files": [ { "filePath": "src/auth/login.ts", "mode": "replace", "search": "function login(user: string)", "content": "function login(user: string, mfa?: string)" }, { "filePath": "src/auth/login.test.ts", "mode": "replace", "search": "login('admin')", "content": "login('admin', '123456')" }, { "filePath": "src/types/auth.ts", "mode": "overwrite", "content": "export interface LoginOptions { user: string; mfa?: string; }" } ]}Modes:
| Mode | Behavior |
|---|---|
overwrite | Replace the entire file content (or create a new file) |
replace | Find the search string in the file and replace with content |
Review panel
Section titled “Review panel”After the tool call, the Composer panel opens in the sidebar with:
- Session status badge (active / applied / rejected / partial)
- Each file with an expandable diff view
- Per-file and whole-session actions
Diff uses DiffReviewService — same syntax-highlighted inline diff as Diff Review.
Actions:
| Action | Effect |
|---|---|
| Apply session | Writes all file changes to disk |
| Reject session | Discards everything; no files modified |
| Partial | Apply some files, reject others → session status becomes partial |
Session lifecycle
Section titled “Session lifecycle”
stateDiagram-v2
[*] --> active : compose_files call
active --> review : Diff panel open
review --> applied : Apply all
review --> rejected : Discard all
review --> partial : Apply some, reject others
Sessions managed by ComposerService, persisted for the editor window’s lifetime. Each has a unique ID and tracks per-file status independently.
Commands
Section titled “Commands”| Command | Effect |
|---|---|
CodeBuddy: Review Composer Session | Open the diff panel for the current session |
CodeBuddy: Apply Composer Session | Apply all pending changes to disk |
CodeBuddy: Reject Composer Session | Discard all pending changes |
- Large refactors — ask “refactor X and update all references”; the agent will use Composer naturally.
- Review before applying — the diff panel shows exactly what will change. Especially for
overwritemode. - Partial applies — if most changes look good but one file needs work, apply the good, reject the bad, ask the agent to fix just that file.
Related
Section titled “Related”- Diff review — the underlying diff engine
- Tools —
compose_filesin the full tool list