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

@tienmanh/codegraph

v0.1.7

Published

Workspace-aware semantic code intelligence with safer local-first installer defaults.

Readme

CodeGraph

Semantic code search and project context for AI coding agents.

CodeGraph indexes your source code into a local graph database. After indexing, you can search symbols, inspect project structure, and generate focused context for coding agents without asking them to scan the whole repository again and again.

Published package: @tienmanh/codegraph

Why Use It

  • Understand a codebase faster.
  • Find functions, classes, routes, and files by name or meaning.
  • Give AI agents focused context before they edit code.
  • Inspect callers, callees, related symbols, and change impact through MCP.
  • Keep the index local in .codegraph/.
  • Use it with one repository or a multi-project workspace.

CodeGraph works best with MCP-compatible coding agents such as Claude Code, Cursor, Codex CLI, and opencode.

Requirements

  • Node.js >=20 <25
  • npm
node --version
npm --version

Install

Install globally:

npm install -g @tienmanh/codegraph
codegraph --help

Run without global install:

npx @tienmanh/codegraph --help

Upgrade:

npm install -g @tienmanh/codegraph@latest

Uninstall:

npm uninstall -g @tienmanh/codegraph

Quick Start

Initialize CodeGraph in a project:

cd your-project
codegraph init -i
codegraph status

Search indexed code:

codegraph query "PaymentService"
codegraph files

Build context for an AI task:

codegraph context "How does authentication work?"

Refresh the index after code changes:

codegraph sync

Rebuild the full index:

codegraph index

Remove CodeGraph data from the project:

codegraph uninit

Use With AI Agents

Install CodeGraph MCP configuration for the current project:

codegraph install --location local --target auto

Restart your agent after installation.

Once installed, your agent can use CodeGraph to search symbols, read focused code context, inspect callers/callees, list files, and check change impact. MCP tools auto-sync changed files before each index query by default, so agent queries see recently edited, added, or removed source files without a manual codegraph sync.

Preview installer changes before writing files:

codegraph install --location local --target auto --dry-run

Remove CodeGraph-owned agent configuration:

codegraph uninstall --location local --target auto

MCP Auto-Sync

Auto-sync is enabled by default when CodeGraph is installed or updated. It does not run a background watcher; each MCP query checks the selected project for changed source files, syncs only the affected files, then reads the index. In git projects, the check forces git status --untracked-files=all so new source files are detected even when they live inside a brand-new directory or the repo hides untracked files by default. When a workspace project lives inside a parent git repository, CodeGraph normalizes git paths back to the child project root before deciding what to sync. If the child project has its own .git, CodeGraph uses that child git root directly.

Default settings:

CODEGRAPH_AUTO_SYNC=query
CODEGRAPH_AUTO_SYNC_TTL_MS=0
CODEGRAPH_WORKSPACE_SYNC_CONCURRENCY=2

Useful overrides:

# Disable MCP auto-sync for debugging or benchmarks
CODEGRAPH_AUTO_SYNC=off

# Skip repeated checks for this many milliseconds
CODEGRAPH_AUTO_SYNC_TTL_MS=1000

# Limit concurrent project refreshes in workspace mode
CODEGRAPH_WORKSPACE_SYNC_CONCURRENCY=1

CLI commands still stay explicit: use codegraph sync or codegraph workspace sync when you want to refresh outside MCP.

Workspace Basics

Use workspace mode when one folder contains multiple projects:

cd your-workspace
codegraph workspace init
codegraph workspace discover
codegraph workspace index
codegraph workspace status

Each enabled child project gets its own .codegraph/codegraph.db. The workspace root keeps .codegraph/workspace.json. MCP workspace tools auto-sync the enabled child projects they query before returning results.

Refresh all enabled projects:

codegraph workspace sync

Local UI

Open the graph explorer:

codegraph ui

Common options:

codegraph ui --port 8732
codegraph ui --project ./packages/api
codegraph ui --workspace .

Common Commands

| Command | Purpose | |---|---| | codegraph init -i | Initialize and index the current project | | codegraph status | Show index status | | codegraph query <text> | Search indexed symbols | | codegraph context <task> | Build focused task context | | codegraph files | Show indexed files | | codegraph sync | Sync changed files | | codegraph index | Rebuild the index | | codegraph ui | Open the local UI | | codegraph install | Configure MCP integration | | codegraph uninstall | Remove CodeGraph-owned MCP config | | codegraph workspace ... | Manage multi-project workspaces |

Print help:

codegraph --help
codegraph install --help
codegraph workspace --help

Supported Codebases

CodeGraph supports common languages such as TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, C, C++, Swift, Kotlin, Scala, Dart, Svelte, Vue, Liquid, and Pascal/Delphi.

It also understands common framework conventions for routes and project structure in frameworks such as Express, NestJS, Django, Flask, FastAPI, Laravel, Rails, Spring, Gin, Axum, ASP.NET, React Router, SvelteKit, and Nuxt.

More Documentation

License

MIT