meta-memory-write
Skill0 starsChanged 45 days agoMITView on GitHub
Saves durable facts to context/MEMORY.md, the curated working scratchpad read at session start. Triggers on "remember this", "remember that", "note that", "save this to memory", "update memory", "log this", "forget about", "remove from memory". Three actions: add (append under the correct section after dedup check), replace (substring match + swap), remove (confirm with user first). Enforces a 2,500 character cap with consolidation when over. Does NOT trigger for daily session logging (handled by Returning Mode auto-tracking), learnings updates (handled by meta-wrap-up), or one-off in-conversation reminders.
- Reads credentials
In this repository96 other files it gives its agents.
- AGENTS.mdAGENTS.md
- team_context/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- fin-company-cfoSkill
- fin-invoice-reconciliationSkill
- fin-month-end-reportingSkill
- fin-personal-cfoSkill
- meta-find-skillsSkill
- meta-memory-recallSkill
- meta-skill-creatorSkill
- meta-skillifySkill
- meta-synthesize-localsSkill
- meta-toolifySkill
- meta-wrap-upSkill
- mkt-ab-testingSkill
- mkt-ad-creativeSkill
- mkt-adsSkill
- mkt-asoSkill
- mkt-brand-voiceSkill
- mkt-churn-preventionSkill
- mkt-cold-emailSkill
- mkt-co-marketingSkill
- mkt-community-marketingSkill
- mkt-content-repurposingSkill
- mkt-copy-editingSkill
- mkt-copywritingSkill
- mkt-croSkill
- mkt-directory-submissionsSkill
- mkt-emailsSkill
- mkt-eventsSkill
- mkt-free-toolsSkill
- mkt-icpSkill
- mkt-influencer-marketingSkill
- mkt-jab-hookSkill
- mkt-launchSkill
- mkt-lead-magnetsSkill
- mkt-marketing-loopsSkill
- mkt-offersSkill
- mkt-onboardingSkill
- mkt-paywallsSkill
- mkt-popupsSkill
- mkt-positioningSkill
- mkt-programmatic-seoSkill
- mkt-prospectingSkill
- mkt-public-relationsSkill
- mkt-referralsSkill
- mkt-sales-enablementSkill
- mkt-schemaSkill
- mkt-signupSkill
- mkt-smsSkill
- mkt-socialSkill
- mkt-ugc-scriptsSkill
- mkt-visual-identitySkill
- ops-analyticsSkill
- ops-attributionSkill
- ops-cronSkill
- ops-ingestSkill
- ops-loopifySkill
- ops-project-managementSkill
- ops-revopsSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 11 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
If the file doesn't exist, create it with the standard scaffold before writing.
- Distinctive: line 46
If ambiguous, ask before proceeding.
- Very specific: line 52
Read context/MEMORY.md in full.
- Distinctive: line 77
If the fact doesn't fit any of the three, ask the user where it belongs rather than creating a new section.
- Distinctive: line 98
If adding the new fact would push the file over 2,500 characters:
- Distinctive: line 102
Remove threads that are clearly resolved (look for "done", "shipped", "closed" markers)
- Very specific: line 105
If still over after consolidation, tell the user: "MEMORY.md is full.
- Very specific: line 117
Never store secret values — only reference names (e.g., FIRECRAWL_API_KEY in .env, not the key itself).
- Distinctive: line 123
After the write succeeds, reply with exactly:
- Very specific: line 129
If the action was remove, reply: Removed — will be active from next session.
- Very specific: line 131
If the dedup check caused a skip, reply: Already saved — no change needed.
- Very specific: line 139
Never exceed 2,500 characters in context/MEMORY.md.
- Distinctive: line 140
Always check for duplicates before adding, because the file is capped and repeats waste the budget.
- Distinctive: line 141
Prefer replace over add when updating an existing fact.
- Distinctive: line 142
Never quote secret values in MEMORY.md, because this file is committed and read into context every session.
- Distinctive: line 143
Always confirm with the user before remove — show the exact line being deleted.
- Distinctive: line 145
Do not create new sections beyond Active Threads / Environment Notes / Pending Decisions.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Memory Write
Saves durable facts to context/MEMORY.md — the curated working scratchpad that gets read at session start as a frozen snapshot.
Outcome
- A durable fact is added to, updated in, or removed from
context/MEMORY.md - Character cap (2,500) is enforced — consolidation happens before the cap is breached
- Confirmation message shown:
Saved — will be active from next session. context/MEMORY.mdexists with the three-section scaffold if it was missing
Context Needs
| File | Load level | How it shapes this skill |
context/MEMORY.md | Full | The file being written to — must be read before every action to dedup and check the cap |
If the file doesn't exist, create it with the standard scaffold before writing.
Step 1: Determine Action
Parse the user's request into one of three actions:
| User phrasing | Action |
| "remember this", "note that", "save this", "log this", "add to memory" | add |
| "update memory about X", "change the X entry", "X is now Y" | replace |
| "forget about X", "remove X from memory", "delete the X entry" | remove |
If ambiguous, ask before proceeding.
Step 2: Read MEMORY.md
Read context/MEMORY.md in full. If it doesn't exist, create it with this scaffold:
<!-- Cap: 2,500 chars. Curated working scratchpad. Maintained by meta-memory-write skill. Mid-session writes take effect on the next session (frozen snapshot pattern). -->
# Working Memory
## Active Threads
## Environment Notes
## Pending DecisionsStep 3: Pick Target Section
Decide which section the fact belongs in:
| Section | Use for |
## Active Threads | Current work, open questions, things to revisit |
## Environment Notes | URLs (staging, prod), tool versions, project structure, config file locations |
## Pending Decisions | Decisions waiting on input, options still under consideration |
If the fact doesn't fit any of the three, ask the user where it belongs rather than creating a new section. Sections are intentionally limited to keep the scratchpad focused.
Step 4: Dedup Check
Scan the file for substring matches against the new fact:
- Exact match exists → skip the write, tell the user the fact is already saved
- Similar entry exists → prefer replace over add, even if the user said "remember this"
- No match → proceed to cap check
Step 5: Cap Check
Compute current byte count of context/MEMORY.md.
- Bash:
wc -c < context/MEMORY.md - PowerShell:
(Get-Item context/MEMORY.md).Length
If adding the new fact would push the file over 2,500 characters:
- Consolidate existing entries:
- Merge similar lines under the same section
- Remove threads that are clearly resolved (look for "done", "shipped", "closed" markers)
- Tighten verbose entries into single-line facts
- Re-check the count
- If still over after consolidation, tell the user: "MEMORY.md is full. Which entry should I drop to make room for
{new fact}?"
Step 6: Write the Change
Apply the action using the Edit tool with precise old_string/new_string:
- add → insert under the target section heading. Use a bullet (
-) prefix. Keep to one line per fact. - replace → swap the matched substring with the new value.
- remove → first show the user the exact line and ask "Remove this?" Only delete after explicit confirmation.
Never store secret values — only reference names (e.g., FIRECRAWL_API_KEY in .env, not the key itself).
Step 7: Confirm
After the write succeeds, reply with exactly:
Saved — will be active from next session.If the action was remove, reply: Removed — will be active from next session.
If the dedup check caused a skip, reply: Already saved — no change needed.
Rules
Updated automatically when the user flags issues. Read before every run.
- Never exceed 2,500 characters in
context/MEMORY.md. Consolidate first; if that fails, ask the user what to drop. - Always check for duplicates before adding, because the file is capped and repeats waste the budget. Substring match across the whole file.
- Prefer replace over add when updating an existing fact.
- Never quote secret values in MEMORY.md, because this file is committed and read into context every session; reference env var names only.
- Always confirm with the user before remove — show the exact line being deleted.
- Mid-session writes persist to disk but only take effect on the next session. Tell the user this in the confirmation message so they understand why.
- Do not create new sections beyond Active Threads / Environment Notes / Pending Decisions. If a fact doesn't fit, ask the user where it belongs.
Self-Update
If the user flags an issue with how memory is written — wrong section, missed dedup, bad consolidation — update the ## Rules section in this SKILL.md immediately with the correction and today's date. Don't just log it to learnings; fix the skill so it doesn't repeat the mistake.
Graceful Degradation
- MEMORY.md missing → create with the standard scaffold, then write
- MEMORY.md corrupted or malformed → ask the user before doing anything destructive
- Ambiguous section target → ask the user; don't guess
- Bash
wc -cnot available (rare on Windows) → fall back to PowerShell length check
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.

