Skip to main content

ContextDocs

Your AI agent maintains its own context files

CC Plugin Released

What ContextDocs does

A Claude Code plugin with an AGENTS-first model that covers Codex, Copilot, Cursor, Gemini, and 5 more tools.

Claude Code — /contextdocs:update
▸ Scanning for code changes since last session… src/api/routes.ts modified 2h ago (+3 endpoints) src/config/auth.ts modified 1d ago (new OAuth flow) src/middleware/ unchanged ▸ Identifying affected context files… CLAUDE.md needs update (API section stale) AGENTS.md needs update (auth conventions changed) 4 bridges auto-sync from AGENTS.md ▸ Updating autonomously… ├─ CLAUDE.md ✓ updated (+3 lines) ├─ AGENTS.md ✓ updated (+1 section) └─ 4 bridges ✓ synced ✓ All context fresh — 6 files, zero manual effort

What ContextDocs includes

  • Signal Gate filtering

    Strips out discoverable content (directory listings, file trees, architecture overviews) so your context files contain only what actually helps AI tools, keeping them lean and under budget.

  • 7 context file types from one scan

    AGENTS.md, CLAUDE.md, .cursorrules, copilot-instructions.md, .windsurfrules, .clinerules, and GEMINI.md — covering 8 AI tools including GitHub Copilot.

  • Full lifecycle, not just generation

    init bootstraps, update patches only what drifted, promote graduates MEMORY.md patterns to CLAUDE.md, audit flags staleness — so context files stay accurate as your project evolves.

  • Health scoring (0–100)

    Grades context files across line budget, signal quality, path accuracy, AGENTS-to-bridge consistency, freshness, and aggregate context load — 13 checks total. Export to CI with --min-score so drift never reaches your team.

  • Context Guard enforcement

    Two-tier hooks nudge at session end (Tier 1) and block commits (Tier 2) when context files are stale, so drift gets caught before it costs anyone tokens. Claude Code only.

  • Content filter protection

    Guards against Claude Code's API filter (HTTP 400) for CODE_OF_CONDUCT, LICENSE, and SECURITY files, so hook installation never gets blocked. Claude Code only.

  • Path-scoped context rules

    Apply different conventions to different directories using glob patterns — monorepos and multi-platform projects get targeted context per area. Claude Code only.

  • Upstream compatibility tracking

    Weekly Claude Code release monitoring and settings schema diffing detect breaking changes before they affect your context files.

  • Line budgets that work

    CLAUDE.md under 80 lines, AGENTS.md under 120, all others under 60 — backed by the ETH Zurich finding that shorter, focused context outperforms longer files.

  • Works with 8 AI tools

    Claude Code and OpenCode natively; generated files work with Codex CLI, GitHub Copilot, Cursor, Windsurf, Cline, and Gemini CLI automatically.

Get started in 60 seconds

Three steps for Claude Code, or one prompt for any other AI agent

Claude Code

Requires a AI Coding Agents account

Install via the LBA plugin marketplace. Full plugin access with slash commands, rules, and hooks including Context Guard enforcement.

1

Add the LBA plugin marketplace

/plugin marketplace add littlebearapps/lba-plugins

One-time setup — works in both Claude Code and OpenCode

2

Install ContextDocs

/plugin install contextdocs@lba-plugins

Pure Markdown plugin, no build step

3

Bootstrap AI context for your project

/contextdocs:ai-context init

Scans your codebase, applies Signal Gate filtering, generates up to 7 context files for 8 AI tools

Context Guard hooks

/contextdocs:context-guard install

Adds two-tier freshness enforcement: session-end nudge + pre-commit guard. Claude Code only. Uninstall anytime with /contextdocs:context-guard uninstall.

Other AI agents

Copy this prompt and paste it into any AI assistant:

OpenCode Codex CLI Cursor Windsurf Cline Gemini CLI Aider Goose
Read the ContextDocs skills and guides in .claude/skills/ and generate AI context files for this project. Start with CLAUDE.md.
Claude Code

Try these commands

Claude Code slash commands — copy one to see it in action

"/contextdocs:ai-context init"

