Skip to content
/

cc-simple-memory (STRML)

cc-simple-memory · STRML/cc-simple-memory · ★ 0 · last commit 2026-04-09

Primitive shape 4 total
Commands 1 Hooks 3
00

Summary

cc-simple-memory (STRML) — Summary

cc-simple-memory is a minimalist Claude Code plugin (Shell + Node.js) for extracting learnings from session transcripts into per-project and global MEMORY.md files. It uses three hooks (SessionStart, Stop, PreCompact) and a dedicated claude-memory CLI binary that wraps the extraction logic. The model tiering is distinctive: Sonnet for per-session extraction (Stop, max 1/hour per project), Opus for garbage collection (every 10 extractions), and Haiku for condensation pre-passes on long sessions. It creates two persistence scopes — per-project (~/.claude/projects/<encoded>/memory/MEMORY.md) and global cross-project (~/.claude/rules/global-memory.md) — so learnings can propagate across sessions and projects. Installation requires a post-install setup script to create the ~/bin/claude-memory symlink and grant permissions. The framework is ultra-lightweight (3 shell scripts, 1 Node.js CLI) with no database, no MCP server, and no dashboard. Compared to seeds, it is closest to agent-os in prioritizing minimal footprint, but adds automatic AI-powered extraction at session boundaries.

01

Overview

cc-simple-memory (STRML) — Overview

Origin

Created by STRML (Samuel Reed). Published as a simple, practical alternative to complex memory systems. 0 GitHub stars but well-architected and in active development (last push 2026-04-09).

Philosophy

Simplicity first: "Session → Claude writes MEMORY.md proactively (instructed via SessionStart hook). Stop → extract-learnings.sh → claude-memory extract → background Sonnet writes MEMORY.md. /clear → capture-learnings.sh → background Sonnet writes project CLAUDE.md. Every 10th extraction → gc-memory.sh → Opus consolidates + archives stale entries."

