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.
npx agentmods add skills/apexiq/skillsmith/memory_patternsnpx skills add ApexIQ/skillsmith --skill memory_patternsgit clone --depth 1 https://github.com/ApexIQ/skillsmithWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00032 | $0.00696 |
| Opus 5 | $0.00016 | $0.00348 |
| Sonnet 5 | $0.00006 | $0.00139 |
| Haiku 4.5 | $0.00003 | $0.00070 |
Grade A, and why
memory-patterns 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.
🧠 Memory Patterns
Philosophy: Agents are stateless by default. Good memory design makes them context-aware and consistent.
The Problem
LLMs have finite context windows and no built-in memory across sessions. Without proper patterns:
- Agents forget past decisions
- Context overflow causes quality degradation
- Token costs increase unnecessarily
Memory Types
| Type | Description | Implementation |
|---|---|---|
| Short-term | Current conversation context | Prompt + recent messages |
| Long-term | Persistent across sessions | Files, databases, vector stores |
| Episodic | Specific past experiences | Indexed conversation logs |
| Semantic | Facts and knowledge | RAG with embeddings |
Patterns
1. Structured Note-Taking (CLAUDE.md / AGENTS.md)
Store important context in project files:
# CLAUDE.md
## Key Decisions
- Using SQLModel for ORM (decided 2024-01-15)
- API versioning via URL path (/v1/, /v2/)
## Gotchas
- `email_id` is string (Gmail format), not integer
When to use: Project-specific knowledge, conventions, past decisions.
2. Context Compaction
Summarize long conversations to preserve tokens:
Original: [3000 tokens of back-and-forth]
Compacted: "User requested auth system. Decided on JWT + refresh tokens.
Implemented /login and /refresh endpoints. Tests passing."
When to use: Long-running tasks, before context window fills.
3. Hierarchical Memory (Sub-agent Pattern)
Delegate tasks to sub-agents with focused context:
Main Agent (high-level context)
├── Code Agent (code-only context)
├── Test Agent (test files context)
└── Doc Agent (documentation context)
When to use: Large codebases, parallel tasks, complex workflows.
4. File System as Memory
Use files to persist information beyond context:
.agents/
├── decisions/ # ADRs and key decisions
├── notes/ # Temporary working notes
└── context/ # Current task context
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.
- 2d ago First seen · 108 lines · 32 tokens per session scan A 53d3adaa004d
memory-patterns is a skill published in the GitHub repository ApexIQ/skillsmith (5 stars, last pushed 5mo ago), licensed MIT. It adds 32 tokens to every session and 696 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-08-31.
Other skills, from other repositories
Apple Notes
Open Notes.app and create or update iCloud notes on macOS using memo when possible and AppleScript when direct app automation is more reliable.
agent-release-manager
Agent skill for release-manager - invoke with $agent-release-manager.
agent-release-swarm
Agent skill for release-swarm - invoke with $agent-release-swarm.
agent-pagerank-analyzer
Agent skill for pagerank-analyzer - invoke with $agent-pagerank-analyzer.
agent-collective-intelligence-coordinator
Agent skill for collective-intelligence-coordinator - invoke with $agent-collective-intelligence-coordinator.
agent-neural-network
Agent skill for neural-network - invoke with $agent-neural-network.