k0ntext
CLAUDE.md8 starsChanged 9 months agoMITView on GitHub
Platform: Universal AI Context Engineering - CLI tools and templates for Claude Code, GitHub Copilot, Cline, Antigravity, Cursor, Windsurf, Aider, Continue, and Gemini Domain: https://github.com/SireJeff/k0ntext Tech Stack: Node.js, TypeScript, Vitest, npm, SQLite, OpenRouter Status: Active (v3.8.0) Quick Reference: - API: MCP Server for AI tools - Repo: https://github.com/SireJeff/k0ntext - Deploy: npm registry - Package: k0ntext on npm Chain: 1. Start: Review src/analyzer/ directory 2. Find: Relevant source modules 3. Check: Template files in templates/base/ for context structure 4. Implement: Use…
- Reads credentials
- Installs packages
In this repository7 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- context-optimizeSkill
- implementSkill
- planSkill
- researchSkill
- validateSkill
- verify-docsSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 81
Start: Review src/analyzer/ directory
- Very specific: line 83
Check: Template files in templates/base/ for context structure
- Distinctive: line 94
Start: Search Patterns section below
- Very specific: line 107
Start: Review src/cli/ and templates/ directories
- Very specific: line 221
Implementing: Check existing patterns in src/cli/commands/, follow TypeScript conventions
- Very specific: line 223
Debugging: Check Vitest output (npm run test:run), review src/ modules
- Very specific: line 241
Run all tests: npm test
- Very specific: line 242
Run once without watch: npm run test:run
- Very specific: line 251
Run k0ntext migrate up to apply pending migrations
- Distinctive: line 258
Validation: Run /verify-docs-current [file_path] after modifications
- Distinctive: line 274
Testing: All PRs must pass Vitest tests
- Distinctive: line 275
Security: No secrets in templates, validate user input paths
- Distinctive: line 281
After changes: Update relevant documentation -> Run tests -> Update CHANGELOG.md
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md - K0ntext AI Context Engineering
This file provides guidance to Claude Code when working with code in this repository.
Project Identity
Platform: Universal AI Context Engineering - CLI tools and templates for Claude Code, GitHub Copilot, Cline, Antigravity, Cursor, Windsurf, Aider, Continue, and Gemini Domain: https://github.com/SireJeff/k0ntext Tech Stack: Node.js, TypeScript, Vitest, npm, SQLite, OpenRouter Status: Active (v3.8.0)
Quick Reference:
- API: MCP Server for AI tools
- Repo: https://github.com/SireJeff/k0ntext
- Deploy: npm registry
- Package:
k0ntexton npm
Essential Commands
Development
npm install
npm run build
npm testTesting
npm test # All tests (watch mode)
npm run test:run # Run once (no watch)Database
# SQLite database at .k0ntext.db
k0ntext stats # View database stats
k0ntext index # Index codebase
k0ntext migrate up # Run database migrationsDeployment
npm publish --access public # Publish to npmCLI Commands
k0ntext init # Initialize with intelligent analysis
k0ntext init --no-intelligent # Skip OpenRouter analysis
k0ntext generate # Generate context for all AI tools
k0ntext mcp # Start MCP server
k0ntext sync # Sync across AI tools
k0ntext index # Index codebase into database
k0ntext search <query> # Semantic search
k0ntext stats # Database statistics
k0ntext check # Check if context files are outdated
k0ntext restore # Restore AI tool configs from backups
k0ntext cleanup # Clean up other AI tool folders
k0ntext drift-detect # AI-powered drift detection
k0ntext cross-sync # Sync across all AI tools
k0ntext hooks install # Install git hooks
k0ntext fact-check # Validate documentation accuracy
k0ntext sync-templates # Sync .claude/ templates from package
k0ntext template-status # Show template sync status
k0ntext snapshot # Create database snapshots
k0ntext snapshot restore # Restore from snapshotNavigation Rules
High-Level Task (Refactoring a Flow)
Example: "Refactor the static analyzer to support a new framework"
Chain:
- Start: Review
src/analyzer/directory - Find: Relevant source modules
- Check: Template files in
templates/base/for context structure - Implement: Use appropriate specialized agent
Context Budget: ~40k tokens (20% of 200k window)
Low-Level Task (Fix Hardcoded Value)
Example: "Fix a hardcoded path in the template populator"
Chain:
- Start: Search Patterns section below
- Pattern: Use grep/find
- Fix: Direct file edits
- Validate: Run tests
Context Budget: ~15k tokens (7.5% of 200k window)
Feature Task (Add New Feature)
Example: "Add support for a new AI tool adapter"
Chain:
- Start: Review
src/cli/andtemplates/directories - Research: /rpi-research
- Plan: /rpi-plan
- Implement: /rpi-implement
Context Budget: ~50k tokens (25% of 200k window)
Search Patterns
Finding Configuration Values
Environment variables:
grep -r "process.env" src/Hardcoded URLs/domains:
grep -r "https://" src/ --include="*.ts" --include="*.js"Finding Business Logic
Core Files (TypeScript):
src/analyzer/intelligent-analyzer.ts- Intelligent codebase analysissrc/db/client.ts- SQLite database operationssrc/embeddings/openrouter.ts- OpenRouter API integrationsrc/mcp.ts- MCP server implementationsrc/cli/index.ts- CLI commands and REPL shellsrc/config/models.ts- Centralized model configurationsrc/template-engine/- Handlebars template systemsrc/template-sync/- Template synchronization systemsrc/agent-system/- TodoListManager, TimestampTrackersrc/services/- SnapshotManager and servicessrc/utils/chunking.ts- Text chunking for large file embeddingssrc/utils/encoding.ts- UTF-8 BOM handling
Finding Database Schema
Models: src/db/schema.ts
Migrations: src/db/migrations/
Database: SQLite at .k0ntext.db
Finding External Integrations
- npm registry (publishing)
- GitHub Actions (CI/CD)
- Git hooks (automatic sync)
- OpenRouter API (embeddings and chat for intelligent analysis)
System Architecture Mini-Map
k0ntext/
├── bin/ # CLI entry point (k0ntext.js)
├── src/ # TypeScript source
│ ├── agent-system/ # TodoListManager, TimestampTracker
│ ├── agents/ # Smart agents (Cleanup, Performance, Drift, FactCheck)
│ ├── analyzer/ # Intelligent codebase analysis
│ ├── cli/ # CLI commands, REPL shell, utilities
│ ├── config/ # Centralized model configuration
│ ├── db/ # SQLite database client + migrations
│ ├── embeddings/ # OpenRouter integration
│ ├── services/ # SnapshotManager and services
│ ├── template-engine/ # Handlebars template system
│ ├── template-sync/ # Template synchronization
│ ├── utils/ # Utilities (chunking, encoding)
│ └── mcp.ts # MCP server
├── agents/ # Agent definitions (distributed with package)
├── skills/ # RPI workflow skills
├── templates/ # Output templates + base templates for .claude/
│ ├── base/ # Templates synced to user .claude/ directories
│ └── map/ # Map-based context templates
├── tests/ # Vitest tests
├── docs/ # Documentation
└── .claude/ # Claude Code development context
├── agents/ # Agent definitions
├── commands/ # Command definitions
└── schemas/ # JSON schemasNote: Template index files (indexes/, context/, workflows/) exist in
templates/base/and are synced to user projects viak0ntext initandk0ntext sync-templates. They are not present in the repository's own.claude/directory.
Critical Constants
Domain & URLs
- npm package:
k0ntext - GitHub:
SireJeff/k0ntext
Business Constants
- Supported AI tools: Claude Code, GitHub Copilot, Cline, Antigravity, Windsurf, Aider, Continue, Cursor, Gemini
- Node.js minimum: 18.0.0
- Database file:
.k0ntext.db - Sync state stored in:
.k0ntext/sync-state.json - OpenRouter API key:
OPENROUTER_API_KEYenvironment variable
Quick Reference
Understanding: Review src/ source modules, check templates/base/ for context structure
Implementing: Check existing patterns in src/cli/commands/, follow TypeScript conventions
Debugging: Check Vitest output (npm run test:run), review src/ modules
Agent & Command Routing
Agents: @context-engineer (setup), @core-architect (design), @api-developer (endpoints), @database-ops (schema), @integration-hub (external), @deployment-ops (CI/CD) Agent definitions: .claude/agents/
Commands: /rpi-research, /rpi-plan, /rpi-implement, /context-optimize, /verify-docs-current, /validate-all, /help, /collab, /analytics Command definitions: .claude/commands/
Gotcha Quick Reference
Testing
- Tests use Vitest with globals enabled
- Run all tests:
npm test - Run once without watch:
npm run test:run
Publishing
- Version must be bumped before npm publish
- CI/CD publishes automatically on GitHub release
Database
- Migrations are in
src/db/migrations/files/ - Schema version tracked in
src/db/schema.ts - Run
k0ntext migrate upto apply pending migrations
Documentation System
Navigation: CLAUDE.md serves as the primary entry point for Claude Code Validation: Run /verify-docs-current [file_path] after modifications RPI Workflow: /rpi-research -> /rpi-plan -> /rpi-implement
Production
Platform: npm registry Services: GitHub Actions CI/CD Monitoring: npm download stats, GitHub issues
Key Constraints
Migrations: SQLite migrations in src/db/migrations/files/
Testing: All PRs must pass Vitest tests
Security: No secrets in templates, validate user input paths
Maintenance
After changes: Update relevant documentation -> Run tests -> Update CHANGELOG.md
Docs: docs/ directory (QUICKSTART.md, MCP_QUICKSTART.md, TROUBLESHOOTING.md)
Contact
- GitHub Issues: https://github.com/SireJeff/k0ntext/issues
- Author: SireJeff
Version: 3.8.0 | Last Updated: 2026-02-11 | Context Target: 200k
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

