MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getAutoModeExitAttachment

Function getAutoModeExitAttachment

source code/utils/attachments.ts:1382–1402  ·  view source on GitHub ↗

* Returns an auto_mode_exit attachment if we just exited auto mode. * This is a one-time notification to tell the model it's no longer in auto mode.

(
  toolUseContext: ToolUseContext,
)

Source from the content-addressed store, hash-verified

1380 * This is a one-time notification to tell the model it's no longer in auto mode.
1381 */
1382async function getAutoModeExitAttachment(
1383 toolUseContext: ToolUseContext,
1384): Promise<Attachment[]> {
1385 if (!needsAutoModeExitAttachment()) {
1386 return []
1387 }
1388
1389 const appState = toolUseContext.getAppState()
1390 // Suppress when auto is still active — covers both mode==='auto' and
1391 // plan-with-auto-active (where mode==='plan' but classifier runs).
1392 if (
1393 appState.toolPermissionContext.mode === 'auto' ||
1394 (autoModeStateModule?.isAutoModeActive() ?? false)
1395 ) {
1396 setNeedsAutoModeExitAttachment(false)
1397 return []
1398 }
1399
1400 setNeedsAutoModeExitAttachment(false)
1401 return [{ type: 'auto_mode_exit' }]
1402}
1403
1404/**
1405 * Detects when the local date has changed since the last turn (user coding

Callers 1

getAttachmentsFunction · 0.85

Calls 2

Tested by

no test coverage detected