npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

codegraphx

v1.0.5

Published

<h1 align="center">CodeGraphX</h1>

Readme


A local, token-efficient, dynamic codebase graph system designed specifically for AI coding agents (like Gemini CLI, Claude Code, Cursor) and human developers.

Its core purpose is to solve the problem of AI agents having to constantly re-scan files to understand a codebase. Instead, CodeGraphX uses Tree-sitter to incrementally parse code (Python, JS, TS, HTML, CSS) and builds a virtual dependency graph. It outputs highly compressed files in the TOON (Token-Oriented Object Notation) format and a Bloom filter for instant O(1) symbol lookup.

This project is built purely in Node.js. No Python environment is required to use it, even though it can parse Python code!

Installation

Install CodeGraphX globally via npm so you can use the CLI anywhere, or install it as a development dependency in your project.

npm install -g codegraphx

Standalone Usage (CLI)

CodeGraphX can be used as a standalone tool to visualize and query your codebase's structure.

Simple Example

Navigate to your project directory and initialize the graph:

cd my-project
codegraphx init

This will parse your codebase and generate the initial graph inside the .codegraphx/ directory.

You can then query the graph. For example, to find out what depends on a function named calculateTotal:

codegraphx query calculateTotal
# Or, trace its entire downstream impact:
codegraphx impact calculateTotal --direction downstream

To see a live, real-time visualization of your codebase in your browser:

codegraphx watch
codegraphx dashboard

Key Commands

  • codegraphx init: Parses the codebase and generates the initial graph.
  • codegraphx watch: Starts the file watcher for real-time live graph updates.
  • codegraphx query <symbol>: Show details (files, edges, calls, called_by) for a specific symbol.
  • codegraphx impact <symbol>: Trace all symbols directly or indirectly impacted by a given symbol.
  • codegraphx dashboard: Opens a live interactive HTML graph visualization in your default browser.
  • codegraphx stats: Prints graph statistics (files, symbols, edges).

Usage with AI Coding Agents (MCP Server)

CodeGraphX includes an MCP (Model Context Protocol) Server. This is where it truly shines. Instead of the AI agent blindly reading raw source files, it can use the cgx-mcp server to intelligently query your codebase structure, saving thousands of tokens and eliminating "cold start" scanning time.

The MCP server provides tools to the AI like get_graph_status, list_files, query_symbol, check_symbol_exists, and trace_impact.

Claude Desktop Configuration

To use CodeGraphX with Claude Desktop, add the following to your claude_desktop_config.json (usually located at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "codegraphx": {
      "command": "npx",
      "args": ["-y", "codegraphx", "cgx-mcp"]
    }
  }
}

Note: The command assumes you are running Claude Desktop within the context of a project directory where codegraphx should analyze the code.

Gemini CLI Configuration

To use CodeGraphX with Gemini CLI, you can set up a custom MCP server in your workspace's .gemini/mcp.json configuration:

{
  "mcpServers": {
    "codegraphx": {
      "command": "npx",
      "args": ["codegraphx", "cgx-mcp"]
    }
  }
}

Once configured, simply tell your agent: "Use the CodeGraphX MCP server to find where the authenticateUser function is defined and what other functions call it." The agent will instantly traverse the graph instead of using expensive file grep searches.