# Consolidate Memory

> Consolidate memory from the last 24 hours of local Claude logs (~/.claude) into memory/recent-memory.md, memory/long-term-memory.md, and memory/project-memory.md; promote durable facts and patterns from recent to long-term, and run nightly via launchd automation.

- Skill: `talgacapri/consolidate-memory` (Agent Skill)
- Install (CLI): `npx skillmds@latest add talgacapri/consolidate-memory`
- Raw SKILL.md: https://api.skillmd.com/api/skills/talgacapri/consolidate-memory/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: talgacapri (https://skillmd.com/u/talgacapri)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/talgacapri/consolidate-memory

---


## Why this exists, and what I'd change

**Why it exists.** Single-file rolling memory gets noisy fast. Long-term decisions get buried under last week's standup chatter. This skill splits memory into three files (recent, long-term, project) and promotes the durable stuff up the chain.

**Design tradeoffs.**
- **Three memory files instead of one.** Recent (48h rolling), long-term (distilled facts and preferences), project (active initiative state). Cost: more files to grep, and promotion logic is heuristic and occasionally wrong.
- **Nightly cron promotion via launchd, not in-session.** Promotion runs at 2am local time. Cost: same-day insights don't move into long-term until tomorrow. If the cron breaks, memory drifts silently.
- **Reads from `~/.claude` logs, not a dedicated event stream.** I chose to scrape what's already there. Cost: depends on Claude Code's log format staying stable. Will break if Anthropic changes it.

**What I'd change.** Add an explicit "remember this" command that promotes a fact immediately to long-term, instead of waiting for the cron to maybe catch it.

---

# Consolidate Memory

Keep a persistent memory layer up to date from real conversation history.

## Scope

This skill does four things:

1. Reads local conversation logs from `~/.claude` (last 24h for extraction).
2. Updates rolling context in `memory/recent-memory.md` (48h window).
3. Updates `memory/project-memory.md` (active initiatives, open decisions, next actions).
4. Promotes durable facts/preferences/patterns into `memory/long-term-memory.md`.

## Commands

```bash
/consolidate-memory run
/consolidate-memory status
/consolidate-memory install-nightly
```

Equivalent CLI:

```bash
python scripts/memory/consolidate_memory.py --run
```

## Files

- `memory/recent-memory.md` - Rolling 48-hour memory
- `memory/long-term-memory.md` - Distilled durable memory
- `memory/project-memory.md` - Active project state

Legacy mirrors are kept in:

- `long-term-memory.md`
- `context-library/pm-os-learning-log.md`

## Promotion Rules

Promote from recent -> long-term when signals look durable:

- repeated mentions (frequency threshold)
- explicit preference language (`prefer`, `always`, `never`, `tone`, `style`)
- durable operational facts (`scheduled`, `deadline`, recurring workflows)

## Nightly Automation (macOS)

Install/update launchd job:

```bash
bash scripts/memory/install_consolidate_memory_launchd.sh
```

This writes:

- `~/Library/LaunchAgents/com.pmos.consolidate-memory.plist`

And schedules a nightly run at 2:20 AM local time.

## Output Expectations

After each run, script prints a JSON summary:

- number of source files read
- extracted decisions/preferences/facts
- promoted facts/preferences/patterns


