Skip to main content
Rule ID: AE-CTX-002 · Severity: Medium · Category: Context · Auto-fixable: No

Why this rule

An agent that reads a context file describing the wrong stack makes confident mistakes — wrong build commands, wrong test paths, wrong edit scope. A drifted context file is often more dangerous than no file at all: it provides authoritative-looking guidance that is simply wrong.

What triggers it

Charter compares the context file’s stated tech stack and commands against manifest files it can observe in the repo. The finding fires when:
  • The stated stack names a language or framework but no corresponding manifest exists (package.json, go.mod, Gemfile, pyproject.toml, Cargo.toml, etc.)
  • The stated verification command does not appear in any task runner config Charter can find (moon.yml, Makefile, package.json scripts, Justfile)
  • Declared off-limits paths reference directories that do not exist in the repo
An old date alone is not enough to fail this rule. AE-CTX-002 fires on factual mismatches — stack claims with no manifest evidence, commands that don’t exist, paths that aren’t real — not on timestamp staleness.

Examples

AGENTS.md
Stack: React, Node.js
Verification: npm test
# Repo contains: go.mod, moon.yml
# No package.json found — React/Node.js claim has no manifest evidence
# npm test not present in any task runner config

AGENTS.md
Off-limits: legacy/, v1-archive/
# Neither legacy/ nor v1-archive/ exists in the repo tree

How to fix

Review each mismatch listed in the finding evidence and update the context file to reflect repo reality.
Update the stack declaration to match what manifests are actually present. If you removed a language, remove it from the context file. If you added one, add it. Charter looks for go.mod, package.json, pyproject.toml, Gemfile, Cargo.toml, and similar.
Confirm the stated command runs successfully from the repo root. Update it to match the actual task runner entry — or add the task to your runner config if it is genuinely missing.
Remove references to paths that no longer exist, or create the directory if the boundary is still intended. Phantom off-limits declarations confuse agents rather than protecting anything.
Run charter doctor after any update to confirm the finding clears.
Treat AGENTS.md like a living document — update it whenever you add or remove a language, change your test runner, rename directories, or modify edit-scope boundaries. Drift happens silently; Charter surfaces it before the agent reaches it.

Score impact

Medium severity: −4 to the base score. No hard cap (caps are reserved for Blocker and secret findings).
  • AE-CTX-001 — context file must exist and be within budget
  • AE-AUTO-001 — verification command must be discoverable
  • AE-CTX-006 — emphatic directive density

CLI

charter explain AE-CTX-002