October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Claude and Cursor Persistent Memory: How to Set It Up for a Codebase

Use project instructions for shared codebase context, user-level rules for personal preferences, and Cursor Memories for approved conversation-derived guidance.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To make Claude Code and Cursor retain useful project context between sessions, put stable guidance in files or settings that are loaded again later. Use a project CLAUDE.md for Claude Code, Cursor Project Rules for Cursor, and separate user-level settings for personal preferences. Cursor also offers project-scoped Memories derived from conversations. These mechanisms supply context to future prompts; they do not permanently train the model on your codebase.

What “persistent memory” means in Claude Code and Cursor

In these tools, persistence means that instructions or saved context can be made available in later interactions. It is not a guarantee that every past conversation will be recalled, nor does it mean the underlying model has learned your project permanently. For reliable results, record durable facts—architecture, conventions, commands, and constraints—in a place the tool can load again.

As an Amazon Associate I earn from qualifying purchases.

The key distinction is scope: project guidance belongs with the repository, while personal preferences belong in user-level settings or files. Conversation-derived memories are a separate mechanism and should not replace explicit project documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set up persistent context in Claude Code

1. Add project guidance in CLAUDE.md

Create a CLAUDE.md at the project root and record information that should apply whenever Claude Code works in that project: a short architecture map, coding conventions, important constraints, and common development or test commands. Keep it specific and organized under descriptive headings. Anthropic’s guidance gives the example that “Use 2-space indentation” is more useful than “Format code properly.”

#1 Best Overall
Sale
Game Programming Patterns
  • Brand New in box. The product ships with all relevant accessories

Claude Code checks for memory files from the current working directory upward, excluding the filesystem root. It can also discover a nested CLAUDE.md when it reads files in that subtree, which lets a repository keep directory-specific instructions near the code they describe. See Anthropic’s Claude Code memory documentation.

2. Keep personal preferences separate

For guidance that should apply across your projects, use ~/.claude/CLAUDE.md. That keeps personal defaults—such as preferred explanation style or general coding practices—out of the repository’s shared project instructions.

3. Split and import files only when it helps

A project memory file can import other files with syntax such as @path/to/file. Imports can be nested to a maximum depth of five levels, according to Anthropic’s documentation. Use imports for genuinely separate, reusable guidance; avoid turning a concise instruction file into a maze of references.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To check what Claude Code has loaded, run /memory. It shows the memory files in use and provides a way to open them for editing. Anthropic marks CLAUDE.local.md as deprecated and recommends imports for personal instructions instead.

Set up persistent context in Cursor

1. Use Project Rules for repository guidance

Cursor’s current documentation places project rules in .cursor/rules as .mdc files. These can be committed with the project, scoped to file patterns, and configured for different application behaviors: always applied, automatically attached, requested by the agent, or invoked manually, as described in Cursor’s rules documentation. Use project rules for shared conventions and workflow instructions that need to travel with the repository.

Cursor also documents AGENTS.md as a plain-Markdown alternative. The root .cursorrules format is legacy; use Project Rules for a new setup. See Cursor’s Rules documentation.

2. Put personal defaults in User Rules

Use User Rules in Cursor Settings for preferences that should follow your account across projects rather than be committed to a particular repository. This parallels Claude Code’s user-level ~/.claude/CLAUDE.md: keep personal defaults separate from shared project facts.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Treat Memories as a separate, conversation-derived feature

Cursor describes Memories as project-scoped rules derived from Chat conversations. Its documentation says memories can be generated in the background, require user approval, and can be managed or deleted in Cursor Settings > Rules. Check the current settings and documentation for availability in your version; Cursor’s official rules page has also described Memories as unavailable when Privacy Mode is enabled. See Cursor’s Memories documentation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Will Cursor read a project’s CLAUDE.md?

Cursor’s official help says a project-root CLAUDE.md is picked up automatically, and its CLI documentation says it reads root AGENTS.md and CLAUDE.md alongside .cursor/rules. This is documented behavior for those Cursor surfaces, not proof that every Cursor product or release handles the files identically. If you rely on shared files, verify that the specific Cursor surface you use has loaded them. See Cursor’s rules help and Cursor CLI documentation.

Choose the right place for each kind of context

Need Claude Code Cursor
Shared project guidance Project CLAUDE.md Version-controlled .cursor/rules/*.mdc; AGENTS.md is also documented
Personal preferences across projects ~/.claude/CLAUDE.md User Rules in Cursor Settings
Scoped or modular instructions Nested CLAUDE.md files and @path imports Rule types, file patterns, and nested rules
Conversation-derived context The cited memory guide centers on manually maintained instruction files Project-scoped Memories derived from Chat conversations; generated memories may require approval
Inspect or edit context /memory Settings > Rules

These approaches differ in where context lives, how it is applied, whether teammates share it through version control, and how directly you can inspect or edit it. The documentation does not establish that one tool produces better memory quality than the other.

Quick Recap

SaleBestseller No. 1
Game Programming Patterns
Game Programming Patterns
Brand New in box. The product ships with all relevant accessories
$24.95
SaleBestseller No. 2

Keep persistent instructions useful over time

  • Write durable facts and constraints, not a transcript of previous chats.
  • Use clear headings and concrete directions that can be followed without interpretation.
  • Separate personal preferences from instructions the whole team should share.
  • Use path-scoped or nested guidance when different parts of the codebase need different rules.
  • Review memory files after changes to architecture, commands, or workflow, and remove stale instructions.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.