hackhaton-space-stackHackhaton Space Stack
AcademyBuilder
Get Started
All terms
The Basics
  • Stack
  • Frontend & Backend
  • CLI
  • Monorepo
  • Server
  • Localhost
How AI Works
  • Context Window
  • Hallucination
  • Token
  • Prompt Caching
  • Session
  • Compaction
  • Embedding
  • Vector Database
  • RAG
  • Fine-tuning
  • Temperature
  • Inference
  • Reasoning
  • Multimodal
Building With AI
  • Agent
  • MCP
  • System Prompt
  • Skill
  • CLAUDE.md
  • Slash Command
  • Harness
  • Computer Use
  • Agents SDK
  • Voice Agents
  • OAuth
  • Vibe Coding
  • Permission Scope
  • Tool Calling
  • Prompt Injection
  • Eval
  • Guardrails
  • Sandbox
  • Progressive Disclosure
Code & Collaboration
  • Git
  • Commit
  • Branch
  • GitHub
  • Pull Request
  • Open Source
  • Markdown
  • Dependency
  • Merge
  • Fork
APIs & Connections
  • API
  • Auth
  • Database
  • ORM
  • SDK
  • Webhook
  • Endpoint
  • REST
  • HTTP Methods
  • Env File
  • Schema
  • JSON
  • YAML
  • Secret
  • Rate Limit
  • CORS
  • Cookie
  • Encryption
Shipping & Running
  • Deploy
  • Headless
  • Cron
  • DNS
  • CDN
  • Object Storage
  • Serverless
  • Edge
  • Worker
  • Runtime
  • Process
  • Daemon
  • Queue
  • Job
  • State
  • Cache
  • SSH
  • Build
  • Staging
  • Rollback
  • Docker
  • Feature Flag
  • Test
  • CI/CD
  • The Cloud
Debugging & Errors
  • Trace
  • Type Error
  • Stack Trace
  • Log
  • Bug
  • Patch
  • Latency
How Developers Think
  • DRY
  • YAGNI
  • KISS
  • Refactoring
  • Technical Debt
  • Async
← All terms

Type-safe, modern TypeScript scaffolding for full-stack web development

ThreadsGitHub

Info

  • Academy
  • Docs

Legal

  • Terms of Service
  • Privacy Policy

© 2026 Dzulhelmy Nazri

How AI Works

$definecompaction--plain-english

Compaction

TLDRSummarizing the chat so it keeps fitting.

Picture your whole hackathon plate. The stack picked in the builder. The CORS fix. The todo schema. The Polar webhook tangent. The error paste from line 47. Now dump all of it in a blender and hit go.

Technically it is still your project. Same ingredients, all in there. But it is very much not the same thing, and you cannot un-blend it.

That is compaction.

The model thinks inside a context window — one room, measured in tokens. Everything you have said this session is stacked in that room. When the room fills up, the host cannot keep cramming. To stay alive, it takes the early part of the conversation, crushes it into a short summary, and carries on with that recap instead of the full history.

The gist survives. The detail turns to mush.

The tell is a personality change. The agent was sharp — locked on Hono, remembered the env var name, knew which file you meant. Then it compacts and goes vaguer. Slightly off. Reaching for the right answer and grabbing a close-enough one. It did not get dumber. It is working off the blended version now.

When compaction runs, the model decides what is worth keeping. Not you. It scans hours of back-and-forth, writes its own recap of "what we were doing," and the one detail you actually cared about can quietly disappear into the blender.

I try never to let a session compact on its own.

The second I see the room filling up, I stop. I do not wait for the blender to kick on. Instead I:

  1. Start a fresh session so I get a clean, empty room.
  2. Write a quick handoff of what actually matters: what we are building, what is decided, what is left to do.
  3. Paste that into the new chat and pick up exactly where I was — detail intact, because I chose what to keep.

A few things worth knowing so this does not catch you out:

  • It often happens silently. Some tools announce "compacting now." Many just do it. If a long chat suddenly feels foggy, compaction is your first suspect.
  • Bigger rooms delay it; they do not cancel it. A mansion fills slower than a studio apartment, but a long enough conversation fills anything.
  • A handoff beats a summary every time, because you decide what survives instead of letting the model guess.

Put facts in files the agent can reopen — not in a joke from Tuesday. Prompt caching keeps stable prep warm; compaction throws early turns into a smoothie. Different tools, same lesson: the room has limits.

When the model compacts, it holds the pen. When you start fresh with a handoff, you hold it.

Related

  • Context Window
  • Session
  • Token
  • Prompt Caching
PrevSession

How AI Works

NextEmbedding