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.