Skip to content

VS Code Extension

The Unfault VS Code extension shows you what your code means at runtime - where functions are called from, which routes they affect, and what safeguards exist in the call chain.

  1. Open VS Code
  2. Press Cmd+Shift+X (macOS) or Ctrl+Shift+X (Windows/Linux)
  3. Search for “Unfault”
  4. Click Install

The extension requires the Unfault CLI. If you haven’t installed it yet, follow the steps in /docs/installation, then authenticate:

Terminal window
unfault login

Above each function, a code lens shows its runtime context:

uf: used by 3 places · reached by POST /api/checkout · worth a look

Click to open the Context sidebar with full details.

The sidebar (in Explorer) shows:

  • Callers: Where this function is called from
  • Routes: Which HTTP routes reach this function
  • SLOs: Service level objectives linked to those routes
  • Heads up (worth a look): Findings about the current function body (things to fix here)
  • Upstream: Issues in code that calls into this function (things that can break you)
  • Downstream: Issues in code you call from this function (things you rely on / can propagate)

The sidebar follows your cursor by default. Pin it to keep focus on a specific function.

The status bar shows how central the current file is:

  • Hub icon: Many files depend on this one
  • Star icon: Moderately central
  • (no extra icon): Regular file

Click Show Files That Depend on This File (or use the Unfault menu) to see exactly what depends on the current file.

SettingDescriptionDefault
unfault.executablePathPath to CLIunfault
unfault.fault.executablePathPath to fault CLIfault
unfault.fault.baseUrlBase URL of the app under testhttp://127.0.0.1:8000
unfault.codeLens.enabledShow code lenses above functionstrue
unfault.codeLens.clickToOpenClick lens to open context sidebartrue
unfault.diagnostics.enabledShow inline squiggles (calm mode off)false
unfault.diagnostics.minSeverityMinimum severityhigh
unfault.trace.serverLSP trace leveloff
unfault.verboseVerbose loggingfalse

Access via Command Palette (Cmd+Shift+P) or click the status bar:

CommandDescription
Open Context SidebarOpen Unfault: Context in the Explorer sidebar
Run fault injection for current functionOpen the fault injection panel for the current function
Generate fault scenarios for current functionGenerate per-route scenario suites under tests/fault/ or test/fault/
Show Files That Depend on This FileList files that import this one
Show Unfault OutputView LSP logs for debugging
Open Unfault SettingsJump to Unfault settings
Show Unfault MenuQuick pick with all actions
Welcome & SetupWelcome panel + auth help
Restart Unfault LSP ServerRestart the language server

The Context sidebar includes a Fault Injection panel.

  • If fault isn’t installed, the extension offers to run unfault addon install fault for you.
  • Clicking Run starts fault run and opens a split terminal with a curl command targeting the proxy.
  • Clicking Generate scenario file creates a repeatable scenario suite for the current route.

See /docs/guides/fault for details.

  • Python
  • Go
  • Rust
  • TypeScript
  • JavaScript

No code lenses appearing

  1. Check that you’re in a supported file
  2. Run unfault login in the terminal
  3. Run Unfault: Restart Server
  4. Check Output for errors

Extension slow on first open

The first analysis builds a semantic graph of your codebase. Subsequent interactions use the cache.

CLI not found

Set unfault.executablePath in settings to the full path to the unfault binary.

For a detailed walkthrough of all features, see the VS Code Extension Tutorial.