Architecture

Compaction

Context shrinking, summarization boundaries, and long-session management.

21
Matched files
4
Top dirs
5,113
Lines in slice
81
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
services/compact/compact.ts1706highPOST_COMPACT_MAX_FILES_TO_RESTORE, POST_COMPACT_TOKEN_BUDGET, POST_COMPACT_MAX_TOKENS_PER_FILE, POST_COMPACT_MAX_TOKENS_PER_SKILL
services/compact/sessionMemoryCompact.ts631highSessionMemoryCompactConfig, DEFAULT_SM_COMPACT_CONFIG, setSessionMemoryCompactConfig, getSessionMemoryCompactConfig
services/compact/microCompact.ts531highTIME_BASED_MC_CLEARED_MESSAGE, consumePendingCacheEdits, getPinnedCacheEdits, pinCacheEdits
services/compact/prompt.ts375highgetPartialCompactPrompt, getCompactPrompt, formatCompactSummary, getCompactUserSummaryMessage
services/compact/autoCompact.ts352highgetEffectiveContextWindowSize, AutoCompactTrackingState, AUTOCOMPACT_BUFFER_TOKENS, WARNING_THRESHOLD_BUFFER_TOKENS
commands/compact/compact.ts288highcall
components/FeedbackSurvey/usePostCompactSurvey.tsx206highusePostCompactSurvey
services/AgentSummary/agentSummary.ts180highstartAgentSummarization
services/compact/apiMicrocompact.ts154highContextEditStrategy, ContextManagementConfig, getAPIContextManagement
hooks/useAwaySummary.ts126highuseAwaySummary
components/CompactSummary.tsx118highCompactSummary
services/toolUseSummary/toolUseSummaryGenerator.ts113highGenerateToolUseSummaryParams, generateToolUseSummary
services/compact/postCompactCleanup.ts78highrunPostCompactCleanup
services/awaySummary.ts75highgenerateAwaySummary
services/compact/grouping.ts64highgroupMessagesByApiRound
services/compact/timeBasedMCConfig.ts44highTimeBasedMCConfig, getTimeBasedMCConfig
services/compact/compactWarningState.ts19highcompactWarningStore, suppressCompactWarning, clearCompactWarningSuppression
components/messages/CompactBoundaryMessage.tsx18highCompactBoundaryMessage
services/compact/compactWarningHook.ts17highuseCompactWarningSuppression
commands/compact/index.ts16high
commands/summary/index.js2high