codesight 标志

codesight

社区热门
Houseofmvps

Universal AI context generator. Saves thousands of tokens per conversation in Claude Code, Cursor, Copilot, Codex, and more.

发布者Houseofmvps
代码仓库codesight
语言TypeScript
复刻数
123
星标数
1.4K
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    codesight 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 1.4K 个 Star 和 123 个 Fork。

Your AI assistant wastes thousands of tokens every conversation just figuring out your project. codesight fixes that in one command.

4,000+ downloads and counting.

Zero dependencies. AST precision. 30+ framework detectors. 14 ORM parsers. 14 MCP tools. One npx call.

Works with TypeScript, JavaScript, Python, Go, Ruby, Elixir, Java, Kotlin, Rust, PHP, Dart, Swift, C#, and BrightScript/BrighterScript ( Roku). TypeScript projects get full AST precision. Everything else uses battle-tested regex detection across the same 30+ frameworks.

npm version npm downloads npm total GitHub stars License: MIT


Follow @kaileskkhumar LinkedIn houseofmvps.com kailxlabs.co

Built by Kailesk Khumar, founder of HouseofMVPs and Kailxlabs

Also: ultraship (39 expert skills for Claude Code) · claude-rank (SEO/GEO/AEO plugin for Claude Code)


0 dependencies · Node.js >= 18 · 149 tests · 14 MCP tools · MIT · tested on 25+ OSS projects across 14 languages

Works With

Claude Code, Cursor, GitHub Copilot, OpenAI Codex, Windsurf, Cline, Aider, and anything that reads markdown.

Install

bash
npx codesight

That's it. Run it in any project root. No config, no setup, no API keys.

bash
npx codesight --wiki                       # Generate wiki knowledge base (.codesight/wiki/)
npx codesight --init                       # Generate CLAUDE.md, .cursorrules, codex.md, AGENTS.md
npx codesight --open                       # Open interactive HTML report in browser
npx codesight --mcp                        # Start as MCP server (14 tools) for Claude Code / Cursor
npx codesight --blast src/lib/db.ts        # Show blast radius for a file
npx codesight --profile claude-code        # Generate optimized config for a specific AI tool
npx codesight --benchmark                  # Show detailed token savings breakdown
npx codesight --native-ast                 # Opt-in: AST plugins for more languages (see docs/wasm-plugins.md)
npx codesight --mode knowledge             # Map knowledge base (.md notes → KNOWLEDGE.md)
npx codesight --mode knowledge ~/vault     # Map Obsidian vault, ADRs, meeting notes, retros

Wiki Knowledge Base (v1.6.2)

Inspired by Karpathy's LLM wiki pattern — but compiled from AST, not an LLM. Zero API calls. 200ms.

bash
npx codesight --wiki

Generates .codesight/wiki/ — a persistent knowledge base of your codebase that survives across every session:

.codesight/wiki/
  index.md      — catalog of all articles (~200 tokens) — read this at session start
  overview.md   — architecture, subsystems, high-impact files (~500 tokens)
  auth.md       — auth routes, middleware, session flow
  payments.md   — payment routes, webhook handling, billing flow
  database.md   — all models, fields, relations, high-impact DB files
  users.md      — user management routes and related models
  ui.md         — UI components with props
  log.md        — append-only record of every wiki operation

Why this cuts token usage further:

Instead of loading the full 5K token context map every conversation, your AI reads one targeted article:

QuestionWithout wikiWith wiki
"How does auth work?"~12K tokens (reads 8+ files)~300 tokens (auth.md)
"What models exist?"~5K tokens (CODESIGHT.md)~400 tokens (database.md)
New session start~5K tokens (full reload)~200 tokens (index.md)

Persistent across sessions. The wiki lives in .codesight/wiki/, committed to git. Every new Claude Code, Cursor, or Codex session starts with full codebase knowledge from the first message.

Auto-regenerates. Use --watch to keep the wiki current as you code. Use --hook to regenerate on every commit.

3 new MCP tools for wiki access:

ToolWhat it does
codesight_get_wiki_indexGet the wiki catalog (~200 tokens) at session start
codesight_get_wiki_articleRead one article by name: auth, database, payments, etc.
codesight_lint_wikiHealth check: orphan articles, missing cross-links, stale content

The key difference from general-purpose wiki tools: codesight already knows your routes, schema, blast radius, and middleware from AST — no LLM needed to extract code structure. The wiki is a narrative layer on top of data your codebase already contains.

