In partnership with

Ever spent hours building with Claude, only for it to forget everything halfway through?
You’re not alone. Even the best models like Claude 4.5 Sonnet start hallucinating once their context window fills up.

But here’s the thing: the problem isn’t the model. It’s your context hygiene.

After weeks of experimenting with different setups, I finally found a simple, reliable 3-part system that keeps AI Models like Claude sharp through long sessions:

  1. Compaction (cleaning up your active window),

  2. Project Memory (teaching it what to remember long-term), and

  3. Sub-Agents (delegating tasks without losing track).

Let’s break it down.

🧩 Step 1 — Compaction: Keep Your Agent’s Brain Clear

Imagine working with someone who never erases the whiteboard. Eventually, there’s no room left to think.
That’s what happens when you let your AI’s context window overflow.

Compaction is the simple act of summarizing your ongoing session, keeping only what matters and discarding the rest.

Claude’s new Sonnet 4.5 model can now compact automatically, but here’s the trick: manual compaction works better.
When you run compaction yourself, you decide what stays: architecture decisions, API contracts, or key project notes.

Context Usage Check Command returns with 92% usage highlighted

Manual compact command in Claude

After compaction, Context Usage Check Command returns 36% usage highlighted

In my tests, running a manual compact dropped context usage from 92% → 36%, freeing up room instantly.

How to Use It

When your context gets heavy (usually after 60–70% usage):

  1. Run a compaction manually.

  2. Add a short “must-keep” section, things the model can’t forget (requirements, constraints, open bugs).

  3. Ask Claude to re-summarize

    the project in 5 bullets.

That small ritual keeps every new task focused, clean, and accurate.

Think of compaction as hitting “refresh” without losing memory.

💾 Step 2 — Project Memory: Build an AI That Wakes Up Ready

The second layer is Project Memory, where Claude stores persistent knowledge between sessions.
This is what makes it feel like a teammate, not a chatbot.

Claude does this through a special file in your workspace called claude.md.
It’s basically your project’s source of truth, a simple file where you write down goals, architecture, and design constraints.

When you reopen the project, Claude reads that file and instantly remembers what you’re building.

My claude.md Starter Template

# Project Overview
- What we're building
- Who it's for
- Success criteria

# Architecture & Tools
- Tech stack
- APIs or integrations
- Non-goals

# Key Decisions
- Chosen frameworks
- Security or compliance notes
- Constraints to follow

# Notes
- Next steps
- Known issues

With this setup, Claude doesn’t just “know” your project, it understands your intent.

It’s a simple mental model:

The context window is short-term memory.
The project memory file is long-term memory.

Use both, and you’ll never start a session from zero again.

🗒️ Step 3 — Structured Notes: Make Thinking Visible

When you’re building with AI, the conversation itself becomes the workspace.
But without structure, that workspace gets chaotic fast.

That’s where structured note-taking comes in, a system of small, persistent files that Claude updates automatically after each task.

Here’s what mine looks like:

  • progress.md → what’s done, what’s next

  • decisions.md → key choices + rationale

  • bugs.md → issues + fixes

  • glossary.md → domain or app-specific terms

Claude can read and update these just-in-time, without clogging the live session.
It’s like having an AI project manager who writes your meeting notes for you.

Why It Matters

When your notes are structured, Claude can reference facts without hallucinating.
You stop repeating yourself, it stops losing track, and collaboration becomes smoother.

Every file acts like a “mini memory slot” that can be loaded, updated, and saved without touching the main window.
Over time, this creates a self-documenting, self-aware workflow, your agent literally learns how to think like you.

A word from our sponsor

The Simplest Way to Create and Launch AI Agents and Apps

You know that AI can help you automate your work, but you just don't know how to get started.

With Lindy, you can build AI agents and apps in minutes simply by describing what you want in plain English.

→ "Create a booking platform for my business."
→ "Automate my sales outreach."
→ "Create a weekly summary about each employee's performance and send it as an email."

From inbound lead qualification to AI-powered customer support and full-blown apps, Lindy has hundreds of agents that are ready to work for you 24/7/365.

Stop doing repetitive tasks manually. Let Lindy automate workflows, save time, and grow your business

🤖 Step 4 — Sub-Agents: Multiply Output Without Losing Control

Subscribe to keep reading

This content is free, but you must be subscribed to Abhi's AI Playbook to continue reading.

Already a subscriber?Sign in.Not now

Keep Reading

No posts found