Skip to content
Back to skills

Codegraphcontext

ASecurity

CodeGraphContext (CGC) parses source code with tree-sitter and builds a queryable graph of functions, classes, and their relationships. Use it to answer structural questions that text search can't: "who calls this?", "what would break?", "where is dead code?" Supports 14 languages: Python, JS/TS, Java, C/C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, Dart, Perl.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 28, 2026
ai-agentspythonrustgojavarubyphpswiftkotlinc++c#

Works with

  • cli
  • mcp

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned May 28, 2026

npx -y skills add spideynolove/claude-code-in-action --skill codegraphcontext --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Codegraphcontext?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Codegraphcontext
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/spideynolove-codegraphcontext/badge)](https://www.skillsdirectory.com/skills/spideynolove-codegraphcontext)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# CodeGraphContext — Structural Code Intelligence

CodeGraphContext (CGC) parses source code with tree-sitter and builds a queryable graph of functions, classes, and their relationships. Use it to answer structural questions that text search can't: "who calls this?", "what would break?", "where is dead code?"

Supports 14 languages: Python, JS/TS, Java, C/C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, Dart, Perl.

## When to invoke

Use CGC **instead of grep** when questions are structural:
- Tracing callers / callees across a large codebase
- Impact analysis before refactoring a function or class
- Finding dead code before a cleanup
- Identifying the most complex functions to prioritize
- Answering "what calls X?" or "what does Y depend on?"

**Do not use** for text/regex search, reading file contents, or single-file edits.

---

## Installation

```bash
pip install codegraphcontext
# or with uv:
uv pip install codegraphcontext
```

Verify: `cgc --help`

Default backend: KùzuDB (zero-config, embedded). No server needed.

---

## Core workflow

### 1 — Index the repo

```bash
# Index current directory
cgc index .

# Index a specific path
cgc index /path/to/project
```

Run once; re-run after large changes or use `cgc watch` for live updates.

### 2 — Analyze

```bash
# Who calls a function?
cgc analyze callers <function_name>

# What does a function call?
cgc analyze calls <function_name>

# Visualize call chain interactively
cgc analyze calls <function_name> --viz

# Find complex functions (default threshold: 10)
cgc analyze complexity --threshold 15

# Detect dead code
cgc analyze dead-code

# Explore class hierarchy
cgc analyze tree <ClassName> --viz
```

### 3 — Find patterns

```bash
cgc find pattern "<search_term>"
```

### 4 — List indexed repos

```bash
cgc list
```

### 5 — Live watch (keep graph current)

```bash
cgc watch /path/to/project
```

---

## MCP server mode (optional)

CGC can expose its graph as an MCP server so Claude can query it conversationally:

```bash
cgc mcp setup    # interactive wizard
cgc mcp start    # launch the server
```

When the MCP server is running, Claude can use `cgc.*` tools directly without shell commands. Prefer the CLI above unless you need persistent conversational access.

---

## Typical task patterns

**Impact analysis before refactoring:**
```bash
cgc index .
cgc analyze callers target_function
```

**Find what to clean up:**
```bash
cgc analyze dead-code
cgc analyze complexity --threshold 20
```

**Understand an unfamiliar module:**
```bash
cgc analyze calls entry_point_function --viz
cgc analyze tree CoreClassName --viz
```

---

## Integration with other skills

- **repomix** — use repomix for broad file-content context; use CGC for structural/relational queries
- **mcp-knowledge-graph** — CGC focuses on code structure; knowledge-graph stores architectural decisions and patterns

---

## Notes

- First `cgc index` may take 30–60 seconds on large repos
- Graph is stored locally in `.cgc/` by default
- Add `.cgc/` to `.gitignore`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.