MCPcopy
hub / github.com/codeaashu/claude-code / handlePlanModeTransition

Function handlePlanModeTransition

src/bootstrap/state.ts:1349–1363  ·  view source on GitHub ↗
(
  fromMode: string,
  toMode: string,
)

Source from the content-addressed store, hash-verified

1347}
1348
1349export function handlePlanModeTransition(
1350 fromMode: string,
1351 toMode: string,
1352): void {
1353 // If switching TO plan mode, clear any pending exit attachment
1354 // This prevents sending both plan_mode and plan_mode_exit when user toggles quickly
1355 if (toMode === 'plan' && fromMode !== 'plan') {
1356 STATE.needsPlanModeExitAttachment = false
1357 }
1358
1359 // If switching out of plan mode, trigger the plan_mode_exit attachment
1360 if (fromMode === 'plan' && toMode !== 'plan') {
1361 STATE.needsPlanModeExitAttachment = true
1362 }
1363}
1364
1365export function needsAutoModeExitAttachment(): boolean {
1366 return STATE.needsAutoModeExitAttachment

Callers 4

callFunction · 0.85
transitionPermissionModeFunction · 0.85
callFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected