
codesight-ai-context
Universal AI context generator that compiles codebase maps, wiki knowledge bases, and MCP tools to save thousands of tokens per AI conversation.
- Installs
- 551
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/reason-machines/trending-skills --skill codesight-ai-context- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads codesight-ai-context automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
CodeSight — AI Context Generator
Skill by ara.so — Daily 2026 Skills collection.
CodeSight compiles your codebase into a compact, structured context map (routes, models, components, dependencies) that AI coding assistants can read in one shot — eliminating thousands of tokens spent on manual file exploration. Supports 14 languages, 30+ frameworks, 13 ORM parsers, and an MCP server with 13 tools.
Installation
No installation required. Run directly with npx:
npx codesight
Or install globally:
npm install -g codesight
codesight
Requirements: Node.js >= 18, no API keys, no config files needed.
Core Commands
# Generate context map (default — outputs .codesight/CODESIGHT.md)
npx codesight
# Generate persistent wiki knowledge base (.codesight/wiki/)
npx codesight --wiki
# Generate AI tool config files (CLAUDE.md, .cursorrules, codex.md, AGENTS.md)
npx codesight --init
# Open interactive HTML report in browser
npx codesight --open
# Start as MCP server (13 tools) for Claude Code / Cursor
npx codesight --mcp
# Show blast radius for a specific file
npx codesight --blast src/lib/db.ts
# Generate optimized config for a specific AI tool
npx codesight --profile claude-code
npx codesight --profile cursor
npx codesight --profile copilot
npx codesight --profile codex
# Show token savings breakdown
npx codesight --benchmark
# Map markdown knowledge base (ADRs, meeting notes, Obsidian vault)
npx codesight --mode knowledge
npx codesight --mode knowledge ~/vault
npx codesight --mode knowledge ./docs
# Watch mode — regenerate on file changes
npx codesight --watch
# Git hook — regenerate on every commit
npx codesight --hook
What Gets Generated
Default Scan (npx codesight)
Outputs .codesight/CODESIGHT.md — a structured map including:
- Project metadata (stack, language, framework, package manager)
- All routes with HTTP methods and handler locations
- Database models with fields and relations
- UI components with props
- High-impact files ranked by dependency count
- Framework and ORM detection results
Wiki Knowledge Base (--wiki)
Outputs .codesight/wiki/ directory:
.codesight/wiki/
index.md — catalog of all articles (~200 tokens)
overview.md — architecture, subsystems, high-impact files
auth.md — auth routes, middleware, session flow
payments.md — payment routes, webhook handling, billing flow
database.md — all models, fields, relations
users.md — user management routes and models
ui.md — UI components with props
log.md — append-only operation log
AI Tool Config Files (--init)
Generates project-root files for each AI tool:
CLAUDE.md— Claude Code project instructions.cursorrules— Cursor rules filecodex.md— OpenAI Codex contextAGENTS.md— general agent instructions
MCP Server Mode
Start CodeSight as an MCP server to give Claude Code or Cursor direct tool access:
npx codesight --mcp
MCP Tool Reference
| Tool | Description |
|---|---|
codesight_get_context | Full codebase context map |
codesight_get_routes | All API routes with methods and handlers |
codesight_get_models | All database models and schema |
codesight_get_components | UI components with props |
codesight_get_blast_radius | Impact analysis for a specific file |
codesight_get_high_impact_files | Files ranked by dependency count |
codesight_get_framework_info | Detected frameworks and ORMs |
codesight_get_wiki_index | Wiki catalog (~200 tokens) for session start |
codesight_get_wiki_article | Read one wiki article by name |
codesight_lint_wiki | Wiki health check (orphans, stale, missing links) |
codesight_get_knowledge | Knowledge map from markdown notes |
codesight_benchmark | Token savings analysis |
codesight_get_overview | Project overview summary |
Configuring MCP in Claude Code
Add to your Claude Code MCP config (~/.claude/mcp_settings.json or project .mcp.json):
{
"mcpServers": {
"codesight": {
"command": "npx",
"args": ["codesight", "--mcp"],
"cwd": "/path/to/your/project"
}
}
}
Configuring MCP in Cursor
Add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"codesight": {
"command": "npx",
"args": ["codesight", "--mcp"]
}
}
}
Language & Framework Support
| Language | AST Precision | Frameworks Detected |
|---|---|---|
| TypeScript | ✅ Full AST | Next.js, NestJS, Hono, Remix, SvelteKit, Nuxt, Express, Fastify |
| JavaScript | Regex | Express, Fastify, Koa, Hapi |
| Python | Regex | Django, FastAPI, Flask, SQLAlchemy |
| Go | Regex | Gin, Echo, Fiber, Chi |
| Ruby | Regex | Rails, Sinatra |
| PHP | Regex | Laravel, Symfony |
| Elixir | Regex | Phoenix |
| Java | Regex | Spring Boot |
| Kotlin | Regex | Ktor, Spring Boot |
| Rust | Regex | Axum, Actix |
| Dart | Regex | Flutter |
| Swift | Regex | Vapor |
| C# | Regex | ASP.NET Core |
ORM / Database Support
Drizzle, Prisma, TypeORM, Sequelize, Mongoose, MikroORM, SQLAlchemy, Django ORM, ActiveRecord, Eloquent, Ecto, GORM, and more (13 total).
Real Usage Patterns
Pattern 1: Session Start with Wiki
At the beginning of every AI session, load the wiki index instead of the full context map:
# In Claude Code or Cursor, at session start:
Use codesight_get_wiki_index to get project overview,
then codesight_get_wiki_article for "auth" to understand authentication.
Pattern 2: Blast Radius Before Refactoring
Before modifying a shared file, check what breaks:
npx codesight --blast src/lib/database.ts
Output shows every file that imports the target, ranked by impact — critical before refactoring database connections, shared utilities, or types.
Pattern 3: CI/CD Integration
Keep context fresh on every push:
# .github/workflows/codesight.yml
name: Update AI Context
on:
push:
branches: [main]
jobs:
update-context:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Generate context map
run: npx codesight
- name: Generate wiki
run: npx codesight --wiki
- name: Generate knowledge map
run: npx codesight --mode knowledge ./docs
- name: Commit updated context
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .codesight/
git diff --staged --quiet || git commit -m "chore: update AI context [skip ci]"
git push
Pattern 4: Git Hook for Local Freshness
npx codesight --hook
This installs a post-commit hook that regenerates .codesight/CODESIGHT.md automatically after every commit.
Pattern 5: Knowledge Mapping for Decision Records
# Map ADRs and architecture docs
npx codesight --mode knowledge ./docs/decisions
# Map full Obsidian vault
npx codesight --mode knowledge ~/vault
# Outputs .codesight/KNOWLEDGE.md with:
# - Key decisions extracted from ADR files
# - Open questions surfaced from notes
# - Meeting notes indexed by date
# - Specs and PRDs cataloged
Consuming the Output in AI Sessions
Loading Context in Claude Code (manual)
Read .codesight/CODESIGHT.md for project context before answering questions.
Loading Wiki at Session Start
Read .codesight/wiki/index.md first.
Then read the relevant article (e.g. .codesight/wiki/auth.md)
only when questions about that domain arise.
Loading Combined Context
Read .codesight/CODESIGHT.md for code structure and
.codesight/KNOWLEDGE.md for architectural decisions.
Token Savings Reference
| Approach | Tokens per session | Savings vs baseline |
|---|---|---|
| Manual file exploration | 26K–47K | baseline |
npx codesight (context map) | 3K–5K | 7x–12x |
--wiki targeted article | ~200 + ~300/question | 60x–130x |
Real benchmark results from production codebases:
| Project | Stack | Files | Output Tokens | Exploration Tokens | Savings |
|---|---|---|---|---|---|
| SaaS A | Hono + Drizzle | 138 | 3,936 | 46,020 | 11.7x |
| SaaS B | Hono + Drizzle (monorepo) | 53 | 3,629 | 26,130 | 7.2x |
| SaaS C | FastAPI + MongoDB | 40 | 4,162 | 47,450 | 11.4x |
| Rails app | Rails + ActiveRecord | 4,172 | 21,711 | 386,100 | 17.8x |
| Laravel app | Laravel + Eloquent | 3,896 | 30,739 | 493,285 | 16x |
.codesight Directory Structure
.codesight/
CODESIGHT.md — main context map (commit this)
KNOWLEDGE.md — knowledge/decision map (commit this)
wiki/
index.md — wiki catalog (commit this)
overview.md
auth.md
database.md
payments.md
users.md
ui.md
log.md
Add .codesight/ to git to persist context across sessions and team members. The wiki survives session restarts — every new conversation starts with full codebase knowledge from the first message.
Troubleshooting
Routes not detected:
- Ensure you're running from the project root (where
package.jsonor equivalent lives) - TypeScript projects get full AST parsing; other languages use regex — check that route files follow standard framework conventions
- For Python FastAPI, ensure router files use standard
@app.get()/@router.post()decorators
Models showing 0 for MongoDB:
- This is correct behavior — codesight parses SQL ORM declarations. MongoDB collections without Mongoose schemas won't appear. Define Mongoose schemas explicitly to get model detection.
Wiki articles missing:
- Run
npx codesight --wikifirst to generate the wiki directory - Use
codesight_lint_wikiMCP tool or check.codesight/wiki/log.mdfor generation errors
Large monorepos (10K+ files) are slow:
- Add a
.codesightignorefile (same syntax as.gitignore) to exclude build artifacts, generated files, andnode_modulessubdirectories - Typical scan time: 186ms–890ms for projects under 5K files
MCP server not connecting:
- Verify Node.js >= 18:
node --version - Check
cwdin MCP config points to the actual project root - Run
npx codesight --mcpmanually first to confirm it starts without errors
--init overwrites existing CLAUDE.md:
- Back up existing files before running
--initon a project with custom AI instructions - Generated files are additive starting points — merge with your existing content manually
FAQ
What does the codesight-ai-context skill do?
Universal AI context generator that compiles codebase maps, wiki knowledge bases, and MCP tools to save thousands of tokens per AI conversation.
How do I install codesight-ai-context?
Run npx skills add https://github.com/reason-machines/trending-skills --skill codesight-ai-context in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/codesight-ai-context/ (personal) or .claude/skills/codesight-ai-context/ (project).
Which AI agents can use codesight-ai-context?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is codesight-ai-context safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains codesight-ai-context?
It is published by reason-machines in reason-machines/trending-skills. It has 551 recorded installs.
More from reason-machines/trending-skills
openclaw-control-center
reason-machines/trending-skills
Local-first, security-first control center for OpenClaw agents — visibility dashboard with readonly defaults, token attribution, collaboration tracing, and safe write operations.
inkos-multi-agent-novel-writing
reason-machines/trending-skills
Multi-agent CLI system for autonomous novel writing, auditing, and revision with human review gates
claude-hud-statusline
reason-machines/trending-skills
A Claude Code plugin that displays a real-time HUD showing context usage, active tools, running agents, and todo progress in your terminal statusline.
understand-anything-knowledge-graph
reason-machines/trending-skills
Turn any codebase into an interactive knowledge graph using Claude Code skills — explore, search, and ask questions about any project visually.
agency-agents-ai-specialists
reason-machines/trending-skills
A collection of specialized AI agent personalities for Claude Code, Cursor, Aider, Windsurf, and other AI coding tools — covering engineering, design, marketing, sales, and more.
agent-browser-automation
reason-machines/trending-skills
Headless browser automation CLI for AI agents using native Rust binary with Chrome DevTools Protocol
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available