# sentrux: a real-time architecture sensor for AI coding agents

> sentrux scans a repository, scores its structural health, and exposes that score to an AI agent over MCP so the agent can see whether its own edits made the codebase better or worse. It is a single Rust binary with a GUI treemap and a CI-friendly check command.

**sentrux/sentrux** — Real-time architectural sensor that helps AI agents close the feedback loop, enabling recursive self-improvement of code quality. Pure Rust.

- Repository: https://github.com/sentrux/sentrux
- Website: https://sentrux.dev
- Stars: 3,307 · Forks: 300
- Language: Rust
- License: MIT
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/sentrux-sentrux

## The failure mode sentrux was built to catch

The README opens with a scenario rather than a feature list. An agent writes clean code on day one, then starts hallucinating functions that do not exist, placing new code in the wrong module, and breaking files it touched the day before. The README's claim is that the model did not get worse; the codebase did. The argument is that an IDE gave a human a file tree and a mental model of which module owns what, and terminal-based agents removed that view. The agent edits dozens of files per session, the developer sees a stream of modified paths, and nobody notices a new dependency cycle or a module that three others now reach into.

The target user is therefore narrow and specific: someone running Claude Code, Cursor, or a comparable agent on a codebase large enough that structural drift matters, and who wants a machine-readable signal rather than a human reading a diff. The README frames the missing piece as a sensor. Compilers close a loop on syntax, test suites on behavior, linters on style. Architecture, in its framing, had no sensor and no actuator. That is the gap sentrux claims to fill, and it is a reasonable framing of a real problem, though the README asserts the degradation pattern rather than measuring it in the repository.

## Scan, score, rescan: the loop sentrux exposes

The mechanism shown in the README's diagram is a cycle: scan, score, agent improves, rescan, better score, repeat. The score is the product. The README's demo caption says a Claude Code session building a FastAPI project lands at 6772 with good prompts, and attributes that to the absence of a sensor rather than to model capability. That number is presented as a quality signal, and v0.5.5 is titled One True Score, which suggests the score was consolidated into a single metric in that release.

The implementation is a Rust workspace with two members, sentrux-core and sentrux-bin, according to Cargo.toml. The binary parses source through tree-sitter plugins, which the README says covers 52 languages, and the GUI is built on eframe and egui with the wgpu backend. The topics list includes treemap and visualization, matching the README's description of a live treemap of the project. The repository also carries a .sentrux/ directory, which is where project-local state such as a saved gate baseline would plausibly live; the README does not document its contents.

The important architectural point is that the score is exposed to the agent, not just to a human. That is what the MCP server is for. An agent that can call the sensor after an edit can read whether the structure improved, which is the feedback loop the README keeps returning to.

## Installing sentrux and running a first gate

The README gives three install paths. On macOS it is a Homebrew tap, on Linux a curl script, and on Windows a binary from the releases page. The project describes itself as a pure Rust single binary with no runtime dependencies.

```bash
brew install sentrux/tap/sentrux
```

On Linux the README pipes install.sh from the main branch into sh. That is a remote script executed without inspection, which is worth noting as a supply-chain consideration; the same script is in the repository as install.sh if you prefer to read it first.

```bash
curl -fsSL https://raw.githubusercontent.com/sentrux/sentrux/main/install.sh | sh
```

Running with no arguments opens the GUI, and passing a path scans that directory. The check subcommand is the CI-facing one and exits 0 or 1, so it can gate a pipeline.

```bash
sentrux
sentrux /path/to/project
sentrux check .
```

The commands that matter for agent work are the gate pair. You save a baseline before a session and compare after, which is how the tool is meant to catch degradation introduced by the agent rather than by you.

```bash
sentrux gate --save .
sentrux gate .
```

To let an agent read the score itself, the README shows a Claude Code plugin flow and a generic MCP server entry. The generic form runs the same binary with --mcp.

```json
{
  "mcpServers": {
    "sentrux": {
      "command": "sentrux",
      "args": ["--mcp"]
    }
  }
}
```

Building from source is a standard cargo build in the cloned repository, and the README notes the curl installer always pulls the latest release, so re-running it is the upgrade path on Linux.

## The rules engine and what a score cannot see

sentrux check . runs a rules engine and returns a pass or fail exit code. The README links a Rules Engine section but does not enumerate the rules in what it shows, so what is checkable in CI is not verifiable from the README. That is a real gap for anyone planning to wire this into a pipeline: you know the command and the exit semantics, not the rule set.