Knowledge Mode (v1.9.3)

Not just code — your decisions, meeting notes, ADRs, and retrospectives carry as much context as the codebase itself. --mode knowledge maps them the same way codesight maps code.

bash
npx codesight --mode knowledge              # Scan current directory for .md files
npx codesight --mode knowledge ~/vault      # Scan an Obsidian vault
npx codesight --mode knowledge ./docs       # Scan a project docs folder

Outputs .codesight/KNOWLEDGE.md — a compact AI context primer:

markdown
# Knowledge Map — my-project

> 47 notes · 12 decisions · 8 open questions · 2025-09-01 → 2026-04-01

## Key Decisions (12)

- [2026-03-20] Going with Polar.sh over Stripe Connect — simpler global payments
- [2026-03-15] Decided to use PostgreSQL — better JSON support and Drizzle compatibility
- [2026-02-10] Will use Redis for rate limiting — BullMQ already in stack

## Open Questions (8)

- Should we support PayPal later?
- When do we start the Stripe marketplace application?

## Note Index (47)

### Decision Records (8)

- `decisions/adr-002-payments.md` — 2026-03-20 — Going with Polar.sh over Stripe Connect
- `decisions/adr-001-database.md` — 2026-03-15 — We need a relational database...

### Meeting Notes (14)

### Retrospectives (6)

### Specs & PRDs (5)

### Research (4)

What it detects automatically:

