memory-orchestrator

memory-orchestrator is a skill for Claude Code, Codex from ApexIQ/skillsmith. It costs 53 tokens per session (874 once invoked), scanned A, original, MIT.

A memory-management workflow for AI agents that records actions, condenses useful facts, and restores relevant context across sessions.

In plain words
What is it for?
Use it to log agent activity, extract lessons and observations, recover context, and apply memory and cost rules.
Why use it?
It helps agents retain important project information without keeping every past interaction in their active context.

Skill for Claude CodeCodex

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

Good fit Use it to log agent activity, extract lessons and observations, recover context, and apply memory and cost rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/apexiq/skillsmith/memory_orchestrator
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 ApexIQ/skillsmith --skill memory_orchestrator
Clone the repo
git clone --depth 1 https://github.com/ApexIQ/skillsmith

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 memory-orchestrator

README.md
[![agentmods](https://agentmods.dev/badge/skills/apexiq/skillsmith/memory_orchestrator.svg)](https://agentmods.dev/skills/apexiq/skillsmith/memory_orchestrator)
Your own site
<a href="https://agentmods.dev/skills/apexiq/skillsmith/memory_orchestrator"><img src="https://agentmods.dev/badge/skills/apexiq/skillsmith/memory_orchestrator.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 874 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.00053 $0.00874
Opus 5 $0.00026 $0.00437
Sonnet 5 $0.00011 $0.00175
Haiku 4.5 $0.00005 $0.00087

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

Security

Grade A, and why

memory-orchestrator 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 8d 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.

.agent/skills/memory_orchestrator/SKILL.md · 81 lines

How it starts

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

🧠 Memory Orchestrator (O3-RS Pipeline)

Directive: "Library-First. Context-Lean. Multi-Layer Recovery."

The Five-Layer Reliability Pattern

To achieve 100% project recall at <50% token cost, implement these layers in strict sequence:

1. 👁️ Layer 1: Observer Capture (Raw Event Log)

Goal: Record all agent actions without interrupting reasoning.

  • Pattern: ObserverPattern or EventStore.
  • Implementation: Intercept all tool calls/outputs and prompt responses.
  • Storage: Append-only raw_events.jsonl in .agent/logs/.
  • Logic: Never summarize in real-time; storage is cheap, reasoning is expensive.

2. 🪞 Layer 2: Reflector Compaction (Cognitive Compression)

Goal: Distill facts from raw events.

  • Trigger: End of task or token_count > N.
  • Pattern: MapReduce for memories.
  • Implementation: Call a cheaper LLM (e.g., GPT-4o-mini) to extract Lessons (what to do next time) and Observations (what happened).
  • Storage: Structured lessons.md or observations.json.

3. 🏁 Layer 3: Session Recovery (Relevance Injection)

Goal: Hydrate the current session with only the "Best-of-Best" context.

  • Pattern: PersistentRetrievalAugmentedGeneration (P-RAG).
  • Implementation: Query the local index.json using BM25 or keywords from the current goal.
  • Constraint: Max 2-3 "Lessons" and top-5 "Recent Observations" per prompt.

4. ⚡ Layer 4: Reactive Watcher Refresh (Drift Guard)

Goal: Ensure memory is not hallucinating based on old code.

  • Pattern: Watcher + Fingerprinting.
  • Implementation: Link memory chunks to file paths + SHA-256 hashes.
  • Invalidation: If the file system changes, flag related memories as "Stale" or "Needs Re-reflection".

5. 🛡️ Layer 5: Pre-compaction Safeguard (Context Bound)

Goal: Prevent total context amnesia.

  • Pattern: BoundedBuffer or PriorityQueue.
  • Implementation: A simple token counter that forces a mandatory "Reflector" run when context reaches 80% to ensure critical info is persisted before it overflows.

Read the full file on GitHub · 81 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. 8d ago First seen · 81 lines · 53 tokens per session scan A bc724bb7e2ef

Subscribe to this mod's changes

memory-orchestrator is a skill published in the GitHub repository ApexIQ/skillsmith (5 stars, last pushed 5mo ago), licensed MIT. It adds 53 tokens to every session and 874 once invoked, about $0.0003 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-08-31.