Home

Claude Code agent memory

Claude Code Agent Memory for Long-Running Repos

Claude Code is strongest when it understands the repo in front of it. Persistent memory helps when the next session also needs the migration plan, known test traps, local workflow preferences, and decisions from previous runs.

What to remember

Good memories are specific enough to change the next action. They are not generic tips. They describe the repo, the team, the test harness, the deployment shape, and the decision history.

  • Known failing tests and accepted workarounds.
  • Architecture decisions and why they were made.
  • User preferences for review, commit, and deployment flow.
  • Tool quirks, environment constraints, and safe commands.

What not to remember

Bad memory increases risk. Secrets, temporary guesses, stale file paths, private personal details, and unverified assumptions should not become durable context.

  • Mask credentials before memory capture.
  • Expire short-lived incident notes.
  • Keep private operator notes out of shared team memory.
  • Review high-impact memories before promotion.

Practical playbook

  1. Capture session summaries after each meaningful code change.
  2. Compress repeated observations into one durable fact.
  3. Retrieve only the top few memories for the current repo and task.
  4. Delete memories that no longer match the codebase.

Related guides

Agentmemory githubAgent memory frameworkAgent memory surveyMem0