memoized-command-source-aggregation

memoized-command-source-aggregation is a skill for Claude Code, Codex from ychampion/cskill-agents. It costs 31 tokens per session (489 once invoked), scanned A, original, MIT.

A cached command-registry loader that gathers independent command sources together and merges them in a fixed order.

In plain words
What is it for?
It helps command-line tools and agent systems discover commands efficiently for each working directory.
Why use it?
It reduces repeated lookup work and avoids unpredictable results caused by sources finishing in different orders.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps command-line tools and agent systems discover commands efficiently for each working directory.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ychampion/cskill-agents/memoized-command-source-aggregation
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.

Any agent
npx skills add ychampion/cskill-agents --skill memoized-command-source-aggregation
Clone the repo
git clone --depth 1 https://github.com/ychampion/cskill-agents

Made for: Claude Code, Codex.

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 memoized-command-source-aggregation

README.md
[![agentmods](https://agentmods.dev/badge/skills/ychampion/cskill-agents/memoized-command-source-aggregation.svg)](https://agentmods.dev/skills/ychampion/cskill-agents/memoized-command-source-aggregation)
Your own site
<a href="https://agentmods.dev/skills/ychampion/cskill-agents/memoized-command-source-aggregation"><img src="https://agentmods.dev/badge/skills/ychampion/cskill-agents/memoized-command-source-aggregation.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 489 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.00031 $0.00489
Opus 5 $0.00015 $0.00244
Sonnet 5 $0.00006 $0.00098
Haiku 4.5 $0.00003 $0.00049

Measured 4d ago against content hash 272b7265447b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

memoized-command-source-aggregation 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 4d ago.

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.

agents/claude-code/skills/memoized-command-source-aggregation/SKILL.md · 29 lines

How it starts

The opening of the file, as written. The whole thing — 29 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SKILL: Memoized Command Source Aggregation

Domain: command-architecture Trigger: Use when a command or skill registry must combine several expensive sources, but repeated lookups from the same workspace should reuse one stable merged result. Source Pattern: Distilled from reviewed command-surface, skill-discovery, and CLI capability implementations.

Core Method

Wrap the expensive registry assembly behind a memoized async function keyed by the scope that changes the result, such as cwd. Inside that loader, start every independent source fetch at once with promise all so disk scans, plugin discovery, and optional workflow imports overlap instead of serializing. After all sources resolve, merge them in one explicit precedence order rather than in completion order. This keeps first-load latency down while making every later lookup for the same scope a cheap cache hit with deterministic command ordering.

Key Rules

  • Memoize the fully merged registry by the narrowest scope key that actually changes the command surface, such as project root or cwd.
  • Use promise all only for independent sources; keep source-local fallback or error handling inside each loader so one slow or broken branch does not dictate the aggregation structure.
  • Build the final array in a hard-coded precedence order after all promises resolve; never let race timing decide which source comes first.
  • Keep synchronous sources and built-ins in the same final merge so cached callers receive the complete command surface from one lookup.

Example Application

If an agentic IDE must expose commands from local extensions, workspace automations, and remote plugins, create a memoized load all commands workspace root function that fans out those three loaders in parallel, then returns them in the product's chosen precedence order followed by built-ins. Every later command palette lookup for that workspace can reuse the cached merged list instead of rescanning the filesystem and plugin graph.

Read the full file on GitHub · 29 lines

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. 4d ago First seen · 29 lines · 31 tokens per session scan A 272b7265447b

Subscribe to this mod's changes

memoized-command-source-aggregation is a skill published in the GitHub repository ychampion/cskill-agents (36 stars, last pushed 5mo ago), licensed MIT. It adds 31 tokens to every session and 489 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-03.

Related

Other skills, from other repositories

outcome-run

Run one action in an outcome-loop folder. Use when the user wants to execute the outcome loop, start with Superdense reward maintenance, choose one action on a lever, create runs/ /work.md and learnings.md, or use prior outcomes to improve a real-world metric.

Nimrobo/superdense · 62 tokens

context-efficient-coding

Use ContextFlux to minimize coding-agent context and tool calls when exploring, planning, debugging, reviewing, or modifying an unfamiliar or multi-file repository. Trigger for codebase discovery, symbol search, architecture questions, cross-file changes, error tracing, review feedback, test discovery, or any request…

divyanshu-iitian/ContextFlux · 72 tokens

grape

Use Grape MCP for Codex context continuity in coding repositories. Use when a task needs repeated-turn context, omitted context restore, stale-context checks, invalidation checks, or safe continuity across branch and dirty-worktree changes.

gael55x/Grape · 48 tokens

dream

Batch-execute SHIP-ready wishes overnight — pick wishes, orchestrate workers, review PRs, wake up to results.

automagik-dev/genie · 27 tokens

fix

Dispatch fix subagent for FIX-FIRST gaps from review, re-review, then diagnose unresolved failures after 2 loops.

automagik-dev/genie · 25 tokens

static

Stash is your personal home for agent work. Everything you create is scoped to your account — it is yours alone, with nothing to pick or set up first. Your Stash has three primary surfaces.

Fergana-Labs/stash · 0 tokens