Scans your codebase and generates context files for 8 AI tools with Signal Gate filtering

"/contextdocs:context-verify"

Scores context file health 0–100 across 6 dimensions

"/contextdocs:ai-context update"

Patches only what drifted — preserves manual customisations

Other AI agents

Try these prompts

Natural language equivalents — works with any AI agent that reads .claude/skills/

"Generate AI context files for this project"

Scans codebase and creates 7 context files for 8 AI tools with Signal Gate filtering

"Check my context files for drift"

Scores health 0–100 across 6 dimensions

"Update stale context files"

Patches only what drifted, preserves manual customisations

"Every project I set up, I'd spend 20 minutes writing a CLAUDE.md that was half directory listings the agent already knew. Signal Gate changed that — now I get context files that actually help."

Nathan
N
Nathan

Questions about ContextDocs

What is ContextDocs?
ContextDocs is a Claude Code plugin that generates and maintains AI IDE context files — AGENTS.md, CLAUDE.md, .cursorrules, copilot-instructions.md, .windsurfrules, .clinerules, and GEMINI.md. It uses the Signal Gate principle to include only what AI agents cannot discover by reading your source code, keeping context files lean and effective. Works with Claude Code, OpenCode, Codex CLI, GitHub Copilot, Cursor, Windsurf, Cline, and Gemini CLI.
What is the Signal Gate principle?
Only include in context files what AI agents cannot discover by reading source code on their own. No directory listings, file trees, or architecture overviews — just the conventions, gotchas, and decisions that actually help. Research shows overstuffed context files reduce AI task success by ~3% and increase token costs by 20% (ETH Zurich, 2026).
How is ContextDocs different from writing context files manually?
Manual context files tend to include too much (directory listings, file trees, architecture descriptions that agents discover on their own), exceed reasonable line budgets, and go stale within days. ContextDocs automates generation with Signal Gate filtering, enforces per-file line budgets, and keeps files fresh with incremental updates and Context Guard hooks.
What are the line budgets?
CLAUDE.md: under 80 lines. AGENTS.md: under 120 lines. All others (.cursorrules, copilot-instructions.md, .windsurfrules, .clinerules, GEMINI.md): under 60 lines. These budgets are backed by research showing shorter, focused context outperforms longer files.
Does ContextDocs work with any programming language?
Yes. ContextDocs scans your codebase for conventions, configuration, and project structure regardless of language. The generated context files describe project-specific decisions and patterns, not language-specific boilerplate.
Can I use both ContextDocs and PitchDocs?
Yes. They work independently and complement each other. PitchDocs generates public-facing documentation (README, CHANGELOG, ROADMAP, user guides). ContextDocs generates AI IDE context files (CLAUDE.md, AGENTS.md, .cursorrules, etc.). Install both from the same LBA plugin marketplace.
What is Context Guard?
Context Guard is a set of hooks (Claude Code only) that detect stale AI context files. Tier 1 nudges at session end; Tier 2 blocks commits when context files haven't been updated after structural changes. Install with /contextdocs:context-guard install, uninstall anytime.
Where did ContextDocs come from?
ContextDocs was extracted from PitchDocs v1.19.3 to follow the microtool philosophy — each tool does one thing well. PitchDocs handles public-facing documentation; ContextDocs handles AI IDE context files.

Roadmap

Coming Soon

  • Coming soon: Memory management skill — MEMORY.md analysis, pattern promotion, hygiene
  • Coming soon: Rules management skill — .claude/rules/ lifecycle, linting, organisation
  • Planned: Context CI — GitHub Actions for context freshness checks in PRs
  • Planned: Context sync — one-command sync across all 7 formats
  • Planned: Project-type templates — starter context for common stacks

Changelog

github-actions[bot]github-actions[bot]
github-actions[bot]github-actions[bot]
  • add .mcp.json, agent memory, and plugin manifest validation (097f452)
  • add ai-context companion reference, agent upgrades, and CLAUDE.md advanced features (d2389b9)
  • add Claude Code release and schema monitoring (42fbb84)
  • add complete hook system reference and SessionStart health check hook (f91ec63)
See release details on GitHub