Architecture

Repo context

Project-aware search, context gathering, and repository introspection.

50
Matched files
9
Top dirs
9,487
Lines in slice
167
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/analyzeContext.ts1383highTOOL_TOKEN_COUNT_OVERHEAD, DeferredBuiltinTool, SystemToolDetail, SystemPromptSectionDetail
utils/ripgrep.ts680highripgrepCommand, RipgrepTimeoutError, ripGrepStream, ripGrep
tools/GrepTool/GrepTool.ts578highGrepTool
components/ContextVisualization.tsx489highContextVisualization
hooks/toolPermission/PermissionContext.ts389highcreatePermissionContext, createPermissionQueueOps, createResolveOnce
components/GlobalSearchDialog.tsx343highGlobalSearchDialog, parseRipgrepLine
commands/context/context-noninteractive.ts326highcollectContextData, call
utils/readEditContext.ts228highCHUNK_SIZE, MAX_SCAN_BYTES, EditContext, readEditContext
utils/context.ts222highMODEL_CONTEXT_WINDOW_DEFAULT, COMPACT_MAX_OUTPUT_TOKENS, CAPPED_DEFAULT_MAX_TOKENS, ESCALATED_MAX_TOKENS
context/stats.tsx220highStatsStore, createStatsStore, StatsContext, StatsProvider
commands/install-github-app/ChooseRepoStep.tsx211highChooseRepoStep
tools/GrepTool/UI.tsx201highrenderToolUseMessage, renderToolUseErrorMessage, renderToolResultMessage, getToolUseSummary
tools/GlobTool/GlobTool.ts199highOutput, GlobTool
context.ts190highgetSystemPromptInjection, setSystemPromptInjection, getGitStatus, getSystemContext
utils/agentContext.ts179highSubagentContext, TeammateAgentContext, AgentContext, getAgentContext
utils/detectRepository.ts179highParsedRepository, clearRepositoryCaches, detectCurrentRepository, detectCurrentRepositoryWithHost
utils/githubRepoPathMapping.ts163highupdateGithubRepoPathMapping, getKnownPathsForRepo, filterExistingPaths, validateRepoAtPath
context/promptOverlayContext.tsx125highPromptOverlayData, PromptOverlayProvider, usePromptOverlay, usePromptOverlayDialog
ink/components/ClockContext.tsx112highClock, createClock, ClockContext, ClockProvider
components/TeleportRepoMismatchDialog.tsx104highTeleportRepoMismatchDialog
utils/teammateContext.ts97highTeammateContext, getTeammateContext, runWithTeammateContext, isInProcessTeammate
tools/LSPTool/symbolContext.ts91highgetSymbolAtPosition
context/voice.tsx88highVoiceState, VoiceProvider, useVoiceState, useSetVoiceState
commands/context/context.tsx64highcall
tools/GlobTool/UI.tsx63highuserFacingName, renderToolUseMessage, renderToolUseErrorMessage, renderToolResultMessage
ink/components/TerminalFocusContext.tsx52highTerminalFocusContextProps, TerminalFocusProvider
ink/components/StdinContext.ts50highProps
utils/model/contextWindowUpgradeCheck.ts48highgetUpgradeMessage
components/ContextSuggestions.tsx47highContextSuggestions
components/shell/ExpandShellOutputContext.tsx36highExpandShellOutputProvider, useExpandShellOutput
ink/components/CursorDeclarationContext.ts33highCursorDeclaration, CursorDeclarationSetter
commands/context/index.ts25highcontext, contextNonInteractive
ink/components/AppContext.ts22highProps
tools/GrepTool/prompt.ts19highGREP_TOOL_NAME, getDescription
tools/GlobTool/prompt.ts8highGLOB_TOOL_NAME, DESCRIPTION
ink/components/TerminalSizeContext.tsx7highTerminalSize, TerminalSizeContext
utils/contextAnalysis.ts273mediumanalyzeContext, tokenStatsToStatsigMetrics
utils/doctorContextWarnings.ts266mediumContextWarning, ContextWarnings, checkContextWarnings
hooks/useGlobalKeybindings.tsx249mediumGlobalKeybindingHandlers
keybindings/KeybindingContext.tsx243mediumKeybindingProvider, useKeybindingContext, useOptionalKeybindingContext, useRegisterKeybindingContext
context/notifications.tsx240mediumNotification, useNotifications, getNext
utils/contextSuggestions.ts236mediumSuggestionSeverity, ContextSuggestion, generateContextSuggestions
utils/queryContext.ts180mediumfetchSystemPromptParts, buildSideQuestionFallbackParams
context/overlayContext.tsx151mediumuseRegisterOverlay, useIsOverlayActive, useIsModalOverlayActive
utils/glob.ts131mediumextractGlobBaseDirectory, glob
context/QueuedMessageContext.tsx63mediumuseQueuedMessage, QueuedMessageProvider
context/modalContext.tsx58mediumModalContext, useIsInsideModal, useModalOrTerminalSize, useModalScrollRef
utils/workloadContext.ts58mediumWorkload, WORKLOAD_CRON, getWorkload, runWithWorkload
context/mailbox.tsx38mediumMailboxProvider, useMailbox
context/fpsMetrics.tsx30mediumFpsMetricsProvider, useFpsMetrics