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.
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.
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.
Incremental updates
Patch only what drifted — preserves manual customisations, promotes MEMORY.md patterns, keeps every AI tool in sync.
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.
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
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
Install via the LBA plugin marketplace. Full plugin access with slash commands, rules, and hooks including Context Guard enforcement.
Add the LBA plugin marketplace
/plugin marketplace add littlebearapps/lba-plugins One-time setup — works in both Claude Code and OpenCode
Install ContextDocs
/plugin install contextdocs@lba-plugins Pure Markdown plugin, no build step
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.
Works with:
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
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."
Questions about ContextDocs
What is ContextDocs?
What is the Signal Gate principle?
How is ContextDocs different from writing context files manually?
What are the line budgets?
Does ContextDocs work with any programming language?
Can I use both ContextDocs and PitchDocs?
What is Context Guard?
/contextdocs:context-guard install, uninstall anytime. Where did ContextDocs come from?
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
- •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)
- •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)
Also by Little Bear Apps