run-tests

A command that runs Subcog's automated functional tests, which check whether its memory, search, knowledge-graph, prompt, template, and maintenance tools work as expected.

In plain words
What is it for?
Use it to run all tests or filter them by category or tag, preview the test list, show detailed output, or skip cleanup tests.
Why use it?
It replaces manually checking each tool and produces a record of passed and failed tests.

Command for Claude Code

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.

agentmods
npx agentmods add commands/zircote/subcog/run-tests
Clone the repo
git clone --depth 1 https://github.com/zircote/subcog

Made for: Claude Code.

Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,116 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00041 $0.01116
Opus 5 $0.00020 $0.00558
Sonnet 5 $0.00008 $0.00223
Haiku 4.5 $0.00004 $0.00112

Measured 2d ago against content hash 232a79440420, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

run-tests 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.

.claude/commands/run-tests.md · 120 lines

How it starts

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

/subcog:run-tests

Execute the automated Subcog functional test suite to validate all MCP tools.

Usage

/subcog:run-tests [options]

Options

  • --category <name> - Run only tests in specified category
  • --tag <tag> - Run only tests with specified tag
  • --skip-cleanup - Don't run cleanup tests at the end
  • --verbose - Show detailed output for each test
  • --dry-run - Show tests that would run without executing

Execution Strategy

  1. Read test definitions from tests/functional/tests.yaml
  2. Initialize test state in .claude/test-state.json
  3. Execute tests sequentially, tracking results
  4. Validate each test response against expected patterns
  5. Generate summary report

State Management:

  • State file tracks: current test, results, saved variables
  • Each test can save output values for dependent tests
  • Tests with depends_on wait for dependencies to pass

Workflow

  1. Initialize Test Environment

    • Read tests/functional/tests.yaml
    • Parse test definitions and resolve dependencies
    • Create .claude/test-state.json with initial state
    • Verify Subcog MCP server is available via subcog_status
  2. Execute Tests Sequentially For each test: a. Check dependencies are satisfied b. Substitute saved variables in action string c. Present the test action to execute d. Wait for execution e. Validate response against expect rules f. Record pass/fail and save any save_as values g. Continue to next test

  3. Report Results

    • Show pass/fail counts by category
    • List any failed tests with details
    • Provide cleanup status
    • Write report to tests/functional/report.md

Test Format Reference

Read the full file on GitHub · 120 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. 2d ago First seen · 120 lines · 41 tokens per session scan A 232a79440420

Subscribe to this mod's changes

run-tests is a command published in the GitHub repository zircote/subcog (28 stars, last pushed 29d ago), licensed MIT. It adds 41 tokens to every session and 1,116 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-30.