The key insight: extraction runs in the background (the script doesn't block Claude). Cost awareness is built in with explicit cost estimates per operation.

Cost Transparency

Operation Model Frequency Cost
Extraction (Stop hook) Sonnet medium Max 1/hr/project ~$0.10
Condensation pre-pass Haiku low Long sessions only ~$0.01
/clear capture Sonnet low On /clear ~$0.05
GC pass Opus low Every 10 extractions ~$0.15

Opt-Out Mechanisms

  • Per-session: add SKIP_MEMORY_EXTRACTION on its own line in session
  • Global: set CLAUDE_SKIP_SESSION_LEARNINGS=1 before starting

Notable: Two Memory Scopes

Unlike most memory systems that are project-scoped only, cc-simple-memory has:

  1. Per-project: ~/.claude/projects/<encoded>/memory/MEMORY.md — auto-loaded
  2. Global: ~/.claude/rules/global-memory.md — loaded everywhere
02

Architecture

cc-simple-memory (STRML) — Architecture

Distribution

Claude Code plugin. Install via marketplace.

Install

/plugin marketplace add STRML/cc-simple-memory
/plugin install cc-simple-memory
# Restart Claude Code

# Then run setup in terminal (NOT inside Claude):
PLUGIN_DIR=$(ls -dt ~/.claude/plugins/cache/*/cc-simple-memory 2>/dev/null | head -1)
bash "${PLUGIN_DIR}/bin/setup.sh"
# Restart Claude Code again

The setup script: adds 9 permission entries to ~/.claude/settings.json, creates ~/bin/claude-memory (or ~/.local/bin/) symlink.

Directory Structure

plugin/
├── .claude-plugin/
│   ├── plugin.json
│   └── marketplace.json
├── hooks/
│   ├── hooks.json          # 3 lifecycle hooks
│   ├── session-start.sh    # Loads per-project + global MEMORY.md
│   ├── extract-learnings.sh # Calls claude-memory extract (background)
│   ├── gc-memory.sh        # Every 10 extractions: Opus GC
│   └── capture-learnings.sh # On /clear: writes project CLAUDE.md
├── commands/
│   └── memory-setup.md     # /memory-setup slash command
├── bin/
│   └── ... (claude-memory CLI)
└── skills/
    └── (empty or minimal)

State Storage

File Purpose Auto-loaded
~/.claude/projects/<encoded>/memory/MEMORY.md Per-project memory Yes
~/.claude/projects/<encoded>/memory/ARCHIVE.md Cold storage No
~/.claude/rules/global-memory.md Cross-project Yes, everywhere
~/.claude/memory/global-archive.md Global cold storage No

Path encoding: Claude Code replaces both / and . with - in project paths.

Required Runtime

  • Node.js (for claude-memory CLI)
  • Claude Code with marketplace plugin support

Target AI Tools

Claude Code exclusively.

03

Components

cc-simple-memory (STRML) — Components

Lifecycle Hooks (3)

Hook Event Script Action
SessionStart session-start.sh Load per-project MEMORY.md + global-memory.md
Stop extract-learnings.sh Background call to claude-memory extract (Sonnet, max 1/hr)
PreCompact capture-learnings.sh Background Sonnet writes project CLAUDE.md

CLI: claude-memory

Installed to ~/bin/claude-memory or ~/.local/bin/claude-memory.

Subcommand Purpose
show Display project + global memory
stats Sizes, transcript counts, log activity
log Recent extraction log
search "query" Search project transcripts
extract Run extraction for current project
extract --dry-run Preview extraction without writing
gc Run garbage collection (Opus)
gc --dry-run Preview GC without writing
compact-archive Deduplicate bloated archive files
show archive View cold storage

Commands (1)

Command Purpose
/memory-setup Check configuration status; print exact setup command if needed

Skills

Minimal or none (not visible in repo structure).

GC (Garbage Collection)

Every 10th extraction triggers gc-memory.sh which uses Opus to:

  • Consolidate duplicate/redundant memories
  • Archive stale entries to ARCHIVE.md
  • Reduce MEMORY.md size

Scripts

Script Trigger
hooks/session-start.sh SessionStart hook
hooks/extract-learnings.sh Stop hook
hooks/capture-learnings.sh PreCompact hook
hooks/gc-memory.sh Every 10 extractions (internal)
bin/setup.sh One-time install
05

Prompts

cc-simple-memory (STRML) — Prompts

extract-learnings.sh (verbatim)

#!/bin/bash
# Stop hook — extract learnings from session transcript into MEMORY.md
# Delegates all logic to the claude-memory CLI.
# Opt-out: CLAUDE_SKIP_SESSION_LEARNINGS=1

[ "${CLAUDE_SKIP_SESSION_LEARNINGS:-}" = "1" ] && exit 0

# Guard: CLAUDE_PLUGIN_ROOT must be set and the binary must exist
[ -n "${CLAUDE_PLUGIN_ROOT:-}" ] || exit 0
[ -x "${CLAUDE_PLUGIN_ROOT}/bin/claude-memory" ] || exit 0

project_cwd="${CLAUDE_PROJECT_DIR:-$(pwd)}"
[ -z "$project_cwd" ] && exit 0

# Always exit 0 — Stop hooks must never fail.
# Pass CLAUDE_PROJECT_DIR explicitly so the CLI extracts for the correct project.
CLAUDE_PROJECT_DIR="$project_cwd" "${CLAUDE_PLUGIN_ROOT}/bin/claude-memory" extract || true

Prompting technique: Defensive shell script. The || true pattern at the end ensures Stop hooks never fail (which would disrupt Claude Code). The script is purposefully minimal — all complexity delegates to the CLI.

SessionStart Hook (verbatim excerpt)

From hooks/hooks.json:

{
  "hooks": {
    "SessionStart": [{
      "hooks": [{
        "type": "command",
        "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\""
      }]
    }],
    "Stop": [{
      "hooks": [{
        "type": "command",
        "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/extract-learnings.sh\""
      }]
    }],
    "PreCompact": [{
      "hooks": [{
        "type": "command",
        "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/capture-learnings.sh\""
      }]
    }]
  }
}

Prompting technique: Lifecycle hook injection. The framework uses Claude Code's native hook system to inject and extract memory at session boundaries without requiring any user action.

Model Tiering Strategy

The framework uses different models for different extraction tasks based on quality/cost tradeoffs:

  • Haiku (cheapest): Pre-pass condensation for very long sessions
  • Sonnet (mid): Per-session extraction (balance of quality and cost)
  • Opus (most capable): GC passes where consolidation quality matters most

This is the only memory system in this batch with explicit three-tier model routing for different extraction tasks.

09

Uniqueness

cc-simple-memory (STRML) — Uniqueness

Differs From Seeds

Closest to ccmemory (seed) in using lifecycle hooks (SessionStart, Stop, PreCompact) for automatic memory management. But architecture is radically simpler: file-based Markdown rather than Neo4j graph, shell scripts rather than Python/MCP server. Similar to agent-os (seed) in minimalism — both value lean installation. Unlike most memory systems that are project-scoped, cc-simple-memory has a two-tier scope (per-project MEMORY.md + global global-memory.md) that enables cross-project learning propagation.

Distinctive Features

  1. Three-tier model routing: Haiku (condensation pre-pass) → Sonnet (extraction) → Opus (GC). Explicit quality/cost assignment per task.
  2. GC with Opus: Periodic garbage collection with the most capable model ensures cold storage stays clean. No other file-based system in this batch has GC.
  3. Global + per-project scopes: global-memory.md in ~/.claude/rules/ is auto-loaded everywhere, enabling cross-project learning. The only file-based system in this batch with this.
  4. Rate limiting: Max 1 extraction/hour per project prevents runaway costs. Transparent about costs per operation.
  5. Memory outside the project: Files live in ~/.claude/projects/ rather than project directory — not committed to VCS by default.

Observable Failure Modes

  1. Two-restart setup: Required two-restart process creates friction and potential misconfiguration.
  2. No search from agent: The claude-memory search CLI is for humans, not agents. No MCP tools.
  3. Rate-limited extraction: 1/hr limit means rapid iteration sessions don't capture all learnings.
  4. Markdown-only storage: No structured schema, no deduplication, no relationship tracking.
  5. Global memory pollution: global-memory.md loaded everywhere may inject irrelevant context.
04

Workflow

cc-simple-memory (STRML) — Workflow

Session Lifecycle

SessionStart → session-start.sh → inject project MEMORY.md + global-memory.md
↓
(active work)
↓
Stop → extract-learnings.sh → claude-memory extract (Sonnet, background, max 1/hr)
     → MEMORY.md updated if extraction ran
↓
Every 10th extraction → gc-memory.sh → Opus consolidates + archives stale entries
↓
On /clear → capture-learnings.sh → Sonnet writes project CLAUDE.md

Phases + Artifacts

Phase Artifact
SessionStart Per-project MEMORY.md + global-memory.md loaded into context
Stop Updated per-project MEMORY.md (if not rate-limited)
GC pass Consolidated MEMORY.md + ARCHIVE.md (cold storage)
/clear Updated project CLAUDE.md

Rate Limiting

Stop extraction: max 1/hr per project. If triggered more frequently, the script exits early without extracting.

Opt-Out

  • Per-session: include SKIP_MEMORY_EXTRACTION line in session
  • Global: CLAUDE_SKIP_SESSION_LEARNINGS=1 env var

Approval Gates

None. All extraction and GC run automatically.

Notes

Background execution: the extract-learnings.sh and capture-learnings.sh scripts call claude-memory extract with the || true pattern, ensuring Stop hooks never fail. Extraction happens asynchronously and doesn't block Claude's response.

06

Memory Context

cc-simple-memory (STRML) — Memory & Context

Memory Type

file-based — Markdown files only. No database.

Persistence Scope

global — Two scopes coexist:

  1. Per-project: ~/.claude/projects/<encoded>/memory/MEMORY.md
  2. Global: ~/.claude/rules/global-memory.md

State Files

File Loaded Content
~/.claude/projects/<encoded>/memory/MEMORY.md Auto Per-project extracted learnings
~/.claude/projects/<encoded>/memory/ARCHIVE.md Manual Cold storage (post-GC)
~/.claude/rules/global-memory.md Auto everywhere Cross-project learnings
~/.claude/memory/global-archive.md Manual Global cold storage

Path encoding: Claude Code encodes project paths by replacing / and . with -.

Search Mechanism

none in production. The claude-memory search "query" CLI searches project transcripts but this is not exposed as an agent-callable tool.

Context Compaction Strategy

Yes — via PreCompact hook:

  • capture-learnings.sh runs before Claude compresses context
  • Sonnet extracts learnings from about-to-be-compressed session
  • Writes to project CLAUDE.md (not MEMORY.md)

Cross-Session Handoffs

yes — via SessionStart hook loading MEMORY.md + global-memory.md automatically.

GC Strategy

Every 10th extraction runs Opus to consolidate and archive:

  • Deduplicates redundant memories
  • Archives stale entries to ARCHIVE.md
  • Reduces MEMORY.md file size This prevents unbounded growth (unique in this batch for file-based systems).

Key Design Choice

Memory files live inside Claude Code's own project structure (~/.claude/projects/) rather than in the project directory. This means memory is not committed to version control by default.

07

Orchestration

cc-simple-memory (STRML) — Orchestration

Multi-Agent

No. Single-agent.

Orchestration Pattern

none

Multi-Model

Yes — three models for three tasks:

  • Haiku → long session condensation pre-pass
  • Sonnet → per-session extraction (Stop hook)
  • Opus → GC consolidation (every 10 extractions)

This is role-based model routing within the extraction pipeline.

Execution Mode

event-driven — hooks triggered by Claude Code lifecycle events.

Isolation

none

Crash Recovery

|| true pattern ensures Stop hooks never fail. Rate limiting prevents runaway API costs.

08

Ui Cli Surface

cc-simple-memory (STRML) — UI & CLI Surface

Dedicated CLI Binary

claude-memory — installed to ~/bin/claude-memory.

Subcommands: show, stats, log, search, extract, extract --dry-run, gc, gc --dry-run, compact-archive, show archive.

Local Web Dashboard

None.

IDE Integration

Claude Code plugin via marketplace. One slash command: /memory-setup to check configuration status.

Observability

  • claude-memory stats — sizes, transcript counts, log activity
  • claude-memory log — recent extraction log
  • MEMORY.md and global-memory.md are human-readable

Notes

The setup requires a two-restart process (once for plugin install, once for permission changes), which is a notable friction point. The /memory-setup command exists specifically to surface this requirement and provide the exact shell command needed.

Related frameworks

same archetype · same primary tool · same memory type

BMAD-METHOD ★ 48k

Provides a full agile delivery lifecycle with named expert-persona AI collaborators that elicit the human's best thinking rather…

Agent OS ★ 4.6k

Extracts implicit codebase conventions into token-efficient markdown standards files and injects them selectively into AI agent…

Claude Conductor ★ 367

Gives Claude Code a persistent, cross-linked, auto-analyzed documentation system so it retains codebase context across sessions.

Spec-Driver (Greenfield Spec-Driven Development) ★ 25

Prevents spec rot in AI-assisted development by making implementation changes flow back into evergreen, authoritative specs via…

Anthropic Knowledge Work Plugins ★ 16k

Role-specialized plugin bundles with live MCP connectors that turn Claude into a domain expert for enterprise knowledge workers.

Codex Integration for Claude Code (skill-codex) ★ 1.3k

Single Claude Code skill that handles Codex CLI invocation correctly (stdin blocking, thinking token suppression, session resume)…