Skip to main content

ARCLUX Complete Tutorial

Learn ARCLUX end to end — from first install to daemon, detectors, rules, and CI gating. Every command and output in this tutorial was verified against a real open-source repository (Flask, 83 modules). Where output is shown, it is the actual output ARCLUX produced, so you know what to expect before you run it.

Part 1 — What ARCLUX is

ARCLUX builds an accurate structural model of a codebase:
It answers questions like:
  • Which files depend on which? (graph)
  • What breaks if I change file X? (impact)
  • Where are circular dependencies, dead code, orphan files? (doctor)
  • Does this repo follow framework conventions? (verify)
  • Did the architecture change between two commits? (diff)
ARCLUX is a deterministic structural-truth engine: every fact it reports is traceable to a real import statement, export declaration, or resolved path. No AI, no guessing. Supported languages today: TypeScript, JavaScript, Python, Go, Java, PHP, Ruby, Rust, C++, C#, Bash, C, Dart, Elixir, Kotlin, Lua, Objective-C, OCaml, Scala, Solidity, Swift, Vue, Zig, Elm, ReScript (25 via web-tree-sitter, 2 via TypeScript Compiler API) plus manifest parsers for package.json, go.mod, Cargo.toml, Gemfile, composer.json, .csproj, Gradle/POM, requirements.txt.

Part 2 — Install & setup

Requirements: Node 20+, pnpm.
Run the CLI with tsx (no build step needed):
Or add an alias so you don’t type the prefix every time:
Verify it works:

Part 3 — Your first analysis

Point ARCLUX at any repository on disk (it needs no network for local analysis):
Real output (analyzing Flask):
Reading the output:
  • modules indexed — how many files made it into the model
  • Scan: X parsed, Y skipped — the population guard. If a repo has files in a language without a parser yet, they are counted as skipped, not silently dropped. 0 skipped means the whole repo got into the graph.
  • nodes / edges — the size of the dependency graph
  • Detectors — a first-pass summary of what doctor will report in detail

Part 4 — Working with the graph

The dependency graph can be printed or saved as JSON:
Real output:
Graph variants available in packages/graph/:
  • buildDependencyGraph — module-level import graph (what graph prints)
  • buildImportGraph — same shape, import edges
  • buildCallGraph — which module’s functions are actually called, edge weight = distinct call sites
  • buildExportGraph — export/re-export chains
  • buildFolderGraph — folder-level tree (used by the web dashboard)

Part 5 — Impact analysis

The killer feature: what is affected if this file changes?
Real output for src/flask/app.py:
impact traces both directions — direct consumers (importers) and, on the web side, the full affected-files tree. Use it before any refactor: change the file, know exactly who breaks.

Part 6 — Doctor: 20 detectors

doctor runs the full detector suite and normalizes every finding to checkId + severity + message:
Real output (excerpt):
The 20 detectors (all crash-isolated — a detector that throws becomes an error finding, it never kills the run):

Part 7 — Verify: the CI gate

verify runs detectors + framework rules and gives a single PASS/FAIL verdict — this is the command to gate CI on:
Real output:
The 14 framework rules (Next.js, NestJS, Express, Vite, Electron, React, Laravel) only fire when the corresponding framework is detected — a plain Python repo reports frameworks checked: none detected and only detectors matter.

Part 8 — Diff: architectural change between refs

Shows the architectural impact of changes between two git refs — which modules gained/lost dependencies, which edges changed. Run it in code review or before merge to catch unintended architectural drift.

Part 9 — Diagnose

diagnose runs the wired diagnostic adapters (circularDependency, deadCode, ambiguousSymbolResolution) with impact context and fix suggestions — not just “what”, but “who it affects”:
Real output (excerpt):

Part 10 — Config

Real output:
Shows the auto-detected repository metadata (framework + package manager detection). Config file support is not built yet — detection is automatic.

Part 11 — The daemon (always-on analysis)

The daemon watches a repo and re-analyzes on every change:
Re-analysis is routed through a job scheduler (ported from the Linux kernel’s workqueue pattern): change bursts coalesce (N saves = 1 re-analysis), analyses never overlap, and the local HTTP+SSE bridge lets any tool subscribe:
  • GET /analysis — current analysis
  • GET /events — SSE stream (analysis, diagnostics events)
  • GET /diagnostics — last diagnostics run
A minimal VS Code extension (apps/vscode-extension/) connects to a running daemon: Problems-panel diagnostics + status-bar module count.

Part 12 — Platform commands

Commands that work on a workspace model (the kernel process/service/job registry):

Part 13 — The web dashboard

The dashboard analyzes a remote repo URL (clone → analyze → visualize), then renders:
  • Interactive dependency graph (SVG + d3-force physics layout)
  • Graph variants: import / call / folder views, expand-on-demand
  • Impact halo — hover a node, see who is affected
  • Search across the repo (fuzzy filename + export-name matching)
  • Detector findings and route/component resolution

Part 14 — CI / team workflow

Gate CI on the structural truth:
Team conventions:
  • Keep PRs scoped to one package or one concern
  • main is protected — everything goes through a PR
  • Run arclux doctor before opening a PR; fix at least the error severity findings

Part 15 — Troubleshooting

  • Ports shift / zombie node processes — before debugging weird web responses, check ps aux | grep node and confirm the port you’re hitting matches the Local: line of the dev server.
  • Empty analysis on local dirs — local-path analysis never caches by design (stale results mid-edit would be worse). Re-run if results feel stale.
  • Files skipped, not parsed — check the Scan: line. skipped (no parser) means the language isn’t supported yet, not that ARCLUX broke.
  • Termux/Android — no /tmp; ARCLUX uses ~ for scratch space. The web app uses Webpack, not Turbopack.

That’s the whole tool. The shortest useful loop: analyze to look, impact before you change, doctor to find, verify to gate, daemon to stay current.