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 commands/marcosd4h/deepextractruntime/memory-scangit clone --depth 1 https://github.com/marcosd4h/DeepExtractRuntimeWhat 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.00000 | $0.04350 |
| Opus 5 | $0.00000 | $0.02175 |
| Sonnet 5 | $0.00000 | $0.00870 |
| Haiku 4.5 | $0.00000 | $0.00435 |
Grade A, and why
memory-scan 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.
This is a copy
86% identical to ai-logical-bug-scan — 123 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 423 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Memory Scan
Overview
AI-driven scan for memory corruption vulnerabilities: buffer overflows, integer overflow/truncation, use-after-free, double-free, and type confusion. Uses LLM agents that navigate cross-module callgraphs, read decompiled code on demand, and verify findings against assembly ground truth.
Usage:
/memory-scan <module>-- scan top entry points for the module/memory-scan <module> <function>-- scan from a specific function/memory-scan <module> <function> --depth 3-- limit callgraph depth
IMPORTANT: Execution Model
This command executes immediately. Run the full pipeline and deliver the completed report without pausing for confirmation. Use the workspace handoff pattern for all phases.
Status Messaging (MANDATORY)
Keep the user informed at every phase boundary. Output a plain-text status message before each phase starts and after it completes. Messages are 1-2 lines summarizing what is happening and what the phase produced. Do NOT suppress status messages to "save time."
Execution Context
IMPORTANT: Script invocations like
python .claude/skills/.../script.pyrun from the workspace root. The scripts manage their own path setup.
Step 0: Preflight Validation
from helpers.command_validation import validate_command_args
result = validate_command_args("memory-scan", {
"module": "<user_module>",
"function": "<user_function_or_None>",
})
if not result.ok:
# report errors and stop
db_path = result.resolved["db_path"]
Workspace Protocol
Create .claude/workspace/<module>_memscan_<function_or_all>_<timestamp>/ and
pass --workspace-dir and --workspace-step to all skill scripts.
Steps
Subagent Compliance Checklist (MANDATORY)
Before proceeding past each phase, verify the following. Violations invalidate the scan.
- Phase 2 (Triage): Launched a
security-auditorsubagent via the Task tool. Did NOT write triage/results.json from coordinator context. - Phase 3 (Deep Analysis): Launched the
memory-corruption-scannersubagent via the Task tool. Did NOT perform adversarial analysis inline. - Phase 4 (Skeptic): For EACH finding, launched a SEPARATE subagent via the Task tool with fresh context. Did NOT verify findings in the same context that discovered them.
- Every finding includes
verification_subgraphwith nodes, edges, must_read, and db_path.
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 · 423 lines · 0 tokens per session scan A cb7f54a62974
memory-scan is a command published in the GitHub repository marcosd4h/DeepExtractRuntime (20 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,350 tokens. A static security scan graded it A with 0 findings. It is 86% identical to ai-logical-bug-scan, differing in 123 lines, and is treated as a copy.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
constitution
Create or update the project constitution from interactive or provided principle inputs.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.