Seedlabs

ContextJanitor: repo-verified staleness detection and refactoring for AGENTS.md/CLAUDE.md

A cleaner that removes outdated instructions and duplicate rules from AI agent context files.

A cleaner that treats agent context files as what the data shows they are — configuration code that accretes through frequent small additions — and verifies every instruction against the live repository, quarantining stale commands and file references, merging duplicates, and flagging contradictions. One command keeps the file the agent reads accurate and readable.

Computer ScienceSoftware Engineering Research
Agentic Intelligence and EvaluationDeveloper tooling: CI and repo maintenance for engineering teams using AI coding agents

Concept

A repo-aware hygiene tool for agent context files. On every run it parses each instruction in AGENTS.md/CLAUDE.md, extracts the commands, file paths, scripts, and tool names it references, and verifies them against the live repository: does the documented test command still exist in package.json or the Makefile, does the referenced directory still exist, is the named linter still configured? It then quarantines stale instructions (pointing at deleted files, renamed commands, deprecated tools), merges near-duplicate instructions, surfaces contradictions (two different commands given for the same step), and rewrites the file into a clean hierarchy. A CI hook fails a PR that invalidates an instruction — e.g., deletes a script the context file tells the agent to run — without updating the context file, the same way linters keep code and its documentation honest. Usage is a single command: contextjanitor --fix.

Why now

Paper [0]'s study of 2,303 context files from 1,925 repositories establishes the maintenance problem this product manages: these files are "not static documentation but complex, difficult-to-read artifacts that evolve like configuration code through frequent, small additions." Critically, the content that dominates — test procedures (75.9%) and implementation details (70.8%) — is exactly the most rot-prone, because commands and file paths go stale as the repo changes underneath them. The stakes scale with adoption: agentic coding became standard practice in 2025 with agents like Cursor, Claude Code, and Codex operating with high autonomy ([1]), and production-scale traces show the workload is enormous ([3]: 3.2M users, 761M LLM calls, 95T tokens in the studied period) — meaning context files are consumed on effectively every task, so a stale instruction misdirects agents at scale.

Written by GLM · 4 Dec 2026

AI assessment

Backed by 3 papers88

An exceptionally focused developer tool that solves a documented pain point—context rot—with a high-feasibility technical approach and a sharp CI-driven wedge.

Evidence strength
5/5
The idea directly leverages Paper [2]'s finding that context files are 'configuration code' dominated by rot-prone test procedures and implementation details, and Paper [3]'s evidence that tool failures cause significant compute overhead.
Market pull
4/5
Engineering teams using high-autonomy agents (Cursor, Claude Code) face a tangible productivity loss when agents follow stale instructions, creating a clear demand for 'context hygiene'.
Novelty & moat
3/5
While similar to TeamLint and HouseRules, this focuses specifically on the 'staleness' of the context file relative to the live repo state rather than design patterns or PR conventions.
Feasibility
5/5
Building a parser that extracts paths/commands and verifies them against a filesystem and package.json is a straightforward engineering task with a clear MVP path.
Wedge clarity
5/5
The 'CI hook that fails a PR if a context instruction is invalidated' is a sharp, high-value entry point that forces adoption through a known developer workflow.
Simplicity / focus
5/5
The product is a single-purpose utility with a clear command (`--fix`) and a specific target (context files), avoiding platform bloat.

Scored by Gemma 4 · 4 Dec 2026. Rated against a fixed rubric (evidence, market, novelty, feasibility, wedge, simplicity), relative to the closest ideas already in the catalog. A prior estimate to compare ideas before real-world signal arrives.

Act on this idea

Ideas only matter if someone runs with them. Your message goes straight to the founder's inbox — nothing is stored on our servers.

Who benefits

  • Bundling a context-file cleaner directly improves agent task success for users whose accumulated .cursor/rules and CLAUDE.md files reference commands that no longer exist — a visible product differentiator grounded in a documented failure mode.

  • Sourcegraph's code search and graph are the natural engine for verifying whether context-file instructions reference files and commands that still exist, adding a 'context file health' product surface on top of its code intelligence.

  • GitHubcompany

    A staleness check for AGENTS.md and copilot-instructions.md fits GitHub's existing code-scanning-style repo maintenance features as agent adoption scales across its user base.

  • Greptilecompany

    The AI code-review vendor can add context-file hygiene to its review surface, catching PRs that change or delete commands and files that the repo's agent instructions still reference.

  • JetBrainscompany

    JetBrains IDEs already surface configuration problems inline; flagging stale agent-context instructions at edit time is a low-friction extension of its inspection framework for its large enterprise user base.

Research it builds on

  1. Agentic Much? Adoption of Coding Agents on GitHub
    Romain Robbes, Théo Matricon, Thomas Degueule et al. · 2026 · 80 citations
    All ideas from this paper →
  2. Agent READMEs: An Empirical Study of Context Files for Agentic Coding
    Worawalan Chatlatanagulchai, Hao Li, Yutaro Kashiwa et al. · 2026 · 77 citations
    All ideas from this paper →
  3. Agentic Coding in the Wild: Characterizing GitHub Copilot Traces at Production Scale
    Banruo Liu, Haoran Qiu, Íñigo Goiri et al. · 2026 · 28 citations
    All ideas from this paper →
Leave feedback
feasibility