Skip to main content

ContextDocs

Your AI agent maintains its own context files — CLAUDE.md, AGENTS.md, and 5 more, always fresh, always lean.

Keep AI coding assistants in sync with your codebase. Generate and maintain CLAUDE.md, AGENTS.md, and 5 more context files with Signal Gate filtering and Context Guard hooks.

Claude Code Plugin Releasedv1.2.0

From codebase to AI context

Slash commands that keep your AI coding assistants in sync with your project

Context file generation

Scan your codebase once, generate AGENTS.md, CLAUDE.md, .cursorrules, copilot-instructions.md, .windsurfrules, .clinerules, and GEMINI.md — all with Signal Gate filtering.

Lean context files that only include what AI tools can't discover on their own

Health scoring

Grade context files 0–100 across line budget, signal quality, path accuracy, cross-file consistency, and freshness. Export to CI with --min-score.

Health scores that catch drift before it reaches your team

Incremental updates

Patch only what drifted — preserves manual customisations, promotes MEMORY.md patterns, keeps every AI tool in sync.

Incremental updates that preserve manual customisations

Context Guard enforcement

Two-tier hooks nudge at session end and block commits when context files are stale, so drift gets caught before it costs anyone tokens.

Context Guard hooks that enforce freshness automatically

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 generated together, so every AI tool on your team gets the same project knowledge.

  • 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, cross-file consistency, and freshness. 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.

  • 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 7 AI tools

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

How it works

ContextDocs runs entirely inside your AI coding assistant — no external dependencies, no API calls

100% local
Signal Gate filtering
Line budgets
Fully open source
What exactly does it access?

What it accesses

  • Your local codebase (to extract conventions, gotchas, and decisions)
  • Existing context files in your repo

Where it stores

  • Generated files are written to your repo directory

Delete generated files or git restore to undo

Network calls

  • None — pure Markdown plugin with no external requests

Nothing to disable

Get started in 60 seconds

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

Claude Code

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

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

Works with:

OpenCode Codex CLI Cursor Windsurf Cline Gemini CLI
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 7 AI tools with Signal Gate filtering

"/contextdocs:context-verify"

Scores context file health 0–100 across 5 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 with Signal Gate filtering

"Check my context files for drift"

Scores health 0–100 across 5 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, 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]
  • add 6 CI checks — spell check, actionlint, frontmatter validation, llms.txt consistency, orphan detection, token budgets (bec24ab)
  • add activation eval runner and updated test cases (08aac68)
  • add CI integration for hook tests, banned phrases, and activation evals (4863054)
  • add hook unit tests and banned phrase checker (55c6906)
See release details on GitHub
github-actions[bot]github-actions[bot]
  • initial ContextDocs v1.0.0 — AI context file management plugin (2aad25e)
  • add full documentation suite — guides, CONTRIBUTING, SECURITY, SUPPORT, SKILL.md (04b41a8)
  • add logo and hero image to README (8405d4a)
  • generate llms-full.txt for LLM content consumption (c5e01b9)
See release details on GitHub