Skip to content
Unsnag

Context Conditions and Context Inputs

Does your skill file help Agents use your CLI? Do your docs? A Context Condition answers that by measurement: it names what the Agent is given or can reach, and every Scenario runs under every Context Condition, so the Report compares their success rates on the same Scenarios.

unsnag/benchmark.yaml
context:
  name-only: {}
  skill:
    skill: [skills/shop]
  docs:
    instructions: docs/AGENTS.md
    files: { docs/cli.md: docs/cli.md }
  offline-skill:
    skill: [skills/shop]
    deny: [docs.shop.example]

Exactly the Conditions you list run. name-only: {} gives the Agent nothing but your CLI's name, so it is the reference point the others are measured against; unsnag validate warns when it is missing.

Context Inputs

Each Condition is made of Context Inputs, with paths relative to your project root:

KeyWhat it isWhere each Agent finds it
skillSkill folders, each with a SKILL.md, or a SKILL.md file (one at the project root).claude/skills/<name>/ for Claude Code, .agents/skills/<name>/ for Codex and opencode
instructionsOne project instructions fileCLAUDE.md for Claude Code, AGENTS.md for Codex and opencode
filesFiles to copy, each to its path in the workspacethat path under /work
denyHosts the Run can't resolve, with every name under them

Each Agent finds its inputs where that Agent's own users would put them, committed into the Run's workspace (/work, a fresh git repository) before setup runs, so the comparison is fair across Agents. A skill is named after its folder; a SKILL.md given as a file is placed alone, in a folder named after the name in its frontmatter. The project root is no skill folder (it would hand the Agent the whole project): for a SKILL.md at the root, write skill: SKILL.md. Keep a skill to the Agent Skills fields name and description plus its body, and it behaves the same in all three Agents.

Offered and used

A skill or instructions file the Agent never saw would make a Condition look useless for the wrong reason. So every Run records, for each Context Input, whether it was offered to the model (read from the Agent's own session file) and whether the Agent used it (a skill call, or a tool call that names its path). A Run where a skill or instructions file was not offered, or where that can't be told because the Agent's session file couldn't be read, is error: context-not-loaded and doesn't count against the Condition. Whether instructions were used can't be observed, so it is recorded as unknown, as is whether a copied file was offered.

The Report's Context page shows each Condition's success rate and each input's uptake per Agent ("skill used in 12/15 Runs"). A Condition that doesn't move the success rate, with a skill that's offered but rarely used, usually needs a better skill description: that's what the Agent decides on.

Web access and deny

Runs have web access, as a user's Agent would. deny takes hosts away: the Run's container resolves names through a DNS sidecar that answers "no such host" for each listed host and every name under it, and records every lookup on the Run (dns_lookups). Use it to measure your skill without your docs site, or to keep an Agent from finding answers on a public page. It applies to the whole Run: setup, the Agent and the Checks. Its limits are listed under known gaps.

web: false takes the whole web away, for a CLI whose Agents should not touch real services (a live network, a paid API): the DNS sidecar answers "no such host" for every name, and on Unsnag's machines the web proxy refuses every request, an IP address's too. The Run still reaches its own services, so its Mocks, and the model relay. When every Context Condition has web: false, unsnag draft and unsnag scenarios verify run without the web too: the drafter's brief says so, its sandbox and verify's resolve no name on the web, so a draft cannot depend on it and is verified as its Runs will run. In the App, it is one switch, "Agents can use the web", on the drafting step (before anything is drafted), the Agents step and the Benchmark's Context Conditions.

context:
  name-only: { web: false }
  skill: { skill: skills/my-cli, web: false }

The drafter and the explainer

The drafter never reads a Condition's instructions or files unless draft.docs lists them too: they are left out of its copy of your source, so drafts don't copy them and inflate that Condition's results. It does read a Condition's skills, as your guidance for agents: when a skill forbids agents an action or leaves it to a person, no draft asks an Agent to do it (it is done in the Scenario's setup, or declining is the right answer), so an Agent that follows the skill isn't marked failed for it. It is told not to take goals from the skill's examples. The explainer, which writes each Finding's fix, does read them when they are under source, so a fix can be to the skill itself.

Changing an input

Each input is hashed into the Run record. Edit your skill and rerun only that Condition to see the effect:

unsnag run --context skill

The next Report compares itself with the last one, Scenario by Scenario, under each Condition.