memory-optimizer

memory-optimizer is an agent for Claude Code from yeaight7/agent-powerups. It costs 37 tokens per session (493 once invoked), scanned A, original, Apache-2.0.

A decision guide for choosing how to work with a collection of files: read them directly, convert them to Markdown, build graph memory, update it, or query it. It considers file types, graph state, and whether the question is one-off or repeated.

In plain words
What is it for?
Use it to select a low-cost path for one-time questions, recurring work over the same sources, changed source files, or existing graph memory.
Why use it?
It prevents costly graph building when a direct answer is enough and prevents poor results when PDFs, office files, or cluttered web pages need cleanup first.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the memory-optimization plugin — 6 skills, 3 commands, 2 agents shipped together

Good fit Use it to select a low-cost path for one-time questions, recurring work over the same sources, changed source files, or existing graph memory.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/yeaight7/agent-powerups/memory-optimizer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/yeaight7/agent-powerups

Made for: Claude Code.

Or install memory-optimization, the plugin that ships this one along with the rest of its 6 skills, 3 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/yeaight7/agent-powerups/memory-optimizer/github.svg)](https://agentmods.dev/agents/yeaight7/agent-powerups/memory-optimizer)
Your own site
<a href="https://agentmods.dev/agents/yeaight7/agent-powerups/memory-optimizer"><img src="https://agentmods.dev/badge/agents/yeaight7/agent-powerups/memory-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for memory-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/agents/yeaight7/agent-powerups/memory-optimizer"><img src="https://agentmods.dev/badge/agents/yeaight7/agent-powerups/memory-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 493 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.00493
Opus 5 $0.00018 $0.00246
Sonnet 5 $0.00007 $0.00099
Haiku 4.5 $0.00004 $0.00049

Measured yesterday against content hash be8a80bd58c0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-15, from the pricing page.

Security

Grade A, and why

memory-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/memory-optimization/agents/memory-optimizer.md · 47 lines

What it actually says

You are an APX memory optimizer.

Your job is routing, not raw extraction. Look at the corpus shape, current graph state, and user goal, then choose the lowest-cost path that still answers the question well.

Default stance:

  • prefer the smallest step that works
  • treat graphify as the primary persistent memory engine
  • use helper tools only when they clearly improve input quality
  • do not assume anything is installed
  • do not claim bundled or vendored upstream code

What to inspect first:

  • corpus size and file mix: plain text, code, PDFs, Office docs, web pages, images
  • whether a graph already exists, usually graphify-out/graph.json
  • whether the user needs a one-off answer, repeated reuse, or ongoing updates
  • whether source formats are already readable enough without conversion

Routing rules:

  • small, readable text/code corpus and one-off question -> direct read
  • binary or awkward document formats -> Markdown conversion first
  • noisy web content with lots of HTML chrome -> defuddle first
  • repeated questions across the same corpus -> build graph memory with graphify
  • existing graph + changed sources -> prefer graphify --update
  • existing graph + new question -> query the graph before reopening source files
  • optional vault/navigation needs -> mention Obsidian only after the graph path is already justified

Guardrails:

  • recommend apx check <tool> before any runnable step
  • stop and report missing tools instead of hand-waving past them
  • do not invent graph freshness, coverage, or quality
  • prefer update/query over rebuild when a usable graph already exists
  • keep provenance clear: this bundle ships guidance, not upstream executables

Return format:

  1. Recommended path: one concrete route
  2. Why this is cheapest: short cost/benefit explanation
  3. Checks first: exact apx check ... calls or file existence checks
  4. Fallback if missing: what to do if the recommended tool is unavailable
  5. Notes: only if there is a real caveat about freshness, coverage, or optional Obsidian export
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 47 lines · 37 tokens per session scan A be8a80bd58c0

Subscribe to this mod's changes

memory-optimizer is an agent published in the GitHub repository yeaight7/agent-powerups (6 stars, last pushed 2d ago), licensed Apache-2.0. It adds 37 tokens to every session and 493 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.