PromptHub
Back to Blog
Developer Tools AI/ML Infrastructure

sentrux/sentrux: Real-Time Architectural Sensor for AI Agent Feedback Loops

B

Bright Coding

Author

10 min read 52 views
sentrux/sentrux: Real-Time Architectural Sensor for AI Agent Feedback Loops

sentrux/sentrux: Real-Time Architectural Sensor for AI Agent Feedback Loops

AI agents write code at machine speed. Without structural governance, codebases decay at machine speed too. This is the core tension of modern AI-assisted development: agents can generate hundreds of lines across dozens of files in a single session, but no existing tool closes the feedback loop on architectural quality. Compilers catch syntax errors. Test suites catch behavioral regressions. Linters catch style violations. But who catches the creeping structural rot—the dependency cycles, the modularity breakdown, the "god files" that emerge when an agent lacks spatial awareness of your codebase?

sentrux/sentrux addresses exactly this gap. A pure Rust, single-binary tool with 2,607 GitHub stars and 235 forks, it functions as a real-time architectural sensor. It scans your project structure, computes a continuous quality signal from five root-cause metrics, and exposes that data to AI agents via the Model Context Protocol (MCP). The result: recursive self-improvement of code quality, where agents can observe the structural impact of their changes and course-correct before degradation compounds.

What is sentrux/sentrux?

sentrux/sentrux is an open-source architectural analysis tool released under the MIT License. Built entirely in Rust, it ships as a single binary with zero runtime dependencies. The project is actively maintained, with its last commit dated March 19, 2026.

The tool occupies a distinct niche in the developer tooling landscape. It is not a linter (though it includes rule enforcement). It is not a static analyzer in the traditional security-focused sense. It is, by its own definition, a sensor—a component in a feedback loop that observes architectural reality, compares it against a spec (your rules), and enables an actuator (your AI agent, or you) to correct drift.

This design philosophy emerges from a specific diagnosis of AI-assisted development. The project's documentation argues that the shift from IDE-based editing to terminal-based agent workflows has eliminated human spatial awareness of codebases. Developers no longer build mental models of file trees and dependency graphs; agents modify files in streams of terminal output, and structural degradation accumulates silently. sentrux/sentrux proposes that the solution is not better upfront planning—which the README critiques as "reinventing waterfall"—but better real-time sensing.

The tool's relevance is tied to the rapid adoption of AI coding agents (Claude Code, Cursor, Windsurf, and others). As these tools gain capability, the bottleneck shifts from generation speed to verification and governance. sentrux/sentrux positions itself as infrastructure for that governance layer.

Key Features

Real-time structural visualization. sentrux/sentrux renders your codebase as a live interactive treemap with dependency edges. Files glow when modified by an agent, giving immediate visual feedback on where changes cluster and how they affect architectural boundaries.

Five-metric quality signal. The tool computes a single score from 0–10,000 based on five root-cause metrics: modularity, acyclicity, depth, equality, and redundancy. This collapses complex structural analysis into a single comparable number that agents and humans can track over time.

Quality gating. The sentrux gate command saves a baseline before an agent session and compares against it after, catching degradation with exit codes suitable for CI integration. This transforms architectural health from a retrospective concern into a pre-merge gate.

Rules engine. A TOML-based configuration system lets teams encode architectural constraints: layer ordering, dependency boundaries, cyclomatic complexity limits, coupling thresholds, and prohibitions on "god files." These rules are enforced via sentrux check, which exits 0 or 1 for CI compatibility.

MCP server integration. sentrux/sentrux exposes nine tools via the Model Context Protocol: scan, health, session_start, session_end, rescan, check_rules, evolution, dsm, and test_gaps. This lets agents query structural health, establish baselines, and receive degradation alerts as part of their operational loop.

52-language support via tree-sitter. Language parsing is handled through external plugins rather than compiled-in knowledge. The binary is a generic platform; adding a new language requires only a plugin.toml and tags.scm file, with zero Rust code. This architecture supports everything from Bash and COBOL to Zig and Solidity.

Use Cases