Note typeSignals
Decision recordsADR format (## Decision), "decided to", "going with", "chose X over Y"
Meeting notesAttendees:, Action items:, filename: standup, sync, 1on1
Retrospectives"What went well", "Stop doing", filename: retro, retrospective
Specs / PRDs## Goals, ## Requirements, filename: prd, spec, roadmap
Researchfilename: research, analysis, benchmark, comparison
Session logsfilename: session, daily, weekly

Supports:

  • Obsidian vaults (YAML frontmatter, [[backlinks]], #tags)
  • Notion exports (.md files with frontmatter)
  • ADR tooling (adr-tools, Log4brains, raw markdown)
  • Any folder of markdown files

Used together:

Read .codesight/CODESIGHT.md   → what the code does
Read .codesight/KNOWLEDGE.md   → why decisions were made

CI: add npx codesight --mode knowledge alongside your existing codesight step. Both files stay current on every push.

Benchmarks (Real Projects)

Every number below comes from running codesight on real production codebases — both small SaaS projects (v1.6.2) and large open-source platforms with 4K–10K+ files (v1.6.4). Output tokens are measured from actual file size (chars / 4). Exploration tokens are estimated from what was extracted — routes × 400, models × 300, components × 250, etc. Route counts and model counts are cross-checked against actual source files.

Three-Level Token Reduction

codesight saves tokens at two distinct layers. The wiki (v1.6.2) adds a second layer on top of the base savings:

ProjectManual explorationcodesight scancodesight --wiki (targeted)Total reduction
SaaS A46,020 tokens3,936 tokens (11.7x)~550 tokens83.7x
SaaS B26,130 tokens3,629 tokens (7.2x)~440 tokens59.4x
SaaS C47,450 tokens4,162 tokens (11.4x)~360 tokens131.8x

Average combined reduction: 91x. The wiki's "targeted" number = reading index.md at session start (~200 tokens) + one relevant article (~160-350 tokens depending on project). Your AI never loads the full context map for targeted questions.

The two savings layers are independent and compound:

Layer 1 — codesight scan eliminates manual file exploration. Instead of your AI running glob/grep/read across 40-138 files to understand the project, it reads one pre-compiled map.

Layer 2 — --wiki eliminates loading the full map for every question. Instead of loading 3K-5K tokens of full context at session start, your AI reads a 200-token index and pulls the one relevant article (~160-350 tokens) for each question.

Without codesight:   AI reads 26K-47K tokens per session exploring files
With codesight:      AI reads ~3K-5K tokens (the compiled map)
With --wiki:         AI reads ~200 tokens at start + ~300 per targeted question

Base Scan Results

ProjectStackFilesRoutesModelsComponentsOutput TokensExploration TokensSavingsScan Time
SaaS AHono + Drizzle138381203,93646,02011.7x186ms
SaaS BHono + Drizzle, 3 workspaces53178103,62926,1307.2x201ms
SaaS CFastAPI + MongoDB4056004,16247,45011.4x890ms

SaaS C has 0 models because it uses MongoDB — no SQL ORM declarations for codesight to parse. This is correct detection, not a false negative.

Token comparison: Without codesight (46K-66K tokens) vs With codesight (3K-5K tokens)

Multi-Language OSS Benchmark (v1.6.7)

Tested against real open-source codebases spanning every supported language and framework. Output tokens are measured from actual file size. Exploration tokens are estimated (routes×400 + models×300 + components×250 + revisit multiplier). Zero false positives across all tests.

LanguageStackFilesRoutesModelsComponentsOutput tokensEst. explorationSavings
TypeScript · Next.jsNext.js + tRPC + Prisma · 110+ workspaces7,5094791731,309158,660~1,485,000~9x
TypeScript · NestJSNestJS + TypeORM + Mongoose16219805,300~67,500~12.7x
TypeScript · HonoHono—800——✓
TypeScript · RemixRemix + Prisma361109——✓
TypeScript · SvelteKitSvelteKit—0³023——✓
TypeScript · NuxtNuxt1418064——✓
JavaScript · ExpressExpress + Mongoose5110501,241~20,800~17x
Ruby · RailsRails + ActiveRecord4,172607116021,711~386,100~17.8x
PHP · LaravelLaravel + Eloquent3,89665259030,739~493,285~16x
Python · DjangoDjango + pyproject.toml4,2327¹56083,842~631,020~7.5x
Python · FlaskFlask + SQLAlchemy3012501,148~16,705~14.5x
Python · FastAPIFastAPI + SQLModel (monorepo)143212362,487~38,090~15.3x
Elixir · PhoenixPhoenix + Ecto1,4061985409,589~152,100~15.9x
Go · GinGin + GORM (enterprise app)388202169015,266~262,730~17.2x
Go · EchoEcho—700——✓
Go · FiberFiber—500——✓
Rust · Actixactix-web52830001,355~27,170~20x
Rust · AxumAxum—600——✓
C# · ASP.NETASP.NET Core + Entity Framework Core25613705,126~63,570~12.4x
Java · SpringSpring Boot + Java (Maven)471600319~13,208~41x²
Swift · SwiftUISwiftUI38800627,499~76,830~10.2x
Swift · VaporVapor backend29481006,146~95,160~15.5x
Dart · FlutterFlutter + go_router204100898,500~86,125~10.1x

¹ Django project is GraphQL-first — 7 REST utility endpoints detected accurately, 0 false positives. ² High ratio on small boilerplate: Spring Boot route metadata compresses very well. ³ SvelteKit RealWorld app uses page routes (+page.svelte), not JSON API endpoints (+server.ts). 0 routes is correct.

How exploration tokens are estimated: routes×400 + models×300 + components×250 + hot_files×150 + env_vars×30, times a 1.3 revisit multiplier, minus the output size. This approximates what an AI would spend asking "what routes exist?", "show me the schema", etc. in a manual exploration session. Output token count is the actual measured file size.

Wiki Breakdown (v1.6.2)

ProjectFull CODESIGHT.mdWiki index onlyIndex + 1 articleWiki articles generated
SaaS A3,936 tokens~200 tokens~550 tokens9
SaaS B3,629 tokens~200 tokens~440 tokens11
SaaS C4,162 tokens~200 tokens~360 tokens17

"How does auth work?" — without wiki: loads 3,945 tokens. With wiki: reads auth.md (~350 tokens). 11x improvement per targeted question, 84x total vs manual.

Detection Accuracy

Verified against actual source files. Route counts cross-checked against route definitions; schema models cross-checked against ORM table declarations.

ProjectRoute RecallSchema RecallFalse PositivesDetection Method
SaaS A38/43 (88%)12/12 (100%)0Schema: AST (Drizzle), Routes: AST (Hono)
SaaS B17/17 (100%)8/8 (100%)0Full AST (Hono + Drizzle + React)
SaaS C56/59 (~95%)0/0 (correct)0AST (FastAPI + MongoDB)

SaaS A's 5 missed routes use dynamic url.match(/pattern/) inside request handlers — a developer pattern that static analysis cannot resolve at scan time. This is an inherent limit of static analysis, not a framework gap. SaaS C missed an estimated 3 of 59 FastAPI routes. Zero false positives across all three projects.

Blast Radius Accuracy

Tested on a production SaaS: changing the database module correctly identified:

  • 5 affected files across API, auth, and server layers
  • All routes that touch the database
  • 12 affected models (complete schema)
  • BFS depth: 3 hops through the import graph

What Gets Detected

Measured across the three benchmark projects:

DetectorSaaS A (138 files)SaaS B (53 files)SaaS C (40 files)
Routes381756
Schema models1280
Components0100
Env vars12715
Hot files202020

How It Works

How codesight works: Codebase → AST Parser + Regex Fallback → Context Map → CLAUDE.md, .cursorrules, codex.md, MCP Server

8 parallel detectors: Routes, Schema, Components, Dep Graph, Middleware, Config, Libraries, Contracts

codesight runs all 8 detectors in parallel, then writes the results as structured markdown. The output is designed to be read by an AI in a single file load.

What It Generates

.codesight/
  CODESIGHT.md     Combined context map (one file, full project understanding)
  routes.md        Every API route with method, path, params, and what it touches
  schema.md        Every database model with fields, types, keys, and relations
  components.md    Every UI component with its props
  libs.md          Every library export with function signatures
  config.md        Every env var (required vs default), config files, key deps
  middleware.md    Auth, rate limiting, CORS, validation, logging, error handlers
  graph.md         Which files import what and which break the most things if changed
  cicd.md          GitHub Actions / CircleCI pipelines (when present)
  githooks.md      lefthook / husky / raw .git/hooks (when present)
  skills.md        .claude/commands + .claude/skills (when present)
  report.html      Interactive visual dashboard (with --html or --open)

The last three come from built-in plugins that scan the dotfile directories (.github/, .husky/, .claude/) the main pass skips. They run automatically and stay silent on projects without those files — so they only ever add a section when there's something to report.

AST Precision

When TypeScript is installed in the project being scanned, codesight uses the actual TypeScript compiler API to parse your code structurally. No regex guessing.

AST precision: TypeScript available → AST Parse, otherwise Regex fallback

What AST enablesRegex alone
Follows router.use('/prefix', subRouter) chainsMisses nested routers
Combines @Controller('users') + @Get(':id') into /users/:idMay miss prefix
Parses router({ users: userRouter }) tRPC nestingLine-by-line matching
Extracts exact Drizzle field types from .primaryKey().notNull() chainsPattern matching
Gets React props from TypeScript interfaces and destructuringRegex on { prop }
Detects middleware in route chains: app.get('/path', auth, handler)Not captured
Filters out non-route calls like c.get('userId')May false-positive

AST detection is reported in the output:

Analyzing... done (AST: 60 routes, 18 models, 16 components)

No configuration needed. If TypeScript is in your node_modules, AST kicks in automatically. Works with npm, yarn, and pnpm (including strict mode). Falls back to regex for non-TypeScript projects or frameworks without AST support.

AST-supported frameworks: Express, Hono, Fastify, Koa, Elysia (route chains + middleware), NestJS (decorator combining + guards), tRPC ( router nesting + procedure types), Drizzle (field chains + relations), TypeORM (entity decorators), React (props from interfaces + destructuring + forwardRef/memo).

Native-AST WASM plugins (opt-in)

By default codesight uses its built-in extractors (AST for TypeScript, regex for everything else). Opt in with --native-ast to specify that WebAssembly plugins should be used to acquire full-AST precision for non-TypeScript source files:

bash
npx codesight --native-ast                 # use every discovered plugin (additive)
npx codesight --native-ast=rust,go         # only these languages (authoritative for their files)
npx codesight --native-ast=none            # force off (overrides config)
npx codesight --native-ast-strict          # like --native-ast, but fail if a named plugin is missing
npx codesight --plugin-dir ./wasm          # extra directory to search for plugins

Dispatch to WASM plugins is language-driven: each plugin self-describes (via a describe() export) the file extensions it handles, so any language works — not just the ones with built-in detectors. Where no plugin handles a file, built-in extraction stands; with --native-ast unset, behavior is byte-identical to existing codesight behavior.

codesight's npm package ships no plugins — they are separate, opt-in artifacts. The project publishes prebuilt reference plugins (Rust/ syn, Python/ruff, Go/go/parser) as checksummed GitHub release assets; drop the ones you want to use into ~/.codesight/plugins/ (or point --plugin-dir at them), then enable them with --native-ast. Alternately, you may build your own plugin for any language against the contract.

→ Full contract, discovery rules, and download/install steps: docs/wasm-plugins.md.

Built-in plugins

Three first-party plugins run on every scan and surface context the main pass misses because it lives in skipped dotfile directories. Each is inert until its target files exist, so they cost nothing on projects that don't use them:

PluginReadsOutput
cicd.github/workflows/, .circleci/Pipeline triggers, jobs, secrets, deploy targets
githookslefthook / husky config, .git/hooks/Which commands run on which git lifecycle
skills.claude/commands/, .claude/skills/Available slash commands / agent skills + descriptions

Opt out of any of them per project:

js
// codesight.config.js
export default {disableDetectors: ["cicd", "githooks", "skills"]};

Terraform is opt-in, not auto-loaded — it deliberately reaches outside the scanned directory (sibling ../infrastructure repos) and is most useful with an explicit service name, so it stays off until you ask for it:

js
// codesight.config.js
import {createTerraformPlugin} from "codesight/plugins/terraform";

export default {plugins: [createTerraformPlugin({infraPath: "../infra"})]};

Routes

Not just paths. Methods, URL parameters, what each route touches (auth, database, cache, payments, AI, email, queues), and where the handler lives. Detects routes across 30+ frameworks automatically.

Example output:

markdown
- `GET` `/api/users/me` [auth, db, cache]
- `PUT` `/api/users/me` [auth, db]
- `POST` `/api/projects` [auth, db, payment]
- `GET` `/api/projects/:id` params(id) [auth, db]
- `POST` `/webhooks/stripe` [db, payment]
- `GET` `/health`

Schema

Models, fields, types, primary keys, foreign keys, unique constraints, relations. Parsed directly from your ORM definitions via AST. No need to open migration files.

Example output:

markdown
### user

- id: text (pk)
- name: text (required)
- email: text (unique, required)
- role: text (default, required)
- stripeCustomerId: text (fk)

### project

- id: uuid (default, pk)
- ownerId: text (fk, required)
- name: text (required)
- settings: jsonb (required)
- _relations_: ownerId -> user.id

Dependency Graph

The files imported the most are the ones that break the most things when changed. codesight finds them and tells your AI to be careful.

Example output:

markdown
## Most Imported Files (change these carefully)

- `src/types/index.ts` — imported by **20** files
- `src/db/index.ts` — imported by **12** files
- `src/lib/auth.ts` — imported by **8** files
- `src/lib/cache.ts` — imported by **6** files
- `src/lib/env.ts` — imported by **5** files

Blast Radius

Blast radius: changing src/db/index.ts ripples through 10 files across 3 hops

BFS through the import graph finds all transitively affected files, routes, models, and middleware.

bash
npx codesight --blast src/db/index.ts

Example output:

  Blast Radius: src/db/index.ts
  Depth: 3 hops

  Affected files (10):
    src/api/users.ts
    src/api/projects.ts
    src/api/webhooks.ts
    src/auth/session.ts
    src/jobs/notifications.ts
    src/server.ts
    src/auth/index.ts
    src/jobs/cron.ts
    src/cli.ts
    src/index.ts

  Affected routes (33):
    GET /api/users/me — src/api/users.ts
    POST /api/projects — src/api/projects.ts
    POST /webhooks/stripe — src/api/webhooks.ts
    ...

  Affected models: user, session, account, project,
    subscription, notification, audit_log

Your AI can also query blast radius through the MCP server before making changes.

Environment Audit

Every env var across your codebase, flagged as required or has default, with the exact file where it is referenced.

Example output:

markdown
- `DATABASE_URL` **required** — .env.example
- `REDIS_URL` (has default) — .env.example
- `STRIPE_SECRET_KEY` **required** — src/lib/payments.ts
- `STRIPE_WEBHOOK_SECRET` **required** — .env.example
- `RESEND_API_KEY` **required** — .env.example
- `JWT_SECRET` **required** — src/lib/auth.ts

Token Benchmark

See exactly where your token savings come from:

bash
npx codesight --benchmark

Example output (SaaS A — 138 files, Hono + Drizzle):

  Token Savings Breakdown:
  ┌──────────────────────────────────────────────────┐
  │ What codesight found         │ Exploration cost   │
  ├──────────────────────────────┼────────────────────┤
  │  38 routes                   │ ~15,200 tokens     │
  │  12 schema models            │ ~ 3,600 tokens     │
  │   0 components               │       0 tokens     │
  │  30 library files            │ ~ 6,000 tokens     │
  │  12 env vars                 │ ~ 1,200 tokens     │
  │   5 middleware               │ ~ 1,000 tokens     │
  │  20 hot files                │ ~ 3,000 tokens     │
  │ 138 files (search overhead)  │ ~11,040 tokens     │
  ├──────────────────────────────┼────────────────────┤
  │ codesight output             │ ~ 3,936 tokens     │
  │ Manual exploration (1.3x)    │ ~46,020 tokens     │
  │ SAVED PER CONVERSATION       │ ~42,084 tokens     │
  └──────────────────────────────┴────────────────────┘

How Token Savings Are Calculated

Each detector type maps to a measured token cost that an AI would spend to discover the same information manually:

What codesight findsTokens saved per itemWhy
Each route~400 tokensAI reads the handler file, greps for the path, reads middleware
Each schema model~300 tokensAI opens migration/ORM files, parses fields manually
Each component~250 tokensAI opens component files, reads prop types
Each library export~200 tokensAI greps for exports, reads signatures
Each env var~100 tokensAI greps for process.env, reads .env files
Each file scanned~80 tokensAI runs glob/grep operations to find relevant files

The 1.3x multiplier accounts for AI revisiting files during multi-turn conversations. These estimates are conservative. A developer manually verified that Claude Code spends 40-70K tokens exploring the same projects that codesight summarizes in 3-5K tokens.

Roku / BrightScript / SceneGraph

codesight treats Roku channels as first-class projects. The manifest file at the channel root anchors detection — the same file Roku itself uses to identify a channel, so zero configuration is needed for the common case.

Standard single-channel layout (about 90% of Roku repos, matches the Roku docs' getting-started template and projects like rokucommunity/brighterscript-template):

/
  manifest
  source/         # Main.brs + shared .brs libraries
  components/     # *.xml + paired *.brs component handlers
  images/

codesight also recognizes the rokucommunity/brighterscript-template layout where the channel lives under src/ and the root carries a bsconfig.json for BrighterScript tooling.

Multi-channel monorepo layout (less common — used by larger codebases that ship several branded channels from one repo with roku-deploy + gulp to merge a shared common/ layer with per-channel assets at build time):

/
  package.json      # depends on roku-deploy, gulp
  gulpfile.js
  src/apps/
    common/         # shared layer, merged into every channel at build
    creatorA/
      manifest
    creatorB/
      manifest

This is detected via a strict structural signal: no manifest at root, roku-deploy in deps, and a common/ directory with at least 2 sibling directories that each have their own manifest. When the signal matches, each channel (plus common/) is registered as a workspace.

Mappings to codesight's data model

codesight conceptRoku equivalent
RoutesScreens — every child element with an id declared in the Scene XML's <children>. method = VIEW by default, upgraded to MODAL if a navigation call-site passes a literal true as the second argument.
SchemaEvery SceneGraph component XML whose <interface> has at least one <field> — the typed contract is the model.
ComponentsEvery <component name="..." extends="..."> XML (views, tasks, scenes, modals). Props = interface fields.
Libraries.brs / .bs files outside components/ — top-level function/sub plus BrighterScript class / namespace / enum / interface.
MiddlewareobserveField subscriptions, m.global.AddField registrations. BugsnagTask / RudderstackTask recognized when present.
Dependencies<script uri="pkg:/..." /> includes in component XML + import "pkg:/..." in .bs.
EventsObserved fields (system: scenegraph-observer) and Rudderstack event names (system: rudderstack).
ConfigThe Roku manifest key/value lines surfaced as manifest.<name> pseudo env-vars.

Configurable navigation helpers

Many Roku projects use a custom helper to switch the visible screen (names vary: ShowScreen, pushScreen, NavigateTo, showView, etc.). These are used as optional enrichment to tag routes as MODAL. Defaults cover the common conventions; override with rokuScreenHelpers in your codesight config if your project uses a different name:

json
{
  "rokuScreenHelpers": [
    "Router.push",
    "openScreen"
  ]
}

Routes are still detected from <children> even when no helper is present or when no call-site matches.

Example output

markdown
- `VIEW` `/homeView` — components/views/HomeView.xml
- `VIEW` `/detailView` — components/views/DetailView.xml
- `MODAL` `/errorModal` — components/modals/ErrorModal.xml

### DataTask

- requestUrl: string
- response: object

Supported Stacks

CategorySupported
RoutesHono, Express, Fastify, Next.js (App + Pages), Koa, NestJS, tRPC, Elysia, AdonisJS, SvelteKit, Remix, Nuxt, FastAPI, Flask, Django, Go (net/http, Gin, Fiber, Echo, Chi), Rails, Phoenix, Spring Boot, Ktor, Actix, Axum, Laravel, ASP.NET Core (controllers + minimal API), Vapor, Flutter (go_router), Roku SceneGraph (screens via ShowScreen), raw http.createServer
EventsBullMQ queues, Celery tasks, Kafka topics, Redis pub/sub, Socket.io, EventEmitter, SceneGraph observers, Rudderstack
SchemaDrizzle, Prisma, TypeORM, Mongoose, Sequelize, SQLAlchemy, Django ORM, ActiveRecord, Ecto, Eloquent, Entity Framework, Exposed, Room, SceneGraph <interface> contracts (14 ORMs)
ComponentsReact, Vue, Svelte, Flutter widgets (StatelessWidget, StatefulWidget, ConsumerWidget), SwiftUI views (auto-filters shadcn/ui and Radix primitives), Roku SceneGraph components
LibrariesTypeScript, JavaScript, Python, Go, Dart, Swift, C#, PHP, BrightScript, BrighterScript (exports with function signatures)
MiddlewareAuth, rate limiting, CORS, validation, logging, error handlers, SceneGraph observers + m.global fields
DependenciesImport graph with hot file detection (most imported = highest blast radius); SceneGraph <script uri="pkg:/..."> and BrighterScript import statements
ContractsURL params, request types, response types from route handlers
Monorepospnpm, npm, yarn workspaces + mixed-language workspaces (e.g. Next.js + Laravel, SwiftUI + Vapor, Roku multi-channel under src/apps/<creator>/)
LanguagesTypeScript, JavaScript, Python, Go, Ruby, Elixir, Java, Kotlin, Rust, PHP, Dart, Swift, C#, BrightScript/BrighterScript

AI Config Generation

bash
npx codesight --init

Generates ready-to-use instruction files for every major AI coding tool at once:

FileTool
CLAUDE.mdClaude Code
.cursorrulesCursor
.github/copilot-instructions.mdGitHub Copilot
codex.mdOpenAI Codex CLI
AGENTS.mdOpenAI Codex agents

Each file is pre-filled with your project's stack, architecture, high-impact files, and required env vars. Your AI reads it on startup and starts with full context from the first message.

MCP Server (14 Tools)

bash
npx codesight --mcp

Runs as a Model Context Protocol server. Claude Code and Cursor call it directly to get project context on demand.

json
{
  "mcpServers": {
    "codesight": {
      "command": "npx",
      "args": [
        "codesight",
        "--mcp"
      ]
    }
  }
}

OpenAI Codex CLI (~/.codex/config.toml):

toml
[mcp_servers.codesight]
command = "npx"
args = ["codesight", "--mcp"]
startup_timeout_sec = 60

Codex timeout note: npx has to resolve the package on first run which can exceed the default 30-second timeout. Set startup_timeout_sec = 60 or install globally (npm install -g codesight) and use command = "codesight" instead — global installs start significantly faster.

MCP Server: Claude Code/Cursor ↔ codesight MCP Server → specialized tools + session cache

ToolWhat it does
codesight_get_wiki_indexWiki catalog (~200 tokens) — read at session start
codesight_get_wiki_articleRead one wiki article by name: auth, database, payments, etc.
codesight_lint_wikiHealth check: orphan articles, missing cross-links
codesight_scanFull project scan (~3K-5K tokens)
codesight_get_summaryCompact overview (~500 tokens)
codesight_get_routesRoutes filtered by prefix, tag, or method
codesight_get_schemaSchema filtered by model name
codesight_get_blast_radiusImpact analysis before changing a file
codesight_get_envEnvironment variables (filter: required only)
codesight_get_hot_filesMost imported files with configurable limit
codesight_get_eventsBackground events: BullMQ queues, Celery tasks, Kafka topics, Redis pub/sub, EventEmitter
codesight_get_coverageTest coverage map: which routes and models have test files
codesight_get_knowledgeKnowledge map from --mode knowledge: decisions, open questions, themes, note index
codesight_refreshForce re-scan (results are cached per session)

Your AI asks for exactly what it needs instead of loading the entire context map. Session caching means the first call scans, subsequent calls return instantly.

AI Tool Profiles

bash
npx codesight --profile claude-code
npx codesight --profile cursor
npx codesight --profile codex
npx codesight --profile copilot
npx codesight --profile windsurf

Generates an optimized config file for a specific AI tool. Each profile includes your project summary, stack info, high-impact files, required env vars, and tool-specific instructions on how to use codesight outputs. For Claude Code, this includes MCP tool usage instructions. For Cursor, it points to the right codesight files. Each profile writes to the correct file for that tool.

Visual Report

bash
npx codesight --open

Opens an interactive HTML dashboard in your browser. Routes table with method badges and tags. Schema cards with fields and relations. Dependency hot files with impact bars. Env var audit. Token savings breakdown. Useful for onboarding or just seeing your project from above.

GitHub Action

Add to your CI pipeline to keep context fresh on every push:

yaml
name: codesight
on: [ push ]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm install -g codesight && codesight
      - uses: actions/upload-artifact@v4
        with:
          name: codesight
          path: .codesight/

Watch Mode and Git Hook

Watch mode re-scans automatically when your code changes:

bash
npx codesight --watch

Only triggers on source and config files (.ts, .js, .py, .go, .prisma, .env, etc.). Ignores node_modules, build output, and non-code files. Shows which files changed before each re-scan. Your config (disabled detectors, plugins) is preserved across re-scans.

Git hook regenerates context on every commit:

bash
npx codesight --hook

Context stays fresh without thinking about it.

All Options

bash
npx codesight                              # Scan current directory
npx codesight ./my-project                 # Scan specific directory
npx codesight --wiki                       # Generate wiki knowledge base
npx codesight --init                       # Generate AI config files
npx codesight --open                       # Open visual HTML report
npx codesight --html                       # Generate HTML report without opening
npx codesight --mcp                        # Start MCP server (14 tools)
npx codesight --blast src/lib/db.ts        # Show blast radius for a file
npx codesight --profile claude-code        # Optimized config for specific tool
npx codesight --watch                      # Watch mode (add --wiki to auto-regenerate wiki)
npx codesight --wiki --watch               # Watch + auto-regenerate wiki on changes
npx codesight --hook                       # Install git pre-commit hook (includes wiki)
npx codesight --benchmark                  # Detailed token savings breakdown
npx codesight --json                       # Output as JSON
npx codesight --mode knowledge             # Map .md knowledge base → KNOWLEDGE.md
npx codesight --mode knowledge ~/vault     # Map Obsidian vault or any .md folder
npx codesight --max-tokens 50000           # Trim output to fit token budget
npx codesight --since HEAD~5               # Show routes from last 5 commits only
npx codesight -o .ai-context               # Custom output directory
npx codesight -d 5                         # Limit directory depth

How It Compares

codesightFile concatenation toolsAST-based tools (e.g. code-review-graph)
ParsingAST (TypeScript compiler) + regex fallbackNoneTree-sitter + SQLite
Token reduction7x-12x base scan; 60-131x with targeted wiki queries1x (dumps everything)8x reported
Route detection30+ frameworks, auto-detectedNoneLimited
Schema parsing14 ORMs with field types and relationsNoneVaries
Blast radiusBFS through import graphNoneYes
AI tool profiles5 tools (Claude, Cursor, Codex, Copilot, Windsurf)NoneAuto-detect
MCP tools14 specialized tools with session cachingNone22 tools
Setupnpx codesight (zero deps, zero config)Copy/pastepip install + optional deps
DependenciesZero (borrows TS from your project)VariesTree-sitter, SQLite, NetworkX, etc.
LanguageTypeScript (zero runtime deps)VariesPython
Scan time185-290ms (small), 0.9-2.8s (10K files)VariesUnder 2s reported

cod

将 codesight MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 codesight 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 codesight 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 codesight MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "codesight": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 codesight MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 codesight MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 codesight 帮我完成这项任务吗?
codesight
当然。我已阅读。
以下是我使用 codesight 得到的结果。

常见问题

codesight MCP 服务器有什么用途?

codesight 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 codesight MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 codesight,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 codesight MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 codesight 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 codesight MCP 连接到 TypingMind?

codesight 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

codesight MCP 在 TypingMind 中提供哪些工具?

codesight 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 codesight MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 codesight 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