Test changes to your agent instructions before you trust them.
Behavior Diff shows whether a change to CLAUDE.md, AGENTS.md, or a skill
changes what an agent does. It runs the same task with and without your change,
then gives you a before-and-after report.
A rule can sound clear and still change nothing. It can also fix one case but cause a new problem somewhere else. Behavior Diff lets you review evidence before you commit the rule.
Agent instruction files shape decisions, tool use, and final answers. Text review can show whether a rule sounds clear. It cannot show what the agent will do.
Behavior Diff runs the change as a controlled experiment. You see whether the rule changes the process or result before you share it.
- Whether the agent reached the situation that the rule targets.
- Where the before and after runs took different paths.
- Which commands, tools, and evidence each run used.
- Whether the final answers changed.
- Whether the change was consistent across repeated runs.
Behavior Diff does not label a rule as good or bad. You compare the evidence with the behavior that you want.
Use Behavior Diff when you:
- Add a rule after an agent made the wrong choice.
- Change a shared
CLAUDE.mdorAGENTS.mdfile. - Edit a skill trigger or workflow instruction.
- Remove or simplify a rule and want to find regressions.
- Want evidence before your team adopts an instruction change.
Behavior Diff installs as a plugin on Claude Code and Codex. The commands below install the public marketplace release.
Pi and OMP are trial stacks, not plugin hosts in this change. Run their headless trials from a Behavior Diff source checkout and pass an exact model.
| Surface | Claude Code | Codex | Pi | OMP |
|---|---|---|---|---|
| Marketplace plugin install | Yes | Yes | No | No |
| Headless trial stack | Yes | Yes | Yes, with --model |
Yes, with --model |
| Live trial dispatch | Parallel subagents | Fresh sequential contexts or headless | No built-in dispatch. Use headless. | One parallel task batch |
claude plugin marketplace add spacedock-dev/marketplace
claude plugin install behavior-diff@spacedockRestart Claude Code after installation.
codex plugin marketplace add spacedock-dev/marketplace
codex plugin add behavior-diff@spacedockEnable hooks in ~/.codex/config.toml:
[features]
hooks = trueStart one interactive Codex session after installation. Approve each Behavior
Diff hook when Codex asks. Codex does not ask for hook approval during
codex exec.
Codex uses a cached copy of each plugin. Run the install command again after a Behavior Diff update:
codex plugin add behavior-diff@spacedock- Edit one instruction file. Keep the change uncommitted.
- Ask Claude Code or Codex to run Behavior Diff on the change.
- Review the report before you commit the instruction.
For example:
Run behavior diff on my AGENTS.md change.
In Claude Code, you can also run:
/behavior-diff
Behavior Diff finds the changed instruction file and uses your request as the comparison task. Once the task is known, it runs the comparison and opens the report.
Each run creates a local HTML report. The report contains:
- The instruction-file diff.
- The flow of each trial.
- The main decisions that changed.
- The commands and tools that each trial used.
- The final answer from every trial.
Start with the flow difference. Find the first point where the runs separate. Then compare the evidence and final answers from that point.
If both sides follow the same path, the task can miss the situation that the rule targets. Use a task that starts closer to the decision that you want to change.
Behavior Diff runs each side in a separate copy of the project. The after side contains only the instruction change that you selected. Other uncommitted files do not enter the experiment.
Reports stay on your machine under:
${BEHAVIOR_DIFF_HOME:-~/.behavior-diff}/runs/
A report can quote code and agent output from your project. Review the report before you share it.
Behavior Diff creates two copies of the same project state:
- The before copy uses the committed instruction file.
- The after copy adds only your uncommitted instruction change.
It gives both copies the same task and starts fresh agent sessions.
The runner records tool calls, commands, evidence, decisions, and final answers. It converts those traces into a common flow format, compares the two sides, and builds the HTML report. It does not use a model to declare a winner.
The plugin also watches edits to CLAUDE.md, AGENTS.md, and SKILL.md.
After you finish the current task, the agent can use that task to run Behavior
Diff on the instruction change.
- Update both plugin manifests to the same
X.Y.Zversion. - Merge the version change to
mainand wait for CI. - Create a GitHub Release with tag
vX.Y.Z, targetingmain. - Publish it as a stable release, not a prerelease.
- Confirm the Release workflow pins the marketplace entry to
vX.Y.Z.
The release workflow rejects tags that do not match both plugin manifests or
do not point to a commit on main. Drafts and prereleases do not update the
stable marketplace.
plugin/contains the installable plugin, skills, hooks, and runner.e2e/contains synthetic scenarios for manual product checks.tests/contains deterministic checks that do not call a model.e2e/README.mdexplains the demo and live-check fixtures.AGENTS.mdandCODING_GUIDELINES.mdcontain contributor guidance.