The larger limitation is conceptual. A structural score can detect a dependency cycle, a file in the wrong layer, or sprawl. It cannot tell you whether an abstraction is the right one. The README itself concedes this in the section that motivates the project: the questions it lists, does this change fit the system and will this abstraction cause problems as the codebase grows, are framed as things only humans could judge. sentrux replaces that judgement with a number. A number is easier to optimize against, and that is exactly the risk. An agent given a score will improve the score, and some of those improvements will be architectural regressions that happen to score well.

The other boundary is language coverage. 52 languages via tree-sitter plugins is broad, and the topics list includes COBOL and Object Pascal (added in v0.5.5), which signals a deliberate push beyond mainstream languages. But tree-sitter parsing gives structure, not semantics, and the quality of the signal in any given language depends on the plugin. The README does not state how the score is computed per language, so treat the number as comparative within one repository over time rather than as an absolute grade you can compare across projects.

## How sentrux differs from spec-first tooling

The README names its alternative directly: GitHub's Spec Kit, which generates detailed specs and plans before code is written. The README's objection is that this approach produces large volumes of markdown while offering no visibility into the code that actually gets produced, no feedback loop, and no way to detect drift between spec and implementation. It cites a critical write-up describing Spec Kit as reinventing waterfall.

The difference in approach is where the control point sits. Spec-first tooling constrains the agent before generation by writing a document it is supposed to follow. sentrux observes after generation and reports a structural measurement. One is a plan, the other is a sensor. The README argues the second fits how people actually work with agents, prototyping and iterating through conversation, because creative flow is what makes agents useful and also what erodes a codebase.

That is a fair distinction, and it also bounds sentrux. A sensor does not tell the agent what to build. If your failure mode is an agent that misunderstands requirements, a structural score will not help; it will happily report a well-structured implementation of the wrong thing. Spec-first and sensor-first tooling address different failures, and the README is honest about which one it picked.

## Maintenance, licensing and upgrade cost

The repository is not archived, and the last push was on 2026-03-19. The most recent release listed is v0.5.7 on 2026-03-18, with v0.5.6 and v0.5.5 landing on the two days before that. That is a dense release burst in mid-March 2026, and the release titles describe UI and platform work: a WCAG color system, a universal resolver, plugin versions, UI scale, a font upgrade, an open source build fix. The version number is still 0.x, so expect interface and output changes between releases; a score that shifts because the scoring model changed is a real hazard if you are tracking it over time or gating CI on a threshold.

The license is MIT, which is permissive and places few obligations on how you redistribute or embed the binary. This is not legal advice; if you plan to ship sentrux inside a product, read the LICENSE file in the repository and confirm the terms with your own counsel.

Upgrade cost is low on macOS and Linux. Homebrew handles it with an update and upgrade, and the README states the curl installer always pulls the latest release, so re-running the same command is the upgrade. Building from source is a cargo build --release in the workspace. The Windows path is a manual download from the releases page, which means no automatic update channel there.

## Conclusion

Adopt sentrux if an AI agent writes most of your code and you want a numeric structural signal in its loop, or if you want a CI gate on architecture drift. Do not adopt it if you expect it to judge design intent: it measures structure, not whether an abstraction is right, and the README offers no evidence it understands domain semantics. Verify first that your language is covered by the tree-sitter plugins, then run sentrux gate --save . before an agent session and sentrux gate . after it to see whether the tool reports degradation on your own repository.

## FAQ

### What is sentrux and what does it do?

sentrux is a real-time architectural sensor for AI coding agents, written in Rust and distributed as a single binary. It scans a project, produces a quality score, and can expose that score to an agent over MCP so the agent can see whether its edits improved or degraded the structure.

### How do I install sentrux on macOS, Linux or Windows?

The README gives brew install sentrux/tap/sentrux on macOS, a curl install.sh script on Linux, and a binary download from the releases page on Windows. Building from source is a cargo build --release in the cloned workspace.

### How do I connect sentrux to Claude Code or another MCP client?

For Claude Code the README shows adding the sentrux marketplace and installing the plugin. For any other MCP client, add a server entry whose command is sentrux with the single argument --mcp.

### How does sentrux catch architecture degradation caused by an AI agent?

The README's workflow saves a baseline with sentrux gate --save . before an agent session and compares with sentrux gate . afterwards. The check subcommand runs the rules engine and exits 0 or 1, which is the form suited to CI.

## Sources

- [License: MIT](https://github.com/sentrux/sentrux/blob/main/LICENSE)
- [Project website](https://sentrux.dev)
- [README](https://github.com/sentrux/sentrux/blob/main/README.md)
- [Releases](https://github.com/sentrux/sentrux/releases)
- [sentrux/sentrux on GitHub](https://github.com/sentrux/sentrux)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/sentrux-sentrux
