/rootnode-projects:memory-optimizationfrom root.node Projects
Rebalances context across Memory, Custom Instructions, knowledge files, and User Preferences in Claude Projects. Audits for redundancy, staleness, and misplacement, then prescribes optimizations including codification of stable patterns.
Ships in root.node Projects. 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.
Read when SKILL.md points to them.
Calibration: Tier 2 (Sonnet-graceful) — designed against Opus 5.5 + Sonnet 5.5 dual-primary. Runs on Haiku 5.5 at
higheffort with less depth on multi-dimensional analysis; fallback-graceful on Opus 5 / Sonnet 5; legacy-graceful on Sonnet 4.6. Start at the model's default effort (mediumon Opus 5.5 and Sonnet 5.5 in Claude Code;highfor Sonnet 5.5 on the Claude API) and re-run an effort sweep on your own evals rather than carrying a setting over. On Fable 5.2 the default ishigh; step down tomediumwhere the work holds. See repository README for model compatibility.
Rebalances context across Memory, Custom Instructions, knowledge files, and User Preferences in Claude Projects. Produces Memory edit prescriptions, knowledge file trimming recommendations, codification prescriptions for promoting stable patterns to explicit instructions, and cross-layer alignment findings.
Never execute Memory edits without presenting the full prescription and receiving explicit user confirmation. Memory is persistent and personal — this skill recommends, the user decides.
Confirmation protocol (every engagement):
memory_user_editsmemory_user_edits view) as verification after executionIf the user says "just do it" or "go ahead with everything" — that IS confirmation. Execute. The gate ensures the user has seen the prescription, not to add friction.
If the user wants partial execution — execute only the approved edits. Note which recommendations remain unexecuted.
When producing any updated file — Custom Instructions, knowledge files, or any other deliverable — always output the complete file as a single, separately copyable unit. Never output diffs, patches, or partial sections that require manual splicing. The user replaces the old file by copying the complete output.
A defensible prescription shows its grounding. Observe the specific Memory entries, content types, redundancies, and staleness markers; name the placement pattern or principle they match against (Memory vs. Custom Instructions vs. knowledge file vs. User Preferences); then apply the rebalancing prescription. A compressed summary recommendation is harder for the user to interrogate and easier to misroute — the explicit walk-through is what makes Stage 4 confirmation meaningful. The user-confirmation gate above stays load-bearing regardless.
If the optimization scope is unclear (Memory-only? full context-layer rebalance? Codification-focused?), confirm scope with the user before proceeding. Do not proceed on inferred assumptions.
Optimal Project performance requires the right fact in the right layer:
| Layer | Purpose | What Belongs Here |
|---|---|---|
| User Preferences | Always-loaded universal foundation | Behavioral rules that improve every conversation everywhere — communication style, evidence standards, working style. Must pass the Universality Test. |
| Memory | Always-loaded orientation | High-frequency facts every conversation needs: current phase, active constraints, key decisions, identity facts |
| Custom Instructions | Always-loaded behavioral architecture | Identity, behavioral rules, output standards, knowledge file routing, mode definitions — project-specific |
| Knowledge files | Searchable reference depth | Structured content, detailed procedures, historical records, checklists, extended examples |
| Conversation | Per-message working context | Task-specific input, iterative refinement, session state |
Misalignment in any direction — orientation buried in a knowledge file, reference material crammed into Memory, behavioral rules in a knowledge file, universal preferences locked inside a single Project's CI — degrades performance. Memory optimization is not a standalone operation; it cascades. When Memory is optimized, knowledge files can be trimmed. When knowledge files are trimmed, context budget is freed. When context budget is freed, Claude has more room for the actual conversation.
Use when:
Do NOT use when:
Produce a Memory-and-context-layer prescription that is grounded in this project's actual mission (so it improves outcomes, not just appearances), evidence-cited (so the user can audit it), correctly layered (right fact, right layer, no duplication), and confirmation-gated before any Memory edit executes. The method that reliably gets there: comprehend the project, audit each layer, prescribe specific actions, deliver with explicit confirmation. The user-confirmation rule (above) and complete-file-output rule (above) are hard gates inside the pipeline.
Understand the project holistically before touching any layer. This prevents rote optimization — the skill must know what the project is trying to accomplish before it can judge what every conversation needs.
Assess:
Information sources:
memory_user_edits view): user-curated factsDo not interrogate. Assess what's available, request only the highest-leverage missing piece, and state what you're assuming about the rest. If the user is in the project being optimized, start immediately with what's accessible.
Map what's in each layer. Identify redundancies, gaps, and misalignments.
Evaluate current Memory edits against six criteria. See references/assessment-rubric.md for expanded anchoring examples, common failure patterns, the layer placement decision tree, and the Codification Assessment guide.
| Criterion | What to Check |
|---|---|
| Orientation Coverage | Does Memory cover the facts every conversation needs? Current phase, active constraints, key decisions, identity facts. |
| Redundancy | Is the same information in both manual edits AND auto-populated memories? Or duplicated across Memory and knowledge files? |
| Staleness | Are any Memory edits outdated — completed phases, old decisions, resolved constraints? |
| Layer Misplacement | Are any Memory edits carrying content that belongs in a knowledge file (reference depth) or Custom Instructions (behavioral rules)? |
| Slot Efficiency | Of 30 available slots, how many are used? Are remaining slots allocated to the highest-leverage facts? |
| Codification Candidates | Are any Memory entries carrying stabilized behavioral patterns — preferences, corrections, or working style observations — that should be codified as explicit instructions in User Preferences (if universal) or Custom Instructions (if project-specific)? |
Rate each criterion Pass / Partial / Fail with specific evidence. Do not score without citing the specific Memory edit or gap.
This is NOT a full CI audit. Focus narrowly on:
Primary target: Institutional memory files (build_context.md or equivalent) that carry project history, state tracking, and orientation content. These are the files most affected by Memory's existence because they often carry always-loaded content that Memory handles better.
For each institutional memory file, assess:
For other knowledge files, assess at a lighter level:
See references/optimization-patterns.md for trimming patterns and cross-layer alignment patterns with before/after examples.
Cautions and instructions pile up across Memory, Custom Instructions and knowledge files, and the model may have written some of them itself. Current models keep following them after their reason is gone, and treat an instruction that contains "never" as absolute [Anthropic docs — Prompting Claude Fable 5.2, "Keep caution from piling up", fetched 2026-11-24]. For each caution, restriction, or never/always rule in any layer, check:
Fix: removal, or a scoped rewrite with its reason ("ask before deleting files, because the archive has no backup" rather than "never delete files"). Propose each one in Stage 3 with the line quoted and its layer named; never apply it silently — Memory edits follow the confirmation rule above. Report how many cautions were checked and how many were stale. For the behavioral side of this pattern, see tendency #16 in behavioral-tuning if available.
Produce specific, actionable recommendations grounded in Stage 1's project understanding and Stage 2's audit findings. Every recommendation cites specific content — a specific Memory edit, a specific CI paragraph, a specific knowledge file section.
For each recommendation, provide:
Organize into three categories:
Include a net slot count: "After these changes: X of 30 slots used, Y slots remaining."
Memory constraint awareness: 30 edits × 500 characters = 15,000 characters maximum. Optimize for the highest-leverage entries within this budget. Note remaining slot capacity and whether the project has room for growth.
Never recommend atomizing structured knowledge file content into flat Memory entries. Content like checklists, phase histories with decision rationale, and cross-referencing architectural decisions belongs in knowledge files. Memory gets the index; knowledge files keep the archive.
For each institutional memory file:
If the trimming is substantial enough to warrant producing an updated file, offer to produce it. If the user accepts, output the complete updated file — never a diff or partial section.
See references/optimization-patterns.md for the five trimming patterns.
For any content found in the wrong layer:
If alignment recommendations include Custom Instructions changes and the user requests the updated CI, output the complete Custom Instructions as a single, separately copyable unit.
The Codification pathway converts stabilized automatic patterns (in Memory) into deliberate explicit instructions (in User Preferences or CI). This is the evolutionary upgrade from "Claude learned this from my behavior" to "Claude does this because I explicitly told it to."
When to apply: When Stage 2a identifies Memory entries that express behavioral preferences, corrections, or working style observations — as opposed to factual context about the project's state.
The Stability Test: For each behavioral Memory entry, apply both components:
If both pass, the entry is a codification candidate.
Destination determination:
For each codification recommendation, provide:
Important: Codification does not always mean removing the Memory entry. The Memory entry records a fact ("user prefers direct answers"). The codified instruction is a directive ("Lead with the answer. Provide supporting context after, not before."). Both can coexist if the Memory entry also serves an orientation purpose. Recommend removing the Memory entry only if its content is fully captured by the new instruction and retaining it adds no orientation value.
When User Preferences is the destination: Output the specific instruction to add to Preferences. If the user's current Preferences text was provided, note where the new instruction fits relative to existing Preferences content. Do not output the full optimized Preferences text — that is global-audit's scope. This Skill identifies individual codification candidates from Memory, not comprehensive Preferences optimization.
memory_user_edits viewSkill produces mechanical recommendations without strategic grounding: Stage 1 was skipped or rushed. Go back and assess the project's mission, phase, and task profile before auditing layers. Two projects with identical Memory content should get different recommendations if their missions differ.
Recommendations are vague ("improve your Memory"): Every recommendation must cite specific content. "Your Memory doesn't cover active constraints" is incomplete. "Your Memory doesn't include the 28-file ceiling constraint that affects every architectural discussion in this project" is grounded.
Knowledge file trimming removes too much: The skill should never recommend removing structured, interconnected content (decision rationale chains, checklists with cross-references). If the recommendation is to remove a section, verify it's genuinely redundant with Memory or CI — not just thematically similar.
User reports no improvement after optimization: If Memory and knowledge file optimization doesn't resolve context pressure, the issue may be structural — conflicting instructions, missing identity, or anti-patterns. Recommend project-audit for comprehensive evaluation if available. If the issue is specific Claude behavioral tendencies (verbosity, hedging, list overuse), recommend behavioral-tuning if available.
User is not in the project being optimized:
The skill works best when run inside the target project (direct access to Memory, CI, and knowledge files). If the user is working from a different context, request the Custom Instructions and key knowledge files. Use memory_user_edits view to access the user's Memory edits (these are user-level, not project-level, so they're accessible from any conversation).
Codification recommendations seem aggressive — too many Memory entries being promoted: Not every behavioral observation in Memory should be codified. Apply the Stability Test strictly — both persistence AND intentionality must pass. One-time corrections, context-specific preferences, and temporary working patterns fail the intentionality test. The default should be to keep entries in Memory unless both test components clearly pass.
User asks "should this go in Preferences or CI?" for a specific pattern: Apply the Universality Test. If the pattern would improve output in every conversation and Project without degrading any of them → Preferences. If it would help some contexts but be irrelevant or harmful in others → CI for the relevant Project(s). If uncertain, default to CI (more conservative — can always promote later, harder to demote cleanly).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub drayline/rootnode-skills --plugin rootnode-projects7 skills in this plugin
/anti-pattern-detectionDetects seven structural anti-patterns in Claude Projects that cause unpredictable output, ignored instructions, and degraded quality. Diagnoses Monolith, Orphan File, Echo Chamber, Phantom Conversation, Kitchen Sink, Misaligned Hierarchy, and Blurred Layers. Use when user says "what's wrong with my project," "Claude ignores my instructions," "diagnose my project," "why is output inconsistent," "review my project setup." Also trigger on symptom-phrased: "Claude doesn't follow my rules," "my instructions keep getting overridden," "my Project isn't behaving as designed." Use alongside project-audit if available for deeper structural analysis. Activate whenever the user describes symptoms of unreliable, inconsistent, or degraded Claude Project output, even if they do not name a specific pattern. Do NOT use when the user's primary request is Memory-layer rebalancing (use memory-optimization if available) or scoring a single prompt (use prompt-validation if available)./context-budgetAnalyzes Claude Project context budget under the automatic-RAG-by-window model: knowledge files vs. threshold-exempt overhead (Skills, MCPs, CI, Memory). Two modes: Quick Diagnostic and Full Budget Audit. Use when user says "check my context budget," "how much context am I using," "is my project too big," "optimize my token usage," "tier my files," "optimize for RAG," "improve retrieval quality," "should I keep compressing," "am I over-compressing," "should I accept RAG mode." Also trigger on context pressure symptoms: "Claude forgets my instructions," "responses getting generic," "content not found in my knowledge files." Also use when a project audit scores Knowledge Architecture ≤ 3. Do NOT use for content placement decisions (use memory-optimization if available), full project audits (use project-audit if available), or behavioral tuning (use behavioral-tuning if available). Run on Opus 5.5 (`medium`+) or Sonnet 5.5 (`high`); depth reduces on legacy models./full-stack-auditComprehensive audit of a user's entire Claude environment — combines Project audit (six-dimension Project Scorecard, seven anti-patterns) with Global audit (six-dimension Global Layer Scorecard) plus Cross-Layer Alignment Check across all nine layers and Evolutionary Recommendations across four pathways. Produces a unified action plan. Use when user says "full audit of everything," "audit my entire Claude setup," "full stack audit," "comprehensive review of my project and preferences," "check everything," or wants the complete health check of both a specific Project AND their global configuration. Also use when a project audit reveals cross-layer issues that require full-stack visibility. Do NOT use for auditing only a Project (use project-audit if available) or only global layers (use global-audit if available). Do NOT use for single prompt evaluation (use prompt-validation if available). Run on Opus 5.5 (`medium`+) or Sonnet 5.5 (`high`); depth reduces on legacy models./global-auditAudits and optimizes the five global Claude layers (User Preferences, Styles, Global Memory, Skills, MCP Connectors) using the Global Layer Scorecard (six dimensions, anchored 1-5 rubrics). Detects eight cross-layer failure modes and produces evolutionary recommendations (Promotion, Demotion, Codification, Skill Extraction). Use when user says "audit my global setup," "optimize my preferences," "review my Claude configuration," "check my cross-project setup," "are my preferences working," "clean up my global memory," or "what should be in my preferences vs my project." Also use when a user has 3+ Projects and wants to improve their shared foundation. Do NOT use for single-Project audits, Project Memory optimization, or full-stack audits (use project-audit, memory-optimization, or full-stack-audit respectively, if available). Run on Opus 5.5 (`medium`+) or Sonnet 5.5 (`high`); depth reduces on legacy models./project-auditAudits and scores Claude Projects using a six-dimension Scorecard with anchored 1-5 rubrics and detects seven structural anti-patterns. When global layer info is provided, adds cross-layer alignment findings. Use when user says "audit my project," "review my custom instructions," "score my project," "evaluate my Claude project," "improve my system prompt," "what's wrong with my project," "why is my project underperforming." Also trigger on symptom-phrased: "my project doesn't work right," "Claude is inconsistent in my project," "my Project used to work and now doesn't." Also use when the user pastes Custom Instructions asking why output is poor or generic. Do NOT use when the user's primary request is a global-layer audit (use global-audit if available), single-prompt evaluation (use prompt-validation if available), or Memory-only optimization (use memory-optimization if available). Run on Opus 5.5 (`medium`+) or Sonnet 5.5 (`high`); depth reduces on legacy models./project-briefGenerates a structured Project Brief — a comprehensive markdown document that extracts goals, architecture, knowledge file inventory, Custom Instructions summary, Memory contents, current state, ecosystem position, and key decisions from a Claude Project. Briefs serve as uploadable context documents: add one to any other Project for immediate deep awareness of the source Project's purpose, architecture, and progress. Use when user says "create a brief," "brief this project," "extract project context," "generate a project summary for another project," "I need to share this project's context," "prepare this project for cross-project reference," or "document this project." Also use when the user is preparing to work across Projects and needs portable context. Do NOT use for session handoffs, project audits, or Memory optimization (use session-handoff, project-audit, or memory-optimization respectively, if available).Other plugins' skills for the same job