diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 2b6743ed..21c3ddc3 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -860,7 +860,7 @@ The hooks API has been restructured with more granular events and better session - `ctx.waitForIdle()` - wait for agent to finish streaming - `ctx.newSession(options?)` - create new sessions with optional setup callback -- `ctx.branch(entryId)` - branch from a specific entry +- `ctx.fork(entryId) - fork from a specific entry, creating a new session file - `ctx.navigateTree(targetId, options?)` - navigate the session tree These methods are only on `HookCommandContext` (not `HookContext`) because they can deadlock if called from event handlers that run inside the agent loop. diff --git a/packages/coding-agent/docs/extensions.md b/packages/coding-agent/docs/extensions.md index 668de64e..5c80694b 100644 --- a/packages/coding-agent/docs/extensions.md +++ b/packages/coding-agent/docs/extensions.md @@ -715,14 +715,14 @@ if (result.cancelled) { } ``` -### ctx.branch(entryId) +### ctx.fork(entryId) -Branch from a specific entry: +Fork from a specific entry, creating a new session file: ```typescript -const result = await ctx.branch("entry-id-123"); +const result = await ctx.fork("entry-id-123"); if (!result.cancelled) { - // Now in the branched session + // Now in the forked session } ```