experiment

An experiment designer and runner for testing how an AI agent behaves across sessions. It creates a harness configuration, runs the sessions, and analyzes the results; a harness is a controlled setup for repeatable tests.

In plain words
What is it for?
Use it to test memory reading and writing, tool use, delegation, hallucinations, or other agent behaviors across selected repositories and session types.
Why use it?
It removes the need to manually design session layouts, memory tests, prompts, and repetitions. It also helps compare isolated, chained, or forked conversations and measure variation.

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/dreadnode/agent-lens/experiment
Clone the repo
git clone --depth 1 https://github.com/dreadnode/agent-lens

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,097 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.00000 $0.03097
Opus 5 $0.00000 $0.01548
Sonnet 5 $0.00000 $0.00619
Haiku 4.5 $0.00000 $0.00310

Measured yesterday against content hash 84454e6d9d3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

experiment 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 yesterday.

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/experiment.md · 284 lines

How it starts

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

Experiment Config Generator

The user wants to create a harness experiment config to test a hypothesis about agent behavior. Your job is to design the experiment, write a config, run it, and analyze the results.

Instructions

  1. Understand the hypothesis. Ask clarifying questions if needed:

    • What behavior are they testing? (memory read/write, tool use patterns, subagent delegation, hallucination, etc.)
    • What directory should the agent work in? (can use ./repos/test_repo for simple tests)
    • How many sessions? What should each session probe?
    • Should sessions be isolated (no conversation history), chained (full conversation context), or forked (branching from a prior session)?
    • Do they need subagents?
    • Do they need replicates (count) to study variance?
  2. Design the experiment. Consider:

    • Session mode: Use isolated to test if the agent uses memory correctly across fresh conversations. Use chained to test multi-turn reasoning with full context. Use forked to compare different prompts from the same starting point.
    • Memory file: The harness auto-seeds MEMORY.md in the working directory. You can customize the filename (memory_file) and initial content (memory_seed). The absolute path is injected into the system prompt automatically.
    • System prompt: Set up the scenario. Tell the agent about MEMORY.md and any conventions.
    • Session prompts: Each session should test a specific aspect of the hypothesis. Be specific about what the agent should do.
    • Forking: Use fork_from on individual sessions to branch from any prior session, not just session 1.
    • Replicates: Use count: N on a session to run it N times as independent replicates. Useful for studying behavioral variance.
    • Subagents: Define if the hypothesis involves delegation behavior. Give each a name, description, prompt, and tool restrictions.
    • Turn limits: Use max_turns: 10-15 for focused tasks, 30+ for complex exploration.
    • Capture: Always set capture_api_requests: true to enable resampling and intervention testing later.
    • Tags: Always include "auto-generated" tag plus hypothesis-specific tags.
    • Hypothesis: Always include a one-sentence hypothesis field in the config.

Read the full file on GitHub · 284 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. yesterday First seen · 284 lines · 0 tokens per session scan A 84454e6d9d3c

Subscribe to this mod's changes

experiment is a command published in the GitHub repository dreadnode/agent-lens (114 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,097 tokens. 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.