# CodeGraph 自跑輸出（dogfooding）

> 本檔案記錄本站**實際安裝並運行 `@colbymchenry/codegraph@1.5.0`** 於上游源碼
> （`colbymchenry/codegraph` @ `c6aaa20`）所得的真實輸出摘錄。
> 環境：macOS（Apple Silicon）· Node v24.12.0 · `npm i -g @colbymchenry/codegraph@1.5.0`。

## 版本

```
$ codegraph version
1.5.0
```

## `codegraph init` — 570 檔全量索引

```
$ codegraph init
┌  Initializing CodeGraph
◆  Initialized in <repo-root>
Scanning files...
Parsing code...
Resolving refs...
Linking dynamic dispatch...
◆  Indexed 570 files
●  12,733 nodes, 44,903 edges in 1.7s
└  Done
```

> 在 codegraph 自己的源碼上，**570 個檔案 → 12,733 節點 / 44,903 邊，僅 1.7 秒**。

## `codegraph status` — 索引統計

```
$ codegraph status
CodeGraph Status
Project: <repo-root>
Index Statistics:
  Files:     570
  Nodes:     12,733
  Edges:     44,903
  DB Size:   53.30 MB
  Backend:   node:sqlite — built-in (full WAL)
  Journal:   wal

Nodes by Kind:
  function        2,706
  import          2,304
  method          1,850
  constant        1,582
  property        1,284
  interface       768
  file            568
  type_alias      540
  enum_member     312
  variable        258
  struct          215
  class           206
  field           53
  enum            45
  route           16
  trait           10
  component       8
  namespace       5
  module          3
```

## `codegraph query` — 依名稱搜尋符號

```
$ codegraph query ExtractionOrchestrator --limit 5
Search Results for "ExtractionOrchestrator":

class       ExtractionOrchestrator
  src/extraction/index.ts:1435

method      constructor
  src/extraction/index.ts:1446
  (rootDir: string, queries: QueryBuilder)

method      indexFiles
  src/extraction/index.ts:2114
  (filePaths: string[]): Promise<IndexResult>

method      indexFile
  src/extraction/index.ts:2161
  (relativePath: string): Promise<ExtractionResult>
```

## `codegraph callers` — 誰呼叫了它

```
$ codegraph callers buildContext --limit 5
Callers of "buildContext" (3):

method      buildContext
  src/index.ts:1842

file        context-ranking.test.ts
  __tests__/context-ranking.test.ts:1

file        context.test.ts
  __tests__/context.test.ts:1
```

## `codegraph impact` — 變更影響範圍

```
$ codegraph impact GraphTraverser --depth 1
Impact of changing "GraphTraverser" — 39 affected symbols:

src/graph/traversal.ts
  class       GraphTraverser:34
  method      traverseBFS:48
  method      traverseDFS:154
  method      getCallers:261
  method      getCallersRecursive:270
  method      getCallees:319
  method      getCalleesRecursive:328
  method      getTypeHierarchy:412
  method      getImpactRadius:520
  method      findPath:617
  ... (共 39 個受影響符號)
```

## `codegraph explore` — 一呼即答的結構性問題

```
$ codegraph explore "how does codegraph_explore build its answer"
**Exploration: how does codegraph_explore build its answer**

Found 35 symbols across 2 files.

**Blast radius — what depends on these (update/verify before editing)**
- `CodeGraph` (src/index.ts:139) — 136 callers in `__tests__/evaluation/runner.ts`,
  `src/mcp/engine.ts`, `src/mcp/tools.ts`, `src/index.ts`; tests: ... +96

**Relationships**
instantiates:
- init → CodeGraph
- initSync → CodeGraph
- open → CodeGraph
- recreate → CodeGraph
- openSync → CodeGraph

calls:
- constructor → wireLayers
- reopenIfReplaced → wireLayers
- sync → sync
- watch → sync
- open → sync
- init → indexAll
- ... and 3 more

**Source Code**
> The code below is the verbatim, current on-disk source of these files ...
```

## `codegraph files` — 檔案結構

```
$ codegraph files --max-depth 1
Project Structure (570 files):

├── __tests__
├── .github
├── assets
├── codegraph-kernel
├── scripts
├── site
├── src
├── telemetry-dashboard
├── telemetry-worker
└── vitest.config.ts (typescript, 2 symbols)
```

## `codegraph sync` — 增量同步

```
$ codegraph sync
┌  Syncing CodeGraph
Scanning files...
Parsing code...
Resolving refs...
◆  Synced 3 changed files
●  Added: 3 — 0 nodes in 169ms
└  Done
```
