Skip to main content
Glama

CodeSight is a local-first GraphRAG code comprehension and diagnostic engine for AI-assisted coding.

As AI agents edit across dozens of files, two failure modes appear repeatedly: losing track of architecture and silent regressions (removing validation guards, swallowing exceptions with empty catch {}, or hiding type errors with as any). CodeSight builds a deterministic AST call graph and dependency map locally in milliseconds, intercepts silent regressions with zero LLM tokens, and renders clean interactive visual cards directly inside your AI agent or as a native macOS Floating HUD.


Live Preview


Related MCP server: localscope-mcp

Who Is CodeSight For?

CodeSight bridges the gap between visual product thinking and precise code-level debugging:

  • Product Managers, Designers & Non-Technical Builders (Vibe Coders)

    • Grasp the overall repository structure in seconds without reading raw source code.

    • See which frontend components control what appears on screen — click any UI file to preview its inferred wireframe prototype (page, modal, HUD, card) and relationships.

    • Spot which backend and shared modules are Core hubs (high downstream usage) so you know what is safe to tweak vs. what needs extra care before prompting an AI agent.

  • Engineers & Full-Stack Developers

    • Jump straight from a compiler/runtime error or git diff to the exact code block, line range, and cross-file AST callers involved.

    • Inspect blast radius (direct & indirect downstream impact) and safe zone count before modifying shared types, schemas, or APIs.

    • Catch silent regressions (as any, empty catch {}, removed auth/validation guards) deterministically with 0 LLM tokens, and choose between a minimal backward-compatible fix or a coordinated multi-file update.


What CodeSight Does on Top of GraphRAG

Instead of feeding raw chunks of text into an LLM, CodeSight runs a deterministic 5-stage local GraphRAG pipeline over your repository:

  1. Incremental AST & Multi-Language Parsing (astParser.ts, repoIndexer.ts) Parses TypeScript / JavaScript / TSX / JSX with the real TypeScript Compiler API (eliminating regex false positives) alongside a Python relative/dotted import & call parser, with SHA-256 hash caching in .codesight/index.json for millisecond incremental updates.

  2. Dual-Layer Graph Construction (codeGraph.ts, graphProvider.ts, mcpGraphProvider.ts) Builds both a File Dependency Graph (in-degree, out-degree, transitive downstream reach, Core-hub detection) and a Cross-File Symbol Call Graph (exact function, class, and React JSX component callers with line numbers), with pluggable external stdio Graph-RAG MCP support.

  3. Hybrid Retrieval with Reciprocal Rank Fusion (embeddingIndex.ts) Combines Okapi BM25 + bilingual semantic vectors + 1-hop graph propagation (with barrel index.ts damping) to surface the exact minimal code slice — typically reducing whole-repo LLM context by ~97%.

  4. Semantic Architecture & Prototype Abstraction (architecturePlanner.ts, visualMap.ts) Transforms raw graph nodes into human-readable Frontend / Backend / Shared vertical layers, plain-language roles, and auto-inferred UI wireframe / API flow prototypes — powered by 0-token heuristics, host-agent architectureOverride caching, or optional BYOK LLM planning.

  5. Deterministic Error Projection & Silent Regression Guard (staticAnalyzer.ts, comprehensionEngine.ts) Strips stack-trace noise, projects errors and git diff hunks onto exact AST symbols and blast radius, flags REMOVED_GUARD / SWALLOWED_ERROR / TYPE_ESCAPE_HATCH at 0 tokens, and generates scoped architectural fix options for your AI agent.


Why CodeSight

Capability

Raw AI Agent

With CodeSight

Understanding an unfamiliar repo

Burns 25k–60k tokens skimming files

Incremental AST + dependency map in ~25ms (0 LLM tokens)

Checking who calls a shared type/fn

Text grep, often misses re-exports or JSX callers

Deterministic cross-file AST symbol call graph (codesight_trace)

Debugging multi-file errors

Blind trial-and-error loops

Projects stack trace onto dependency graph (~97% token reduction)

Catching silent regressions

Frequently passes build via as any or empty catch

Instant 0-token diff guard flags REMOVED_GUARD, SWALLOWED_ERROR, TYPE_ESCAPE_HATCH

Human visibility in chat

Walls of markdown text

Collapsible, bilingual interactive cards with UI wireframes & directional dashed flows


Product Tour

1. Layered Architecture & Directional Flow Lines

Automatically detects Frontend, Backend, and Shared / Core separation across TypeScript, JavaScript, and Python repositories. Hover any file to trace its exact 1-hop dependencies (blue dashed) and impacted consumers (amber/red dashed).

2. Inspect Prototypes & Direct Callers Without Opening 40 Tabs

Click any module to open a frosted detail sheet with an auto-inferred UI wireframe or flow prototype, direct caller count, clickable Uses ↗ / Used by ↗ navigation chips, and one-click scoped AI edit/explain prompts.

3. Error Blast Radius & Guided Fix Directions

When a build or runtime error occurs, CodeSight highlights the fault origin in red, draws impacted downstream links, catches silent regressions, and presents a clean 2-option decision fork (e.g., keep exports compatible vs cascade update all callers) before the AI touches shared code.

4. Collapsible Cards & Unified Settings Across Agents and macOS HUD

Built for long debugging threads: click the top bar or chevron to collapse any card into a 44px single-line bar (with an inline fault badge), or open ⚙ Settings to customize language (EN / 中文), dashed lines, default-collapsed mode, regression guard, and optional BYOK models — persisted to ~/.codesight/config.json and shared with the native macOS HUD.


Ecosystem Compatibility

Client / Environment

Transport

Interactive Board

Setup Command

