Skip to content
Development
Command

/memory-optimize

Choose the cheapest context path across direct read, markdown conversion, graph build, graph update, or graph query.

From plugin
agent-powerups
654 skills46 agents54 commands
Install
$ npx -y skills add yeaight7/agent-powerups --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/memory-optimize

Context preview

What this command does when you run it.

Choose the cheapest context path across direct read, markdown conversion, graph build, graph update, or graph query.

Command definition

memory-optimize.md
name: memory-optimize
description: Choose the cheapest context path across direct read, markdown conversion, graph build, graph update, or graph query.
argument-hint: "[path-or-url] [question]"
allowed-tools:
  - Read
  - Bash
  - Glob
  - Grep

Objective

Recommend the cheapest memory workflow that preserves answer quality and future reuse.

Context

Inputs:

  • optional path or URL
  • optional question or task goal

Optimization targets:

  • lower token cost now
  • lower reread cost later
  • better persistence when repeated queries are likely

Process

1. Inspect input shape and reuse horizon:

  • plain text or small local file
  • noisy web page
  • PDF/Office doc or other hard-to-read binary-ish source
  • mixed corpus
  • existing graph with new question
  • existing graph with changed sources

2. Check requirements:

  • `apx check graphify`
  • `apx check markitdown-file-intake`
  • `apx check defuddle`

3. Recommend exactly one primary path:

  • direct read for small, simple, one-shot text
  • `defuddle` -> Markdown -> read or build when web chrome is the main problem
  • `markitdown-file-intake` -> Markdown -> read or build when document format is the main problem
  • `graphify` full build when repeated questions or relationship navigation justify persistent memory
  • `graphify --update` when a graph already exists and sources changed
  • graph query against existing graph when the graph exists and the task is retrieval, tracing, or explanation

4. State why that path is cheapest:

  • lower immediate token cost
  • lower repeated reread cost
  • better persistence across future sessions

5. Include exact next command(s) for the recommended path. 6. If a required tool for the best path is missing, either:

  • recommend the next-best lower-capability path that still preserves answer quality, or
  • stop and say the missing requirement makes the cheap path unavailable

Stop Conditions

  • input is too ambiguous to choose between direct read, helper conversion, build, update, or query
  • the recommended path depends on a missing tool and no credible fallback preserves answer quality
  • user asks for persistent graph advice but the target path or URL is unavailable

Rules

  • optimization target = lower token cost, lower reread cost, better persistence
  • `graphify` is long-lived memory path
  • helpers are normalization tools only
  • keep `graphify` primary for persistent memory, helpers secondary, Obsidian optional
  • do not recommend a graph build for trivial one-shot text when direct read is cheaper
  • do not claim a helper or graph path is available before requirement checks pass
  • do not claim bundled upstream code
Read more
Ships withagent-powerups

Curated power-ups for coding agents: skills, slash commands, MCP configs, hooks, AGENTS.md templates, and workflows for serious software engineering. Claude Code, Codex, Antigravity CLI, Cursor and more

Get the whole plugin, auto-invoked
Stats
6
Stars
0
Views
2
Forks
Active
Maintenance
TypeScript
Language
Apache-2.0
License
11d ago
Last commit
3mo ago
Created

Repo: yeaight7/agent-powerups