memory-setup
Skill13 starsChanged 11 days agoMITView on GitHub
Initialize or upgrade project memory for memory-toolkit. Works with existing auto-memory.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- shreeve1/Claude-Coworktheir own version, first seen Nov 1, 2026
- sloemo01/hermes-skills-bundletheir own version, first seen Jul 28, 2026
- LupoGrigi0/claude-memorytheir own version, first seen Apr 15, 2026
- thoitiettxl-cyber/Claw-IItheir own version, first seen Apr 3, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- sloemo01/hermes-skills-bundle★ 9same name
- thoitiettxl-cyber/Claw-II★ 2same name
- LupoGrigi0/claude-memory★ 0same name
- shreeve1/Claude-Cowork★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- docs-reflectSkill
- memorySkill
- parkSkill
- reflectSkill
- session-continueSkill
- session-endSkill
- session-insightsSkill
- session-restoreSkill
- session-startSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. 0 are common, 15 are distinctive, and 15 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Check what already exists:
- Very specific: line 39
If --fresh argument or no $MEM_DIR:
- Very specific: line 57
Ask: "What are the main workstreams in this project?" → create workstreams.json
- Distinctive: line 59
Ask sequentially, accept short answers, skip empty:
- Very specific: line 65
Write as markdown with Section: headers, not a single paragraph.
- Very specific: line 66
Ask: "What language do you prefer for documentation and rules?
- Very specific: line 67
Ask: "Key links (Jira, Figma, Slack, docs)?" → create reference/links.md
- Distinctive: line 68
Create MEMORY.md from template (see Step 4)
- Distinctive: line 76
Backup MEMORY.md: before any changes:
- Distinctive: line 81
Read existing MEMORY.md — understand current structure
- Distinctive: line 116
Wait for user confirmation before making changes.
- Very specific: line 128
Use $MEM as an absolute path when writing the API block into MEMORY.md.
- Distinctive: line 132
Read current MEMORY.md. Ensure the structure follows this order:
- Distinctive: line 179
Do NOT remove or rewrite existing content in MEMORY.md.
- Distinctive: line 189
Ask: "Based on these files, I see topics like {X, Y, Z}.
- Very specific: line 193
After creating workstreams.json, add a Workstreams section to MEMORY.md so they are visible in the index:
- Very specific: line 204
If profile/user-role.md exists (or was just created), ensure MEMORY.md has a ## Profile section indexing it:
- Very specific: line 211
Place it right after the ## Rules block — profile is high-signal context, agent should see it early.
- Very specific: line 215
If path B (upgrade) and profile/user-role.md does NOT exist, run the same interview as Step 2A point 4.
- Very specific: line 219
Only if user agrees. For each .md file with frontmatter type:
- Distinctive: line 228
After moving files — update paths in MEMORY.md index.
- Very specific: line 233
If memory-schema.json is missing in $MEM_DIR:
- Very specific: line 298
Only switch to Exclusive if user explicitly requests it.
- Very specific: line 300
If user wants to trim — identify entries that can be removed (old, superseded, redundant) and propose which to cut.
- Distinctive: line 306
Always backup MEMORY.md before modifying it
- Distinctive: line 307
Never overwrite or delete existing files
- Distinctive: line 308
Always show proposed changes before applying
- Distinctive: line 310
If MEMORY.md is already >150 lines, warn about the 200-line limit and suggest trimming
- Distinctive: line 311
If user says "just do it" — apply all changes without individual confirmations
- Very specific: line 312
If --fresh flag — skip detection, create everything from scratch
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/memory-setup — Initialize or upgrade project memory
Detects existing memory, adds what's missing, doesn't overwrite anything.
Step 1: Find memory directory
MEM_DIR=$(node "${CLAUDE_PLUGIN_ROOT}/scripts/memory.js" dir) # the folder CC auto-memory uses; printed even if missingCheck what already exists:
echo "=== Memory dir: $MEM_DIR ==="
[ -d "$MEM_DIR" ] && echo "DIR: exists" || echo "DIR: missing"
[ -f "$MEM_DIR/MEMORY.md" ] && echo "MEMORY.md: exists" || echo "MEMORY.md: missing"
[ -f "$MEM_DIR/workstreams.json" ] && echo "workstreams.json: exists" || echo "workstreams.json: missing"
ls "$MEM_DIR"/*.md 2>/dev/null | wc -l | xargs -I{} echo "MD files: {}"
ls -d "$MEM_DIR"/*/ 2>/dev/null | wc -l | xargs -I{} echo "Subdirs: {}"Report findings to the user before making any changes.
Step 2: Branch by state
A) No memory dir at all → fresh setup
If --fresh argument or no $MEM_DIR:
Before creating anything, show the user what will be set up:
Fresh memory setup for this project:
Dir: {MEM_DIR}
Will create: MEMORY.md, workstreams.json, memory-schema.json
Subdirs: feedback/, decisions/, profile/, reference/, notes/, workstreams/
Will ask: workstreams, role, language, key links
Proceed? (yes/skip)Wait for confirmation before creating any files.
mkdir -p "$MEM_DIR"memory.jsstays in the plugin — never copy it into$MEM_DIR- Ask: "What are the main workstreams in this project?" → create
workstreams.json Profile interview → create
profile/user-role.md(frontmattertype: user). Ask sequentially, accept short answers, skip empty:- Role: "What's your role and team?" (job title, company, team size)
- Initiative: "What's the broader initiative or goal you're driving here?"
- Communication style: "Anything about how you like to work? (pacing, directness, things that annoy you)"
- Domain terminology: "Any project-specific terms I should know? (e.g. портфель instead of sprint, custom SP units)"
Write as markdown with
**Section:**headers, not a single paragraph. This profile gets auto-loaded via MEMORY.md and shapes how the agent communicates with you.- Ask: "What language do you prefer for documentation and rules? (e.g. English, Russian)" → create
profile/language.md - Ask: "Key links (Jira, Figma, Slack, docs)?" → create
reference/links.md - Create MEMORY.md from template (see Step 4)
- Copy memory-schema.json:
cp "${CLAUDE_PLUGIN_ROOT}/scripts/lib/memory-schema.default.json" "$MEM_DIR/memory-schema.json" - Create subdirectories:
mkdir -p "$MEM_DIR"/{feedback,decisions,profile,reference,notes,workstreams}
B) Existing MEMORY.md → upgrade in place
This is the common path for users with Claude Code auto-memory.
- Backup MEMORY.md before any changes:
Tell the user: "Backed up MEMORY.md to MEMORY.md.backup.{timestamp}"cp "$MEM_DIR/MEMORY.md" "$MEM_DIR/MEMORY.md.backup.$(date +%Y%m%d-%H%M%S)" - Read existing MEMORY.md — understand current structure
- Copy
memory.jsif missing - Analyze existing
.mdfiles — detect types from frontmatter - Propose changes (don't apply yet)
Step 3: Upgrade checklist (for path B)
Show the user what will be added/changed:
## Memory setup for {project}
Found: {N} memory files, MEMORY.md ({lines} lines)
Proposed changes:
[ ] Backup MEMORY.md → MEMORY.md.backup.{timestamp}
[ ] Ensure memory.js accessible (plugin or manual copy)
[ ] Add API block to MEMORY.md
[ ] Add Rules block to MEMORY.md
[ ] Add Session lifecycle block to MEMORY.md
[ ] Create workstreams.json from existing files
[ ] Create memory-schema.json (weighted eviction config)
[ ] Create subdirectories (feedback/, decisions/, etc.)
[ ] Move files to subdirectories by type
[ ] Profile interview → profile/user-role.md (if missing)
Already in place:
[x] MEMORY.md exists
[x] {list what's already there}
Proceed? (or pick specific items)Wait for user confirmation before making changes.
Step 4: Apply changes
4a: Resolve memory.js path
MEM="${CLAUDE_PLUGIN_ROOT}/scripts/memory.js"Use $MEM as an absolute path when writing the API block into MEMORY.md.
4b: Update MEMORY.md
Read current MEMORY.md. Ensure the structure follows this order:
- Heading (first line)
- API block (lines 3-6) — always near the top
- Rules block (lines 8-30) — always before index entries
- Index entries — the rest of the file
This order matters: Claude Code truncates MEMORY.md after 200 lines. By keeping API and Rules at the top, they survive truncation even if auto-memory adds many index entries.
API block (add if missing, right after heading — one compact line, use the absolute $MEM path resolved in 4a):
## API
`node {absolute path to memory.js} --dir={MEM_DIR} <command>`Rules block (add if missing, after API and before index entries).
## Rules
### Save
- Decision with reasoning → memory file with **Why:** and **How to apply:**
- User corrects you or confirms non-obvious choice → feedback memory
- Something surprising or counter-intuitive → note + memory
- Convert relative dates to absolute: "Thursday" → "2026-04-10"
### Don't save
- What git log already knows (commits, who changed what)
- What the code already shows (patterns, architecture)
- What CLAUDE.md already says
- Ephemeral task state (use TodoWrite)
### Format
- MEMORY.md = index only, max 200 lines. Details in separate .md files
- Each .md file has frontmatter: name, description, type (feedback/project/user/reference)
- workstreams.json = source of truth for workstream aliases
- Use --brief for quick overviews, full output only when needed
### Session lifecycle
- Start of work → /session-start or /session-continue
- Ideas for later → /park (don't lose the thought)
- After big block of work → /reflect
- Before compact: save key decisions + update handoff
- Long session + topic changed → suggest /session-end
- End of work → /session-end (handoff for next session)Do NOT remove or rewrite existing content in MEMORY.md. Only add new blocks.
4c: Create workstreams.json
Scan existing files for patterns — group by frontmatter type or directory:
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory.js" --dir="$MEM_DIR" listAsk: "Based on these files, I see topics like {X, Y, Z}. Want me to create workstreams for them?"
4d: Add workstreams to MEMORY.md index
After creating workstreams.json, add a Workstreams section to MEMORY.md so they are visible in the index:
## Workstreams
- **{name}** — keywords: {keywords}This ensures agents see workstreams without running memory.js workstreams.
4d-bis: Profile section in MEMORY.md
If profile/user-role.md exists (or was just created), ensure MEMORY.md has a ## Profile section indexing it:
## Profile
- [User role](profile/user-role.md) — {one-line description from frontmatter}Place it right after the ## Rules block — profile is high-signal context, agent should see it early.
4d-ter: Profile interview for upgrade path
If path B (upgrade) and profile/user-role.md does NOT exist, run the same interview as Step 2A point 4. Skip if user declines.
4e: Create subdirectories and move files
Only if user agrees. For each .md file with frontmatter type:
type: feedback → feedback/
type: project → decisions/ or notes/ (by content)
type: user → profile/
type: reference → reference/After moving files — update paths in MEMORY.md index.
4f: Create memory-schema.json
If memory-schema.json is missing in $MEM_DIR:
if [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/lib/memory-schema.default.json" ]; then
cp "${CLAUDE_PLUGIN_ROOT}/scripts/lib/memory-schema.default.json" "$MEM_DIR/memory-schema.json"
echo "Created memory-schema.json (weighted eviction config)"
fiThis file controls section protection and eviction weights for memory.js reindex. Never overwrite if it already exists — user may have customized it.
4g: Verify
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory.js" --dir="$MEM_DIR" list
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory.js" --dir="$MEM_DIR" workstreamsStep 5: Summary
## Setup complete
Memory: $MEM_DIR
Files: {N} ({moved} organized into subdirectories)
Workstreams: {list}
MEMORY.md: updated ({added blocks})
Ready to use:
/session-start — begin a session
/memory search — search memory
/memory workstream <name> — load workstream contextStep 6: Mode selection (optional)
Explain the two modes and let the user choose. Default is Collaborative — no action required.
## Memory mode
memory-toolkit works alongside Claude Code's built-in auto-memory.
Two modes available:
1. Collaborative (default, already active)
CC auto-memory captures facts automatically.
memory-toolkit organizes them into workstreams, lifecycle, handoffs.
Both write to MEMORY.md — they complement each other.
2. Exclusive (opt-in)
Only memory-toolkit manages memory. No auto-writes from CC.
Full control over format. Requires manual discipline.
Add to settings.json: { "autoMemoryEnabled": false }
Your MEMORY.md is currently {N} lines (limit: 200).
{If >150: ⚠ Consider trimming — run /memory workstreams to see what's there.}
Stay in Collaborative mode? (press Enter to skip, or type "exclusive" to opt in)Only switch to Exclusive if user explicitly requests it. Warn: "Auto-memory will no longer write to MEMORY.md — memory-toolkit handles everything."
If user wants to trim — identify entries that can be removed (old, superseded, redundant) and propose which to cut. Move to memory-backup/ rather than deleting.
Rules
- Always backup MEMORY.md before modifying it
- Never overwrite or delete existing files
- Always show proposed changes before applying
- Preserve all existing MEMORY.md content
- If MEMORY.md is already >150 lines, warn about the 200-line limit and suggest trimming
- If user says "just do it" — apply all changes without individual confirmations
- If
--freshflag — skip detection, create everything from scratch
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

