/infranodus-memory:optimize [learnings | <topic> | claude | claude-mem | mem0 | all]from infranodus-memory
Optimize the InfraNodus Graph Memory of the current project. Runs the InfraNodus optimize_knowledge_base graph analysis on the project's InfraNodus learnings and topic memory graphs, and also on other memories when present (Claude's own memory notes, claude-mem, mem0), finds the clusters that never connect and the under-developed areas, and proposes new statements that bridge those gaps, to save after the user approves. Use when the user asks to optimize, improve, review or find gaps in their memory or learnings.
Ships in infranodus-memory. 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.
When the user types this command, the plugin's hook puts a block starting with [infranodus-memory] into your context: the project name and, when an API key is set, the memory graphs and how many notes Claude's own memory has for this folder.
If no [infranodus-memory] block is in your context, the hook did not run. In Codex or Grok Build, which have no such hook, run python3 <plugin root>/codex/key.py optimize from the project folder (the plugin root is the folder two levels above this file) and use its output as the block.
Without a list of graphs in the block, call the InfraNodus list_graphs tool and take the memory graphs: learn-<project> for the project name from the block; without a block, the name of the git remote origin (the last part of its URL, without .git), else the name of the repository's folder, the memory-<topic> graphs and personal-…. Claude's own notes for this folder are in ~/.claude/projects/<the folder's absolute path with every character that is not a letter or digit replaced by a hyphen>/memory/.
This command works through the InfraNodus MCP tools, from whatever InfraNodus server or connector is connected (with several, the one for infranodus.com).
Find the memory sources. Possible sources:
list_graphs;search_memories MCP tool is available.If there is none, say there is no memory to optimize yet and stop. If the user named one in the command ($ARGUMENTS), use that. With one source, use it. With several, ask with the AskUserQuestion tool (multiSelect) which to optimize, one option per source with a few words on what it holds.
Analyze each chosen source on its own with the InfraNodus MCP tool optimize_knowledge_base, includeLatent: true, focus: "procedural" for project learnings and Claude's notes about how to work in a project, "general" otherwise. If the tool isn't available, say "Connect the InfraNodus connector (or add an API key in /plugin for automatic memory)." and stop.
graphName set to the graph.statements, without rewriting them or adding wikilinks, and without saveAs, so nothing is stored in InfraNodus.
MEMORY.md); one statement per note, its text without the frontmatter.search_memories with a few queries (the project name, then the main subjects the first results name), duplicates removed; one statement per memory.Read the result: the diagnosis (biased / focused / diversified / dispersed), what dominates, the under-developed areas, and above all the gaps: clusters that never connect.
Propose new statements that improve the structure, up to 8 per source, best first:
[[wikilinks]], because each wikilink becomes a node and the statement links them. One fact or relation per statement, under 300 characters, self-contained.question). For other memory, use only what the memories and this conversation support. Never invent a fact to fill a gap.Show them to the user as a numbered list per source: each statement, its type (for learnings), and in a few words which gap or area it addresses. Ask which to save, and for a source outside InfraNodus, where. Save nothing without the user's answer.
Save the approved ones:
add_project_learnings with the project name, statements, types, and confirm: true (the user already approved them).memory_add_relations with scope: "topic", topic, statements and confirm: true.memory_add_relations with scope: "personal", statements and confirm: true.MEMORY.md.save_memory), one call per statement.[[ ]] brackets.Then say in one line how many were saved where.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub infranodus/infranodus-memory-plugin --plugin infranodus-memory9 skills in this plugin
/dreamConsolidate the InfraNodus Graph Memory of the current project. Replays a batch of the project's saved learnings against the repo and the session transcripts they came from, then corrects the ones that are wrong, retires the outdated ones, merges the ones that say the same thing, asks the questions that connect its insight clusters and answers them from the repo, and promotes the few that every session should see. Changes are applied only after the user approves the plan. With `transcend` as the first word it also looks outward: a few unverified ideas that link the memory to concepts beyond it, kept apart from the learnings and out of recall. Use when the user asks to dream, consolidate, clean up, verify or prune their memory or learnings, or to expand it with ideas from outside. To only find gaps and add statements, use /infranodus-memory:optimize./forget-lastRemove the learnings InfraNodus memory saved from the last session in the current project. Run only when the user asks./offOther plugins' skills for the same job