/zforge:memoryfrom zforge
Manage working memory (session-scoped) and long-term memory (cross-session). Automatically triggered by hooks at session start/stop. Invoke manually with /memory to review or curate.
Ships in zforge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Two-tier memory system: working memory for session context, long-term memory for durable facts. Inspired by OpenClaw's daily notes and Hermes' bounded curation.
~/.claude/memory/
├── working/ # Session-scoped daily notes
│ ├── 2026-05-07.md # Today's context
│ └── 2026-05-06.md # Yesterday's context
└── long-term/ # Curated durable facts
├── MEMORY.md # Index (loaded every session)
├── decisions_*.md # Architecture/design decisions
├── context_*.md # Project context
└── learnings_*.md # Technical learnings
File: ~/.claude/memory/working/YYYY-MM-DD.md
Format:
# YYYY-MM-DD
## Active Tasks
- [task description] — [status: in-progress/blocked/done]
## Decisions Made
- [decision]: [rationale]
## Key Context
- [anything needed to resume work if session restarts]
## Open Questions
- [unresolved questions or blockers]
Write to today's daily note when:
Working memory is append-only within a session. Overwrite sections only to update status (in-progress → done).
Daily notes older than 7 days are automatically archived by the cleanup hook. Keep today + yesterday loaded at session start.
Directory: ~/.claude/memory/long-term/
Index: ~/.claude/memory/long-term/MEMORY.md — one-line pointers, max 50 entries.
Only facts that satisfy ALL of:
Examples: why a certain approach was rejected, a user preference discovered mid-session, an external constraint (deadline, dependency on another team).
At session end (or when manually invoked), review today's daily notes and ask:
If yes, extract and save to long-term. Deduplicate against existing entries.
Long-term memory index (MEMORY.md) is capped at 50 entries. When approaching the limit, merge related entries or remove stale ones. The test: if nobody has looked at a memory in 30 days and it hasn't influenced any decision, it's probably stale.
The restore.sh hook runs at session start and injects:
This gives the new session immediate context about recent work.
The flush.sh hook runs at session end. It:
When the user invokes /memory:
When the conversation is getting long (you notice tool results being truncated or prior context feeling thin), proactively save critical working memory before it's lost. This is a safety net — don't wait for automatic triggers.
Signs you should flush:
This skill complements but does not replace:
principles.md — personality (SOUL), managed by the principle skillmemory/ in .claude/projects/ — Claude Code's built-in memory (continue using for project-specific feedback/user/reference memories as the system prompt instructs)The ~/.claude/memory/ directory is for cross-project working memory and curated long-term facts. Project-specific memories stay in their respective .claude/projects/*/memory/ directories.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
16 skills in this plugin
/add-featAdd a new feature with design, TDD, and PR workflow/auditAudit a codebase for security vulnerabilities, code quality issues, and architecture concerns/autopilotUse when the user says "autopilot", "auto mode", "替我回答", or "自动回答". Enables autonomous decision-making by answering Claude's own questions based on the user's personality profile./blogWrite personal blog posts with the rhythm, structure, and voice of top-tier essayists (Paul Graham, Dan Luu, Henrik Karlsson, Ben Kuhn, etc.)npx claudepluginhub zhengxuyu/zforge --plugin zforge