Check a project

tx0 check picks the language pack for each file and reports every finding with its line, the reason it matters and, where one exists, a fix.

All docs pages

Run a check

In the root of your project, run tx0 check. Without a tx0.toml, the 353 rules of the default tier run. tx0 finds the root of the tree by looking for tx0.toml or .git above the current directory. Paths after check limit it to some files and directories.

$ tx0 check
warning[tx0/go:self-assignment]: `total` is assigned to itself
  --> api/order.go:14:2  WQ9WMD91C
   |
14 |     total = total
   |     ^^^^^
   |
   = note: an assignment of a value to itself has no effect

warning[tx0/go:lost-cancel]: the cancel function of `context.WithTimeout` is discarded
  --> api/order.go:19:11  7778HC4RC
   |
19 |     ctx, _ = context.WithTimeout(ctx, 2*time.Second)
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: call it when the work is done, usually with `defer`, to release the context

warning[tx0/python:duplicate-condition]: `status == 429` is tested earlier in this chain, so this branch never runs
 --> jobs/retry.py:6:10  74RVF0NHX
  |
6 |     elif status == 429:
  |          ^^^^^^^^^^^^^
2 |     if status == 429:
  |        ^^^^^^^^^^^^^ first tested here

3 findings in 2 files; 8 files checked, 0 from the cache, 0 findings suppressed

The exit code is 1 here because the findings fail the gate, which allows none until you set one in tx0.toml. tx0 init writes a commented tx0.toml when you want to change the tier, exclude paths or set a gate:

$ tx0 init
wrote tx0.toml

next:
  tx0 check                  check the tree
  tx0 check --since main     only findings that are new since main

editors: run `tx0 lsp` as the language server
agents:  add `tx0 mcp` as a tool server, for example `claude mcp add tx0 -- tx0 mcp`;
         `tx0 init --agents` prints hooks and configuration for more clients

Read a finding

Each finding starts with its level and the rule's id, such as tx0/go:self-assignment. Then come the location and the finding's own id, such as WQ9WMD91C, the code with the part in question underlined, and a note on what to do. The rules explain each rule with an example. Finding ids explains the id.

Fix

tx0 fix applies the fixes that keep behavior. tx0 fix --unsafe also applies the fixes that may change it, and tx0 fix --finding ID applies the fix of one finding, safe or not. --dry-run writes nothing and --diff prints the changes as a unified diff.

Why a rule runs on a file

tx0 explain RULE FILE says whether a rule runs on a file and why:

$ tx0 explain tx0/go:self-assignment api/order.go
tx0/go:self-assignment on api/order.go: warning
  the rule is in tier `default`, the project uses `default` (by default)

tx0 explain RULE alone describes the rule and how to configure and suppress it.

The second run

tx0 stores each result under a fingerprint of everything it depends on. Run the check again: only files that changed are read, and the summary says how many came from the cache.

$ tx0 check
warning[tx0/go:self-assignment]: `total` is assigned to itself
  --> api/order.go:14:2  WQ9WMD91C
   |
14 |     total = total
   |     ^^^^^
   |
   = note: an assignment of a value to itself has no effect

warning[tx0/go:lost-cancel]: the cancel function of `context.WithTimeout` is discarded
  --> api/order.go:19:11  7778HC4RC
   |
19 |     ctx, _ = context.WithTimeout(ctx, 2*time.Second)
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: call it when the work is done, usually with `defer`, to release the context

warning[tx0/python:duplicate-condition]: `status == 429` is tested earlier in this chain, so this branch never runs
 --> jobs/retry.py:6:10  74RVF0NHX
  |
6 |     elif status == 429:
  |          ^^^^^^^^^^^^^
2 |     if status == 429:
  |        ^^^^^^^^^^^^^ first tested here

3 findings in 2 files; 8 files checked, 8 from the cache, 0 findings suppressed

Speed shows what that means on large trees.