Antigravity

Native Plugin + MCP Apps (stdio)

Inline Chat Cards

node packages/cli/dist/cli.js install --target antigravity

Cursor

MCP (stdio)

Browser Board + Text

node packages/cli/dist/cli.js install --target cursor

Claude Code

MCP (stdio)

Browser Board + Text

node packages/cli/dist/cli.js install --target claude-code

Claude Desktop

MCP Apps (stdio)

Inline Chat Cards

node packages/cli/dist/cli.js install --target claude-desktop

VS Code / Copilot

MCP (stdio)

Browser Board + macOS HUD

node packages/cli/dist/cli.js install --target vscode

OpenAI Codex CLI

MCP (stdio)

Browser Board + Text

node packages/cli/dist/cli.js install --target codex

ChatGPT Apps / Remote

Streamable HTTP (/mcp)

Inline MCP Apps

npm run mcp:http

macOS Floating HUD

Local Sidecar (127.0.0.1:4317)

Native SwiftUI Window

npm run hud:open


Quick Start

1. Clone & Build

git clone https://github.com/Rex16200513/codesight.git
cd codesight
npm install && npm run build

2. Install Into Your AI Agent

# Install for a specific agent (add --global for user-wide config, --dry-run to preview)
node packages/cli/dist/cli.js install --target cursor
node packages/cli/dist/cli.js install --target claude-code
node packages/cli/dist/cli.js install --target antigravity

# Or configure all supported agents at once
node packages/cli/dist/cli.js install --target all --dry-run

3. Open the Interactive Visual Board in Your Browser

# Generate and open a standalone interactive board for any local repo
node packages/cli/dist/cli.js map --open

# Or run the local Sidecar for live updates + persistent in-card settings (http://127.0.0.1:4317)
npm run dev:sidecar

4. Optional: Launch the Native macOS Floating HUD (For VS Code / IDE Users)

npm run hud:open

MCP Tools & CLI Reference

MCP Tool

CLI Equivalent

What It Does

codesight_map

npm run cs -- map [dir] [--open]

Incremental AST + dependency map & interactive architecture board

codesight_ask

npm run cs -- ask "<query>" [dir]

Hybrid BM25 + bilingual vector + 1-hop dependency graph RRF search

codesight_trace

npm run cs -- trace <symbol> [dir]

Cross-file AST caller & callee trace for any function, class, or component

codesight_diagnose

npm run cs -- diagnose --error "..." | --git

Blast radius, safe zone count, silent regression guard, and fix directions

codesight_settings

npm run cs -- config [show|set|reset]

Read/write unified preferences in ~/.codesight/config.json

Unified Configuration (~/.codesight/config.json)

npm run cs -- config set language en
npm run cs -- config set dashedLines hover
npm run cs -- config set collapsedByDefault true
npm run cs -- config set silentRegressionGuard true

Architecture

flowchart LR
  Repo["Local Repository (TS / JS / Python)"] --> Core["@codesight/core\nAST + Python Parser · Call Graph · RRF · Guard"]
  Config["~/.codesight/config.json"] --> Core
  Core --> MCP["@codesight/mcp-server\nStdio & Streamable HTTP /mcp + MCP App Cards"]
  Core --> Sidecar["@codesight/sidecar\nHTTP / SSE Bridge & Browser Board :4317"]
  Core --> CLI["@codesight/cli\nInstaller & CLI"]
  MCP --> Agents["AI Agents\nAntigravity · Cursor · Claude · Codex · ChatGPT"]
  Sidecar --> HUD["Native macOS HUD\nSwiftUI Always-on-Top Floating Panel"]
assets/            Brand identity (logo.svg, codesight-logo.png, promo video, screenshots)
packages/
  core/            TS Compiler AST & Python parser, dependency/call graph, hybrid RRF, config store
  mcp-server/      Stdio + Streamable HTTP (/mcp) server & Apple-minimalist MCP App cards
  cli/             CLI (map, ask, trace, diagnose, config, install)
  sidecar/         Local HTTP/SSE engine bridge & browser visual board (port 4317)
  ui/              Shared React HUD components
apps/
  macos-hud/       Native Swift 6 + SwiftUI/AppKit floating HUD (arm64 macOS)
plugins/
  codesight/       Antigravity & Claude Code native plugin bundle (SKILL.md + AGENTS.md)

Privacy & Local-First Design

  • Zero cloud lock-in: Indexing, AST parsing, dependency graphs, hybrid search, and silent regression detection run 100% locally with zero API keys required.

  • Optional BYOK: Only if you explicitly enable BYOK in Settings (OpenAI, DeepSeek, Gemini via OpenRouter, or local Ollama) are pruned code slices sent to your configured endpoint.

  • Pluggable External Graph-RAG: Supports attaching external stdio MCP graph servers via --mcp-cmd / CODESIGHT_MCP_GRAPH_CMD.

License

MIT © 2026 CodeSight Contributors

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides a dependency graph of any local repository with tools for change impact, transitive dependents, health audits, and more, enabling AI coding agents to see structure and refactor safely.
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to analyze a local codebase and answer impact questions like 'what breaks if I change Y?' through local indexing, search, and reverse dependency analysis, with no code leaving the machine.
      4
      5 npm
      1
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to interrogate a local repository deterministically for symbols, dependencies, call paths, routes, tests, and Git impact, returning verified structured evidence with exact line citations instead of requiring the whole codebase to be read.
      79 PyPI
      4
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI coding agents and developers to search code by meaning and exact text, map symbols, dependencies, blast radius and context, inspect git-change impacts, and trace live Python or JavaScript execution from a local air-gapped SQLite index.
      Apache 2.0