Architecture

Session engine

Session state, conversation history, turns, persistence, and runtime coordination.

56
Matched files
11
Top dirs
21,283
Lines in slice
317
Exports found
Heuristic
Classification style

Beginner explanation

This architecture page groups files that seem to solve the same type of problem. It is a good way to understand the repo as a system rather than as a list of folders.

Beginner mental model

Read the first few high-importance files here, then follow their related-file links.

Expert explanation

This slice is assembled with path heuristics, which makes it strong for navigation and code reading but not a replacement for runtime tracing. Use it to discover likely boundaries, then validate by reading imports, exports, and orchestrator files.

Related files

FileLinesImportanceExports
utils/sessionStorage.ts5106highisTranscriptMessage, isChainParticipant, isEphemeralToolProgress, getProjectsDir
utils/fileHistory.ts1116highFileHistoryBackup, FileHistorySnapshot, FileHistoryState, DiffStats
utils/telemetry/sessionTracing.ts928highisEnhancedTelemetryEnabled, startInteractionSpan, endInteractionSpan, startLLMRequestSpan
components/tasks/RemoteSessionDetailDialog.tsx904highformatToolUseSummary, RemoteSessionDetailDialog
utils/sessionStoragePortable.ts794highLITE_READ_BUF_SIZE, validateUuid, unescapeJsonString, extractJsonStringField
services/compact/sessionMemoryCompact.ts631highSessionMemoryCompactConfig, DEFAULT_SM_COMPACT_CONFIG, setSessionMemoryCompactConfig, getSessionMemoryCompactConfig
hooks/useRemoteSession.ts606highuseRemoteSession
utils/sessionRestore.ts552highrestoreSessionStateFromLog, computeRestoredAttributionState, computeStandaloneAgentContext, restoreAgentFromSession
bridge/sessionRunner.ts551highsafeFilenameId, PermissionRequest, createSessionSpawner, extractActivities
services/api/sessionIngress.ts515highappendSessionLog, getSessionLogs, getSessionLogsViaOAuth, getTeleportEvents
services/SessionMemory/sessionMemory.ts496highresetLastMemoryMessageUuid, shouldExtractMemory, initSessionMemory, ManualExtractionResult
utils/telemetry/betaSessionTracing.ts492highclearBetaTracingState, isBetaTracingEnabled, truncateContent, LLMRequestNewContext
tasks/LocalMainSessionTask.ts480highLocalMainSessionTaskState, registerMainSessionTask, completeMainSessionTask, foregroundMainSessionTask
history.ts465highgetPastedTextRefNumLines, formatPastedTextRef, formatImageRef, parseReferences
utils/listSessionsImpl.ts455highSessionInfo, ListSessionsOptions, parseSessionInfoFromLite, listCandidates
utils/hooks/sessionHooks.ts448highFunctionHookCallback, FunctionHook, SessionStore, SessionHooksState
remote/SessionsWebSocket.ts405highSessionsWebSocketCallbacks, SessionsWebSocket
bridge/createSession.ts385highcreateBridgeSession, getBridgeSession, archiveBridgeSession, updateBridgeSessionTitle
utils/ultraplan/ccrSession.ts350highPollFailReason, UltraplanPollError, ULTRAPLAN_TELEPORT_SENTINEL, ScanResult
remote/RemoteSessionManager.ts344highRemotePermissionResponse, RemoteSessionConfig, RemoteSessionCallbacks, RemoteSessionManager
services/SessionMemory/prompts.ts325highDEFAULT_SESSION_MEMORY_TEMPLATE, loadSessionMemoryTemplate, loadSessionMemoryPrompt, isSessionMemoryEmpty
utils/agenticSessionSearch.ts308highagenticSessionSearch
hooks/useHistorySearch.ts304highuseHistorySearch
utils/sessionFileAccessHooks.ts251highisMemoryFileAccess, registerSessionFileAccessHooks
components/tasks/RemoteSessionProgress.tsx243highformatReviewStageCounts, RemoteSessionProgress
services/SessionMemory/sessionMemoryUtils.ts208highSessionMemoryConfig, DEFAULT_SESSION_MEMORY_CONFIG, getLastSummarizedMessageId, setLastSummarizedMessageId
utils/concurrentSessions.ts205highSessionKind, SessionStatus, isBgSession, registerSession
components/SessionPreview.tsx194highSessionPreview
bridge/codeSessionApi.ts169highcreateCodeSession, RemoteCredentials, fetchRemoteCredentials
utils/sessionEnvironment.ts167highgetSessionEnvDirPath, getHookEnvFilePath, clearCwdEnvFiles, invalidateSessionEnvCache
utils/sessionState.ts151highSessionState, RequiresActionDetails, SessionExternalMetadata, setSessionStateChangedListener
commands/session/session.tsx140highcall
utils/sessionActivity.ts134highSessionActivityReason, registerSessionActivityCallback, unregisterSessionActivityCallback, sendSessionActivitySignal
Task.ts126highTaskType, TaskStatus, isTerminalTaskStatus, TaskHandle
utils/suggestions/shellHistoryCompletion.ts120highShellHistoryMatch, clearShellHistoryCache, prependToShellHistoryCache, getShellHistoryCompletion
components/HistorySearchDialog.tsx118highHistorySearchDialog
components/SessionBackgroundHint.tsx108highSessionBackgroundHint
utils/background/remote/remoteSession.ts99highBackgroundRemoteSession, BackgroundRemoteSessionPrecondition, checkBackgroundRemoteSessionEligibility
assistant/sessionHistory.ts88highHISTORY_PAGE_SIZE, HistoryPage, HistoryAuthCtx, createHistoryAuthCtx
commands/rename/generateSessionName.ts68highgenerateSessionName
bridge/sessionIdCompat.ts58highsetCseShimGate, toCompatSessionId, toInfraSessionId
components/PromptInput/HistorySearchInput.tsx51high
hooks/useFileHistorySnapshotInit.ts26highuseFileHistorySnapshotInit
services/tips/tipHistory.ts18highrecordTipShown, getSessionsSinceLastShown
commands/session/index.ts17high
commands/backfill-sessions/index.js2high
hooks/useAssistantHistory.ts251mediumuseAssistantHistory
hooks/useSSHSession.ts242mediumuseSSHSession
utils/sessionStart.ts233mediumtakeInitialUserMessage, processSessionStartHooks, processSetupHooks
hooks/useArrowKeyHistory.tsx229mediumHistoryMode, useArrowKeyHistory
hooks/useSessionBackgrounding.ts159mediumuseSessionBackgrounding
utils/sessionIngressAuth.ts141mediumgetSessionIngressAuthToken, getSessionIngressAuthHeaders, updateSessionIngressAuthToken
utils/sessionTitle.ts130mediumextractConversationText, generateSessionTitle
server/createDirectConnectSession.ts89mediumDirectConnectError, createDirectConnectSession
utils/sessionUrl.ts65mediumParsedSessionUrl, parseSessionIdentifier
utils/sessionEnvVars.ts23mediumgetSessionEnvVars, setSessionEnvVar, deleteSessionEnvVar, clearSessionEnvVars