AI agent session governance. The primary use case is closing the feedback loop for agent-driven development. Before a session, run sentrux gate --save . to establish baseline. After the session, sentrux gate . reveals whether quality improved or degraded. Agents with MCP access can query this data mid-session and self-correct.

CI/CD architectural gating. Teams can add sentrux check . to pull request pipelines, blocking merges that violate structural rules or degrade the quality signal. This prevents architectural debt from accumulating across rapid iteration cycles.

Codebase archaeology and onboarding. The live treemap visualization helps developers understand unfamiliar project structures quickly. Dependency edges reveal coupling patterns that file trees obscure, making it easier to identify where to add features without creating cycles.

Refactoring prioritization. The five root-cause metrics identify specific structural weaknesses. A low modularity score suggests boundary violations; high redundancy indicates duplicated abstractions. Teams can target refactoring efforts based on quantitative signals rather than intuition.

Multi-language monorepo management. With 52 supported languages and a plugin system for custom parsers, sentrux/sentrux can enforce consistent architectural standards across polyglot codebases where language-specific tools would fragment governance.

Installation & Setup

sentrux/sentrux provides platform-specific installation paths. All commands below are reproduced exactly from the project README.

macOS via Homebrew:

brew install sentrux/tap/sentrux

This taps the project's custom Homebrew repository and installs the latest release.

Linux via install script:

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

The script detects your platform and installs the appropriate binary.

Windows via direct download:

curl -L -o sentrux.exe https://github.com/sentrux/sentrux/releases/latest/download/sentrux-windows-x86_64.exe

Alternatively, download manually from the Releases page.

Build from source:

git clone https://github.com/sentrux/sentrux.git
cd sentrux && cargo build --release

Requires a Rust toolchain. The --release flag produces an optimized binary.

Upgrade:

brew update && brew upgrade sentrux

Or re-run the Linux install script, which always pulls the latest release.

GPU backend troubleshooting (Linux):

If the GUI fails to start, sentrux/sentrux automatically attempts fallback through Vulkan → OpenGL → software rendering. Force a specific backend:

WGPU_BACKEND=vulkan sentrux    # force Vulkan
WGPU_BACKEND=gl sentrux        # force OpenGL

Real Code Examples

The following examples are taken directly from the sentrux/sentrux README.

Basic invocation patterns:

sentrux                    # open the GUI — live treemap of your project
sentrux /path/to/project   # open GUI scanning a specific directory
sentrux check .            # check rules (CI-friendly, exits 0 or 1)
sentrux gate --save .      # save baseline before agent session
sentrux gate .             # compare after — catches degradation

These five commands cover the core workflow: interactive visualization, CI enforcement, and session-based quality gating. The exit-code behavior of sentrux check and sentrux gate makes them suitable for shell scripts and CI pipelines without additional parsing.

MCP server configuration for Cursor, Windsurf, or any MCP client:

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

This JSON fragment configures an MCP client to launch sentrux/sentrux as a subprocess server. The agent then has access to all nine MCP tools. Note that Claude Code has a shorter installation path via its plugin marketplace: /plugin marketplace add sentrux/sentrux followed by /plugin install sentrux.

Example .sentrux/rules.toml:

[constraints]
max_cycles = 0
max_coupling = "B"
max_cc = 25
no_god_files = true

[[layers]]
name = "core"
paths = ["src/core/*"]
order = 0

[[layers]]
name = "app"
paths = ["src/app/*"]
order = 2

[[boundaries]]
from = "src/app/*"
to = "src/core/internal/*"
reason = "App must not depend on core internals"

This configuration demonstrates the rules engine's expressiveness. The constraints section sets global thresholds: zero dependency cycles, maximum coupling grade "B", cyclomatic complexity capped at 25, and prohibition of god files. The layers section defines an architectural ordering (core before app), and the boundaries section enforces a specific dependency direction. Running sentrux check . validates the current codebase against these rules.

Plugin management:

sentrux plugin list              # see installed plugins
sentrux plugin add <name>        # install from registry
sentrux plugin add-standard      # install all 52 languages
sentrux plugin init my-lang      # scaffold a new language plugin

