Claude Code is powerful, and it explores a codebase well: grep, glob and read are precise, and it uses them without being asked. What it does not have is any memory of the last session. On a codebase you work on every day, that shows up fast: it loses track of the architecture it worked out yesterday, and repeats questions you answered two sessions ago.

There are four approaches to giving Claude Code the context it lacks — from the basic to the comprehensive. This article covers all four, including the one we sell, and says where each one stops.

Approach 1: Point it at the files (the default)

The simplest approach is to name the files that matter in your prompt, or paste the relevant part. Claude Code reads them with its own Read tool and finds the rest with grep.

Approach 2: Write a CLAUDE.md file

CLAUDE.md is Claude Code's built-in project memory mechanism. When present in your project directory, it's automatically read at the start of every session. A well-written CLAUDE.md describes your project's architecture, conventions and key files — giving the AI a map before it starts navigating.

# MyProject — FastAPI + React
# Auth: JWT (backend/auth/), DB: PostgreSQL via SQLAlchemy
# Entry points: backend/app.py, frontend/src/App.tsx

# CONVENTIONS
# Always async/await, never sync DB calls
# Error format: {"error": "message"}

# NEVER
# Drop tables directly — always use Alembic migrations

CLAUDE.md is worth writing and keeping short. For best practices, see our complete CLAUDE.md guide.

Approach 3: Have the agent write a handoff

Before a session ends, ask Claude Code to write down what it did, what is open, the traps it found and the next step — in a file in the repo, or in its own auto-memory. The next session, tell it to read that first. This is the biggest single improvement most people never make: the knowledge was there, it only needed writing down.

Approach 4: A memory the agent writes, and hooks that read it back

The most complete approach removes the "someone forgets" from approach 3. This is what Codelux AI provides, through a Claude Code plugin and a local MCP server:

What this looks like in practice

With the Codelux AI plugin, a typical Claude Code session goes like this:

  1. The session starts — the hook puts yesterday's memory in context: "retry race fixed; next: webhook test; trap: Stripe test keys expire after 90 days", plus the two files that changed since.
  2. You ask for the webhook test — the prompt hook adds the "payments / webhooks" codemap the agent saved last week, with its two files.
  3. Claude Code edits with its own Edit tool — the hook takes the lock on the file before and releases it after; if another agent held it, Claude Code would be told who and for how long.
  4. Before it stops, it calls memory_set with what it did and what comes next — or the Stop hook reminds it.

The AI works from what previous sessions recorded, and you do not spend the start of every conversation re-explaining your project. Everything it did is on the timeline, for you and for your team.

Which approach should you use?

Smetti di rispiegare il progetto a ogni sessione

Codelux AI dà a Claude Code e a Cursor una memoria che l'agente scrive per sé, note tra te e l'AI e una timeline di tutto ciò che accade. Tutto sulla tua macchina. Piano Free, senza limite di tempo.

Scarica Codelux AI gratis →

← Torna al blog