Skip to content
Agentyx documentation/Context audit

Guides

Context audit

What agentyx audit shows about resident, discoverable and lazy context, per provider, and what it cannot measure.

doctor answers whether the harness is healthy. audit answers whether it is context-efficient and structured sensibly.

agentyx audit          # readable summary
agentyx audit --json   # versioned report (schemaVersion 1)

The command is read-only and offline. It calls no model, starts no process, needs no provider CLI or API key, and opens no file under $HOME. It works without .agentyx.json (instructions only) and reports a damaged lock as unreadable-lock without drawing conclusions from it. An invalid .agentyx.json is an error.

agentyx report includes the same data under Context efficiency.

Resident, discoverable, lazy

  • Resident: project instruction files a provider documents it loads at session start.
  • Discoverable: Skill names and descriptions a provider keeps in its catalog.
  • Lazy: Skill bodies, where the provider loads them only when used.

These are provider facts, not guarantees:

Provider Root instructions Skill catalog Skill bodies MCP definitions Context visibility
Codex AGENTS.override.md or AGENTS.md, resident (32 KiB documented cap) bounded on demand unknown structured run output
Claude Code CLAUDE.md family and imports, resident; AGENTS.md only without them bounded on demand deferred hook value, /context
Kimi Code AGENTS.md, loading unknown unknown unknown provider-managed unknown
Qwen Code QWEN.md, .qwen/QWEN.local.md, AGENTS.md, resident metadata resident on demand deferred /context

References and limitations per provider are in the JSON report (providers[].loading), reviewed on 2026-12-04. Anything undocumented stays unknown.

Nested instruction files are looked for only in directories .agentyx.json already names (context.areas and command cwds). The repository is not walked, so other nested files are missed.

Evidence

Class Meaning
exact-static counted from local files: bytes, characters, lines, items
provider-reported a number the provider itself sent
measured counted from local Agentyx observations
unavailable not obtained; never shown as zero
unknown not documented
estimated reserved; Agentyx produces no estimates

Static bytes are not tokens. Agentyx converts nothing.

The only provider-reported context value is the one Claude Code sends to SessionStart for a resumed or forked session: the tokens its first request re-sends. It may include provider-owned context and is not Agentyx's cost. Fresh-session ("cold-start") context is unavailable: there is no opt-in probe in this release, because the reviewed documentation does not settle the usage fields and their cache semantics for headless runs well enough to publish a number.

JSON contract

Top level: schemaVersion, agentyxVersion, project, providers, instructions, harness, skills, mcp, overlaps, observations, measurements, recommendations. Each recommendation has a stable code, a message and evidence (class, details). Paths are project-relative. Instruction text and Skill bodies are never included.

Codes: large_resident_instructions, instructions_exceed_provider_limit, skill_catalog_over_documented_budget, skill_description_over_provider_limit, shared_instructions_not_loaded, repeated_instruction_block, substantial_text_overlap, dormant_skill_candidate, dormant_mcp_candidate, packs_beyond_detection.

The 8 KiB threshold behind large_resident_instructions is an Agentyx review prompt, not a provider limit. Overlap findings are literal repeated text, never a claim about meaning.

Deciding where guidance belongs

  • A permanent repository invariant belongs in resident instructions.
  • A specialized, conditional workflow is a good lazy Skill.
  • More Skills are not automatically better, and neither are fewer.
  • No observed use is not the same as unused. A dormant candidate needs a provider that can observe that use, installed observer hooks, a matching harness baseline and at least ten eligible sessions. Codex, Kimi Code and Qwen Code cannot show Skill use, so Agentyx never calls their Skills dormant.
  • A pack detection did not recommend is not wrong.

Agentyx never rewrites AGENTS.md, CLAUDE.md or QWEN.md.

Privacy

Nothing is uploaded or stored by audit. It reads the observation store (metadata only) and never records prompts, responses, source, tool arguments or output, commands, MCP payloads, tokens or provider session ids.