# Scan

> Scan the entire codebase to build a dependency graph of the project. This is required before running any other commands that analyze the codebase.

- Skill: `cxgrd/scan` (Agent Skill)
- Install (CLI): `npx skillmds@latest add cxgrd/scan`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cxgrd/scan/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: cxgrd (https://skillmd.com/u/cxgrd)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/cxgrd/scan

---


# Scan the Codebase

This command scans the entire codebase and builds a dependency graph of the project. The graph contains information about the relationships between different parts of the codebase. This graph is used by other commands to understand these relationships.

`cxgrd scan `

This creates a `.cg` directory in the project root which contains the graph, symbol map and other metadata. 
This directory should not be committed to git, and should be added to `.gitignore` if it is not already.

## Prerequisites

Before running any cxgrd command, verify it's available:

`cxgrd --version`

If this fails (If cxgrd is not installed, tell the user and ASK BEFORE INSTALLING IT.), install it:

`npm install -g cxgrd`

Then retry the original command.
