Skip to content
CodeLayersCodeLayers

Concepts

This guide explains what you're seeing in CodeLayers and how to interpret the visualization.


The Dependency Graph

CodeLayers visualizes your codebase as a dependency graph—files connected by their relationships.

Dependency Graph Visualization - Files as nodes, imports as edges, organized by topological depth

What You're Seeing

Nodes (spheres) represent files in your codebase:

  • Size = Importance (how many other files depend on this one)
  • Color = Depth layer (see Topological Depth below)
  • Position = Organized by dependency relationships

Edges (lines) represent relationships:

  • Imports (A imports B)
  • Function calls (A calls function in B)
  • Type references (A uses type from B)

Larger nodes are more important—they're imported by many other files. These are often your core utilities, shared types, or main application logic.


Topological Depth

Files are arranged vertically by topological depth—their distance from the foundations of your codebase.

Topological Depth - Foundations at bottom, entry points at top, pyramid shape

What the Layers Mean

  • Bottom (Depth 0): Files that don't import anything from your codebase. These are your foundations—utils, constants, types, helpers.
  • Middle layers: Files that build on the foundations. Business logic, services, controllers.
  • Top (Highest depth): Entry points—files that import others but nothing imports them. Your main.ts, App.swift, index.py.

The Pyramid Test

A healthy codebase looks like a pyramid:

  • Many small files at the bottom (shared utilities)
  • Fewer files as you go up (specific logic)
  • Few files at the top (entry points)

An inverted pyramid (wide at top, narrow at bottom) suggests too much logic in entry points and not enough abstraction.

Deep dive: Read The Hidden Hierarchy in Your Codebase for more on how topological depth reveals architectural issues.


Blast Radius

Blast Radius shows the impact of code changes—which files are affected when you modify something.

How to Read It

When viewing a PR or code change, files are colored by their distance from the change:

ColorMeaning
⚪ WhiteThe changed file itself
🔴 RedDirect dependents (1 hop) — pay close attention
🟠 Orange2 hops away
🟡 Yellow3 hops away
🟢 Green → 🩵 Teal4+ hops away — lower priority
⚫ GrayNot affected by this change

Hot colors = close to change (review carefully). Cool colors = further out (lower risk).

Why It Matters

  • Code review: Instantly see what a PR actually touches
  • Testing: Focus on files closest to the change
  • Surprises: Discover unexpected dependencies before they break production

Example

When you modify validate_token() in auth.rs:

⚪ auth.rs (changed)
   └── 🔴 handlers.rs (calls validate_token)
   └── 🔴 middleware.rs (calls validate_token)
          └── 🟠 router.rs (calls middleware)

4 files affected, max 2 hops

Privacy

Your code is encrypted on your machine before it ever leaves. We cannot see your code.

What We See vs. What You See

DataOn Your DeviceOn Our Servers
Code filesPlaintextEncrypted blobs
Function namesPlaintextHashed identifiers
File pathsPlaintextHashed identifiers
Your 12-word phraseStored locallyNever sent

Common Questions

Q: Can you see my code? No. Everything is encrypted with your 12-word phrase before leaving your machine.

Q: What if I lose my mnemonic? Your data cannot be recovered. We have no way to decrypt it. Always backup your 12 words.

Q: Can you see what files I have? No. File paths are hashed. We see a1b2c3... not src/auth/login.ts.


Supported Languages

CodeLayers parses these languages to build the dependency graph:

LanguageWhat We Detect
TypeScript / JavaScriptimport, require, function calls
Pythonimport, from x import, function calls
Rustuse, mod, function calls
Goimport, function calls
Javaimport, class references
Swiftimport, type references
C++ / C##include / using, namespaces
Ruby / PHPrequire, include

Other files (JSON, YAML, Markdown, etc.) are tracked but not parsed for dependencies.