Skip to main content
rule CX Codex

claude-memory-architecture — Claude Code rule: setup and details

claude-memory-architecture defines the technical architecture for the claude-memory plugin, detailing hook lifecycles, SQLite database operations, lock handling, and local vector indexing.

no license ★ 276 updated 2026-10-29

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/claude-memory-architecture.md
Open on GitHub

What claude-memory-architecture does

This architectural rule sets execution standards for the claude-memory system inside Claude Code. Execution hooks supervise startup routines and shutdown synchronization. On launch, background tasks initialize ~/.claude-memory/, import past transcripts, and update search indices. All records persist in an SQLite database using WAL mode with a 5-second busy timeout.

Runtime scripts must rely entirely on the Python standard library, as external packages like PyYAML are forbidden. Process coordination depends on OS-level flock or msvcrt locks. Using PID files is prohibited because check-then-acquire races cause concurrency conflicts between background jobs.

Text retrieval cascades down through FTS5, FTS4, and LIKE queries. Vector retrieval connects optionally to a local Ollama instance generating 256-dimension embeddings. An integrated adapter also ingests Codex desktop sessions into the shared message tables.

What it helps with

  • organize lifecycle hook sequencing inside Claude Code
  • coordinate concurrent background jobs with OS file locks
  • maintain unified session history in an SQLite database
  • combine full-text indexing with vector search across past sessions

Example prompts for the agent

  • Review the hook execution pipeline configured for session startup in claude-memory
  • Check how SQLite migrations and OS locks must be implemented in the plugin scripts
  • Explain the background sync mechanism triggered on session termination

How to install claude-memory-architecture

Manually: put the files in place

.claude/rules/claude-memory-architecture.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about claude-memory-architecture

How to install claude-memory-architecture in Claude Code?

Add the rule file to your project at .claude/rules/claude-memory-architecture.md.

What does the claude-memory-architecture rule govern?

It outlines internal specifications for claude-memory, covering SQLite schema design, migration safety, hook timing, and search mechanics.

Why does the architecture forbid third-party packages?

Runtime plugin code is intentionally restricted to the Python standard library to ensure portability across operating systems.

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

From the same set47

The whole set →
search-youtube search-youtube finds YouTube videos, pulls transcripts and metadata, downloads audio and walks a channel's uploads through a single CLI the agent calls on its own. CX Codex +1 ★ 276repo stars improve-skill improve-skill audits skill effectiveness, simulates user requests, and pinpoints missing capabilities in instructions. CX Codex +1 ★ 276repo stars performance-auditor The performance-auditor subagent inspects code for algorithmic, data-access, and resource bottlenecks. Use it after changes on hot paths or when you need to reason about how code scales. CX Codex ★ 276repo stars test-engineer test-engineer generates tests for critical business logic right after a feature or bug fix, skipping tests written purely to inflate coverage numbers. CX Codex ★ 276repo stars extract-learnings extract-learnings is a Claude Code skill that saves project knowledge and keeps memory notes organized. Record a finding or consolidate existing notes. CX Codex +1 ★ 276repo stars code-auditor code-auditor goes over the code you just changed, flags logic bugs, vague names and leftovers, then says in plain words what needs fixing. CX Codex ★ 276repo stars create-skill create-skill guides Claude Code through building a skill or slash command by clarifying its purpose and activation scenarios. Use it to draft a new instruction file. CX Codex +1 ★ 276repo stars security-auditor security-auditor finds exploitable vulnerabilities in auth, untrusted-input handling, secrets, and dependencies. Triggered after changes to auth, API endpoints, or file operations. CX Codex ★ 276repo stars

Project sponsors

Companies that keep this analytics open