SuperAPI AI Directory

codesight

CLI token optimizer and AI context generator with built-in MCP server. Scans codebases to extract routes, schema, components, and dependencies, reducing AI context tokens by 9x–13x. Profiles for Claude Code, Cursor, Copilot, Codex, and Windsurf. Zero runtime dependencies.

Open website

About this tool

Purpose

codesight is used to generate project context for AI coding assistants, avoiding the need for AI to spend a large number of tokens exploring the codebase structure in every conversation. It statically scans code, extracts information such as routes, database models, components, dependency graphs, and environment variables, and outputs it as a structured markdown file for AI to read in one go.

Main Capabilities

  • Multi-language and framework support: Supports TypeScript, JavaScript, Python, Go, Ruby, Elixir, Java, Kotlin, Rust, PHP, Dart, Swift, C#, and Roku's BrightScript/BrighterScript. Built-in 30+ framework detectors and 14 ORM parsers.
  • AST precision: When TypeScript is installed in the project, it automatically uses the TypeScript compiler API for structured parsing; other languages use regex detection.
  • Route extraction: Identifies route methods, URL parameters, the features involved (authentication, database, caching, payments, AI, email, queues), and handler locations.
  • Schema parsing: Parses models, fields, types, primary keys, foreign keys, unique constraints, and relationships from ORM definitions.
  • Dependency graph and blast radius: Finds the most imported files, and uses BFS traversal of the import graph to calculate the files, routes, models, and middleware affected when a file is modified (blast radius).
  • Environment variable audit: Lists all environment variables in the codebase, marks whether they are required or have default values, and indicates the referencing files.
  • Wiki knowledge base (v1.6.2): Generates a persistent knowledge base in .codesight/wiki/, compiled by AST rather than an LLM, with zero API calls, completing in about 200ms. Supports --watch for automatic updates and --hook to regenerate on every commit.
  • Knowledge Mode (v1.9.3): --mode knowledge can map decision records, meeting notes, ADRs, retrospective documents, etc., automatically detecting Obsidian vaults, Notion exports, ADR tools, and arbitrary markdown folders, and outputs .codesight/KNOWLEDGE.md.
  • MCP server: Provides 14 MCP tools. Claude Code and Cursor can call them directly to obtain project context on demand, with session caching.
  • Built-in plugins: Three first-party plugins run on every scan, scanning dotfile directories such as .github/, .husky/, and .claude/; the Terraform plugin is enabled selectively.
  • AI configuration file generation: Generates instruction files with prefilled project stack, architecture, high-impact files, and environment variables for major AI coding tools.
  • Interactive HTML dashboard: Displays route tables, schema cards, dependency hotspots, environment variable audits, and token savings details.
  • CI integration, Watch mode, Git Hook: Keeps context up to date in CI pipelines, watch mode automatically rescans when source code or configuration files change, and the git hook regenerates context on every commit.
  • Native AST WASM plugin (optional): Enables the WebAssembly plugin via --native-ast, providing full AST precision for non-TypeScript files; the plugin is not built in and must be downloaded from the GitHub release and placed in ~/.codesight/plugins/ or a specified --plugin-dir.

Usage

Run the npx command once in any project root directory; no configuration and no API key are required. The official materials do not provide complete instructions for specific installation and run commands, so they are not provided here for now. Supports npm, yarn, and pnpm (including strict mode). You can use --watch to keep the wiki updated, --hook to regenerate on commit, --mode knowledge to process knowledge documents, and --native-ast to enable the WASM plugin.

Applicable Scenarios

  • Developers using AI coding tools such as Claude Code, Cursor, GitHub Copilot, OpenAI Codex, Windsurf, Cline, and Aider who want to reduce token consumption in each conversation.
  • Project onboarding where there is a need to quickly understand a large codebase.
  • Automatically maintaining project context in CI.
  • Roku channel development (including single-channel and multi-channel monorepo layout).

Limitations

  • Static analysis cannot resolve dynamic url.match(/pattern/) patterns inside request handlers, so some routes may be missed.
  • Non-TypeScript projects or frameworks without AST support use regex detection, which is less accurate than AST.
  • The native AST WASM plugin requires additional download and configuration, and you must verify the checksum yourself.
  • The full list of specifically supported frameworks and ORMs, the complete list of MCP tools, and the detailed contents of each AI tool profile are not listed item by item in the official materials and are not yet provided.
  • Information such as fees, pricing, and platform is not provided.