Skip to content

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.

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.

{
"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:

ModeBehavior
overwriteReplace the entire file content (or create a new file)
replaceFind the search string in the file and replace with content

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:

ActionEffect
Apply sessionWrites all file changes to disk
Reject sessionDiscards everything; no files modified
PartialApply some files, reject others → session status becomes partial
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.

CommandEffect
CodeBuddy: Review Composer SessionOpen the diff panel for the current session
CodeBuddy: Apply Composer SessionApply all pending changes to disk
CodeBuddy: Reject Composer SessionDiscard 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 overwrite mode.
  • 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.
  • Diff review — the underlying diff engine
  • Toolscompose_files in the full tool list