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
| File | Lines | Importance | Exports |
|---|---|---|---|
| services/compact/compact.ts | 1706 | high | POST_COMPACT_MAX_FILES_TO_RESTORE, POST_COMPACT_TOKEN_BUDGET, POST_COMPACT_MAX_TOKENS_PER_FILE, POST_COMPACT_MAX_TOKENS_PER_SKILL |
| services/compact/sessionMemoryCompact.ts | 631 | high | SessionMemoryCompactConfig, DEFAULT_SM_COMPACT_CONFIG, setSessionMemoryCompactConfig, getSessionMemoryCompactConfig |
| services/compact/microCompact.ts | 531 | high | TIME_BASED_MC_CLEARED_MESSAGE, consumePendingCacheEdits, getPinnedCacheEdits, pinCacheEdits |
| services/compact/prompt.ts | 375 | high | getPartialCompactPrompt, getCompactPrompt, formatCompactSummary, getCompactUserSummaryMessage |
| services/compact/autoCompact.ts | 352 | high | getEffectiveContextWindowSize, AutoCompactTrackingState, AUTOCOMPACT_BUFFER_TOKENS, WARNING_THRESHOLD_BUFFER_TOKENS |
| commands/compact/compact.ts | 288 | high | call |
| components/FeedbackSurvey/usePostCompactSurvey.tsx | 206 | high | usePostCompactSurvey |
| services/AgentSummary/agentSummary.ts | 180 | high | startAgentSummarization |
| services/compact/apiMicrocompact.ts | 154 | high | ContextEditStrategy, ContextManagementConfig, getAPIContextManagement |
| hooks/useAwaySummary.ts | 126 | high | useAwaySummary |
| components/CompactSummary.tsx | 118 | high | CompactSummary |
| services/toolUseSummary/toolUseSummaryGenerator.ts | 113 | high | GenerateToolUseSummaryParams, generateToolUseSummary |
| services/compact/postCompactCleanup.ts | 78 | high | runPostCompactCleanup |
| services/awaySummary.ts | 75 | high | generateAwaySummary |
| services/compact/grouping.ts | 64 | high | groupMessagesByApiRound |
| services/compact/timeBasedMCConfig.ts | 44 | high | TimeBasedMCConfig, getTimeBasedMCConfig |
| services/compact/compactWarningState.ts | 19 | high | compactWarningStore, suppressCompactWarning, clearCompactWarningSuppression |
| components/messages/CompactBoundaryMessage.tsx | 18 | high | CompactBoundaryMessage |
| services/compact/compactWarningHook.ts | 17 | high | useCompactWarningSuppression |
| commands/compact/index.ts | 16 | high | — |
| commands/summary/index.js | 2 | high | — |