The plugin system keeps the core binary language-agnostic. add-standard is the typical first run after installation for polyglot projects.

Advanced Usage & Best Practices

Establish baselines before significant agent sessions. The gate --save / gate pattern is most valuable when used consistently. Consider wrapping agent invocations in a shell function that automatically establishes and checks baselines.

Integrate quality signal into agent prompts. When using sentrux/sentrux with MCP, explicitly instruct agents to check the quality signal after batches of changes and to prioritize structural improvements when scores degrade. The tool provides the data; prompt engineering determines whether the agent acts on it.

Start with add-standard, then prune. Installing all 52 language plugins is convenient but increases initial scan time slightly. For dedicated single-language projects, install only the needed plugin.

Use the GUI for exploration, CLI for enforcement. The live treemap excels at building intuition about codebase structure. The check and gate commands provide the deterministic, scriptable interface needed for CI and agent automation.

Iterate rules gradually. Starting with max_cycles = 0 and no_god_files = true captures high-value constraints without excessive tuning. Add layer boundaries and coupling limits as your architectural conventions solidify. Overly strict initial rules create friction that discourages adoption.

For teams exploring broader code quality strategies, [INTERNAL_LINK: rust-developer-tools-ecosystem] provides additional context on complementary tooling.

Comparison with Alternatives

Tool Primary Function AI Agent Integration Architectural Focus Language Coverage
sentrux/sentrux Structural sensor & quality gate Native MCP server Explicit: 5 root-cause metrics 52 via plugins
SonarQube/SonarCloud Multi-aspect code quality platform Limited; REST API Partial: coupling, cycles, duplication 25+ built-in
ArchUnit (Java) Architecture testing framework None Explicit: dependency rules Java only
CodeClimate Automated code review & tech debt tracking GitHub PR integration Surface-level: churn, complexity, duplication 20+

SonarQube offers broader quality coverage (security, test coverage, code smells) but lacks real-time agent integration and requires infrastructure. ArchUnit provides rigorous architectural testing but is Java-specific and predates the AI agent paradigm. CodeClimate focuses on maintainability metrics for human review workflows rather than agent feedback loops.

sentrux/sentrux's distinctive bet is that architectural governance must operate at agent speed—milliseconds to scan, immediate MCP responses, visual feedback that updates live. This trades breadth for latency and integration depth. Teams needing comprehensive security scanning should run sentrux/sentrux alongside, not instead of, established platforms.

FAQ

What license is sentrux/sentrux released under? MIT License. Free for commercial and personal use.

Does it require a GPU? No. The GUI uses wgpu and falls back through Vulkan → OpenGL → software rendering automatically.

Can I use it without AI agents? Yes. The visualization, rules engine, and quality gating are valuable for human-driven development too.

How fast is scanning? The README states quality signal computation occurs in "milliseconds." Exact benchmarks are not published.

What Rust version is required to build from source? The README does not specify a minimum Rust version. Use the latest stable toolchain.

Is there a hosted/SaaS version? No evidence in the README. It appears to be self-hosted only.

How do I add a language not in the 52 supported? Use sentrux plugin init my-lang to scaffold, then contribute to the plugins/ directory or open an issue.

Conclusion

sentrux/sentrux is a precisely scoped tool for a specific and growing problem: architectural governance in AI-accelerated development workflows. It will not replace your linter, your test suite, or your security scanner. What it offers is the missing piece—a real-time structural sensor that lets agents and humans observe, measure, and correct architectural drift before it compounds into unmaintainable complexity.

The tool is best suited for teams already using or evaluating AI coding agents, polyglot codebases needing consistent structural standards, and organizations moving quality gates left into the generation phase rather than catching issues at review time. With 2,607 stars, active maintenance, and a pragmatic MIT license, it is worth evaluating for any project where agent-generated code volume risks outstripping human architectural oversight.

Ready to close the feedback loop? Explore the repository, install the binary, and run your first scan: https://github.com/sentrux/sentrux

Comments (0)

Comments are moderated before appearing.

No comments yet. Be the first to share your thoughts!

Recommended Prompts

View All