SOLFIND
Web Lens
Portal home

Compaction - Features - Docs - Kiro

https://kiro.dev/docs/compaction/ • 202 KB fetched
Open original page


Compaction - Features - Docs - Kiro Loading image... Product * About Kiro * IDE * CLI * Web * Mobile * Crew * Pricing * Downloads For * Enterprise * Startups * Students Community * Overview * Ambassadors * Discord * Events * Powers * Shop * Showcase Resources * Docs * Blog * Changelog * FAQs * Report a bug * Suggest an idea * Billing support Social * * * * * * * English Site Terms License Responsible AI Policy Legal Privacy Policy Cookie Preferences English Loading image... * Apps * CLI * Web * Enterprise * Pricing * Docs * Community * Resources SIGN IN DOWNLOADS Loading image... Get Started Installation Authentication Your first project Models Overview Available models Reasoning effort Features How Kiro works Specs Steering Hooks MCP Permissions Custom agents Agent Skills Powers Cloud sessions Compaction Kiroignore Checkpoints and rewind Built-in tools Configuration scopes IDE 1.x What's new in 1.0 Setup & First Run Editor Chat Experimental Troubleshooting 0.x reference CLI What's new in 3.0 Setup & First Run Terminal UI Chat Voice mode Headless mode ACP Auto complete Experimental 2.x reference Crew Quick start Installation Running 24/7 Chat Agent Capabilities Features Interfaces Apps System & storage Configuration Security Troubleshooting Web Setup & First Run Identity Center Connect your repositories Working with the agent Autonomous mode Automations Memory Configuration Sync Sandbox Mobile - Preview Overview Commands and Reference CLI commands Slash commands Built-in tools Exit codes Settings Billing Overview Managing your subscription Upgrading your plan Downgrading your plan Cancelling your plan Purchasing add-on credits Managing your payments Managing usage notifications Managing your taxes Contacting billing support Deleting your account Related questions Enterprise Concepts Onboarding quickstart Connecting your identity provider Deployment options Subscribe your team Manage subscriptions Governance Monitor and track Settings Managed updates Billing IAM Supported regions Privacy and Security Overview Data protection Code references Compliance validation Infrastructure security IAM permissions Firewalls, proxies, and data perimeters VPC endpoints (AWS PrivateLink) Guides Overview Language support Learn by playing Migration Migrating from Q Developer Migrating from VSCode Upgrading from Q CLI * Docs * * Features * * Compaction Copy page View as Markdown Compaction Copy page View as Markdown Compaction keeps long sessions productive by automatically summarizing older conversation history as your session grows. Your goals, decisions, and technical progress are preserved - only the verbose middle gets compressed. Capability IDE CLI Web Mobile Automatic compaction ✓ ✓ ✓ ✓ Manual trigger ( /compact ) — ✓ — — Context usage meter ✓ ✓ ✓ ✓ How it works When your conversation approaches the model's context limit, compaction triggers automatically: * Summary generation - Kiro creates a structured summary capturing your goals, decisions, progress, and next steps * Context reduction - Older conversation history is replaced by the summary, while your most recent messages are kept verbatim * Continuation - The session continues from where you left off with no interruption Your goals, decisions, file modifications, and stated constraints survive compaction. What gets compressed is intermediate output - tool call details, exploratory discussion, and resolved error messages. Tip If the agent seems to have lost a specific detail from earlier in the session, restate it. The agent will incorporate it immediately. Example You've been working on a refactoring task for 45 minutes - the agent has modified 12 files, run tests, and fixed three build errors. Context usage is at 80%. Compaction fires. The summary captures: which files were modified, what tests pass, the remaining 2 files to refactor, and your constraint that "all changes must be backward-compatible." The last two exchanges (your most recent instruction and the agent's response) stay verbatim. The agent continues immediately. It knows what's done, what's next, and what your rules are - without carrying 45 minutes of intermediate tool output. What's preserved vs. summarized Always preserved May be summarized Task status (done / in-progress / pending) Individual tool call details File paths modified Intermediate reasoning steps Key decisions and constraints Code snippets in earlier messages Next steps Error details from resolved issues Your stated intent and requirements Exploratory discussion Triggering compaction IDE CLI Web Mobile Compaction is automatic in the IDE. There is no manual trigger. The context usage meter in the chat panel shows how close you are to the model's limit. When compaction fires, the meter resets to reflect the freed space and the session continues. Configuration The CLI exposes two settings that control how much context is retained during compaction: Setting Default Description compaction.excludeMessages 2 Minimum number of recent message pairs to retain verbatim compaction.excludeContextWindowPercent 2 Minimum percentage of the context window to keep as recent messages Both settings are evaluated, and the more conservative (larger) value wins. This ensures enough recent context is always available for the agent to maintain continuity. Limitations Compaction is one-way. The full conversation history before the compaction point is not recoverable within the session. If you need to preserve the complete history, export your session before compaction occurs. Previous versions In IDE 0.x, this feature was called "Summarization." The behavior was similar (auto-trigger at 80% context usage) but created a new session with compacted context rather than continuing in the same session. See 0.x reference for the legacy behavior. Page updated: August 4, 2026 Cloud sessions Kiroignore

Links found on this page

  1. About Kiro [direct]
  2. IDE [direct]
  3. CLI [direct]
  4. Web [direct]
  5. Mobile [direct]
  6. Crew [direct]
  7. Pricing [direct]
  8. Downloads [direct]
  9. Enterprise [direct]
  10. Startups [direct]
  11. Students [direct]
  12. Overview [direct]
  13. Ambassadors [direct]
  14. Discord [direct]
  15. Events [direct]
  16. Powers [direct]
  17. Shop [direct]
  18. Showcase [direct]
  19. Docs [direct]
  20. Blog [direct]
  21. Changelog [direct]
  22. FAQs [direct]
  23. Report a bug [direct]
  24. Suggest an idea [direct]
  25. Billing support [direct]
  26. Site Terms [direct]
  27. License [direct]
  28. Responsible AI Policy [direct]
  29. Legal [direct]
  30. Privacy Policy [direct]
  31. Cookie Preferences [direct]
  32. Loading image... [direct]
  33. SIGN IN [direct]
  34. Installation [direct]
  35. Authentication [direct]
  36. Your first project [direct]
  37. Overview [direct]
  38. Available models [direct]
  39. Reasoning effort [direct]
  40. How Kiro works [direct]
  41. Specs [direct]
  42. Steering [direct]
  43. Hooks [direct]
  44. MCP [direct]
  45. Permissions [direct]
  46. Custom agents [direct]
  47. Agent Skills [direct]
  48. Powers [direct]
  49. Cloud sessions [direct]
  50. Kiroignore [direct]
  51. Checkpoints and rewind [direct]
  52. Built-in tools [direct]
  53. Configuration scopes [direct]
  54. What's new in 1.0 [direct]
  55. Setup & First Run [direct]
  56. Editor [direct]
  57. Chat [direct]
  58. Experimental [direct]
  59. Troubleshooting [direct]
  60. 0.x reference [direct]
  61. What's new in 3.0 [direct]
  62. Setup & First Run [direct]
  63. Terminal UI [direct]
  64. Chat [direct]
  65. Voice mode [direct]
  66. Headless mode [direct]
  67. ACP [direct]
  68. Auto complete [direct]
  69. Experimental [direct]
  70. 2.x reference [direct]
  71. Quick start [direct]
  72. Installation [direct]
  73. Running 24/7 [direct]
  74. Chat [direct]
  75. Agent Capabilities [direct]
  76. Features [direct]
  77. Interfaces [direct]
  78. Apps [direct]
  79. System & storage [direct]
  80. Configuration [direct]