Sentrux
Real-time architectural sensor that helps AI agents close the feedback loop, enabling recursive self-improvement of code quality. Pure Rust.
Install / Use
/learn @sentrux/SentruxQuality Score
Category
Development & EngineeringSupported Platforms
README
The sensor that helps AI agents close the feedback loop.<br>Recursive self-improvement of code quality.
How it Works · Quick Start · MCP Integration · Rules Engine · Releases
</div> <br> <div align="center">
How it works
<div align="center"> <img src="assets/how-it-works.svg" width="600" alt="How sentrux works: scan → score → agent improves → rescan → better score → repeat"> </div>Quick Start
Install (macOS · Linux · Windows)
macOS
brew install sentrux/tap/sentrux
Linux
curl -fsSL https://raw.githubusercontent.com/sentrux/sentrux/main/install.sh | sh
Windows — download from Releases, or:
curl -L -o sentrux.exe https://github.com/sentrux/sentrux/releases/latest/download/sentrux-windows-x86_64.exe
Pure Rust. Single binary. No runtime dependencies. 52 languages via tree-sitter plugins. Runs on macOS, Linux, and Windows.
Run it
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
Connect to your AI agent (optional)
Give your agent real-time access to structural health via MCP.
Claude Code:
/plugin marketplace add sentrux/sentrux
/plugin install sentrux
Cursor / Windsurf / OpenCode / OpenClaw / any MCP client — add to your MCP config:
{
"mcpServers": {
"sentrux": {
"command": "sentrux",
"args": ["--mcp"]
}
}
}
From source / upgrade / troubleshooting
# Build from source
git clone https://github.com/sentrux/sentrux.git
cd sentrux && cargo build --release
# Upgrade
brew update && brew upgrade sentrux
# or re-run the curl install — it always pulls the latest release
Linux GPU issues? If the app won't start, sentrux automatically tries multiple GPU backends (Vulkan → GL → fallback). You can also force one:
WGPU_BACKEND=vulkan sentrux # force Vulkan
WGPU_BACKEND=gl sentrux # force OpenGL
<br>
The problem nobody talks about
You start a project with Claude Code or Cursor. Day one is magic. The agent writes clean code, understands your intent, ships features fast.
Then something shifts.
The agent starts hallucinating functions that don't exist. It puts new code in the wrong place. It introduces bugs in files it touched yesterday. You ask for a simple feature and it breaks three other things. You're spending more time fixing the agent's output than writing it yourself.
Everyone assumes the AI got worse. It didn't. Your codebase did.
Here's what actually happened: when you used an IDE, you saw the file tree. You opened files. You built a mental model of the architecture — which module does what, how they connect, where things belong. You were the governor. Every edit passed through your understanding of the whole.
Then AI agents moved us to the terminal. The agent modifies dozens of files per session. You see a stream of Modified src/foo.rs — but you've lost the spatial awareness. You don't see where that file sits in the dependency graph. You don't see that it just created a cycle. You don't see that three modules now depend on a file that was supposed to be internal. Many developers let AI agents build entire applications without ever opening the file browser.
You've lost control. And you don't even know it yet.
Every AI session silently degrades your architecture. Same function names, different purposes, scattered across files. Unrelated code dumped in the same folder. Dependencies tangling into spaghetti. When the agent searches your project, it finds twenty conflicting matches — and picks the wrong one. Every session makes the mess worse. Every mess makes the next session harder.
This is the dirty secret of AI-assisted development: the better the AI generates code, the faster your codebase becomes ungovernable.
The traditional answer — "plan your architecture first, then let AI implement" — sounds right but misses the point. Tools like GitHub's Spec Kit try this approach: generate detailed specs and plans before writing code. But in practice, it reinvents waterfall — producing seas of markdown documents while having zero visibility into the code that actually gets produced. No feedback loop. No way to detect when the implementation drifts from the spec. No structural analysis of any kind. The spec goes in, the agent writes code, and nobody checks what came out.
That's not how anyone actually works with AI agents anyway. You prototype fast. You iterate through conversation. You follow inspiration. You let the creative flow drive the code. That creative flow is exactly what makes AI agents powerful. And it's exactly what destroys codebases.
You don't need a better plan. You need a better sensor.
The solution
sentrux is the missing feedback loop.
Every system that works at scale has one: a sensor that observes reality, a spec that defines "good," and an actuator that corrects drift. Compilers close a feedback loop on syntax. Test suites close a loop on behavior. Linters close a loop on style.
But architecture — does this change fit the system? will this abstraction cause problems as the codebase grows? — had no sensor and no actuator. Only humans could judge that. And humans can't keep up with machine-speed code generation.
sentrux closes the loop at the architecture level.
It watches your codebase in real-time — not the diffs, not the terminal output — the actual structure. Every file. Every dependency. Every architectural relationship. Visualized as a live interactive treemap that updates as the agent writes code.
5 root cause metrics. One continuous score. Computed in milliseconds.
When architecture degrades, you see it immediately — not two weeks later when everything is broken and nobody remembers which session caused it.
sentrux gives you the sensor. Your rules give you the spec. The agent is the actuator. The loop closes.
<br> <div align="center"> <table> <tr> <td align="center" width="33%"><b>Visualize</b><br><sub>Live treemap with dependency edges,<br>files glow when the agent modifies them</sub></td> <td align="center" width="33%"><b>Measure</b><br><sub>5 root cause metrics, one score 0–10000:<br>modularity, acyclicity, depth, equality, redundancy</sub></td> <td align="center" width="33%"><b>Govern</b><br><sub>Quality gate catches regression.<br>Rules engine enforces constraints.</sub></td> </tr> </table> </div> <br>MCP server
Agent workflow
Agent: scan("/Users/me/myproject")
→ { quality_signal: 7342, files: 139, bottleneck: "modularity" }
Agent: session_start()
→ { status: "Baseline saved", quality_signal: 7342 }
... agent writes 500 lines of code ...
Agent: session_end()
→ { pass: false, signal_before: 7342, signal_after: 6891,
summary: "Quality degraded during this session" }
9 tools: scan · health · session_start · session_end · rescan · check_rules · evolution · dsm · test_gaps
Rules engine
Define architectural constraints. Enforce them in CI. Let the agent know the boundaries.
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"
sentrux check .
# ✓ All rules pass — Quality: 7342
Supported languages
52 languages built-in via tree-sitter plugins — zero language knowledge in the binary:
| | | | | | | |---|---|---|---|---|---| | Bash | C | C++ | C# | Clojure | COBOL | | Crystal | CSS | Dart | Dockerfile | Elixir | Erlang | | F# | GDScript | GLSL | Go | Groovy | Haskell | | HCL | HTML | Java | JavaScript | JSON | Julia | | Kotlin | Lua | Markdown | Nim | Nix | Objective-C | | Object Pascal | OCaml | Perl | PHP | PowerShell | Protobuf | | Python | R | Ruby | Rust | Scala | SCSS | | Solidity | SQL | Svelte | Swift | TOML | TypeScript | | V | Vue | YAML | Zig | | |
Plugin system — add any language, or create your own:
sentrux plugin list # see installed plugins
sentrux plugin add <name> # insta
Related Skills
himalaya
339.3kCLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
node-connect
339.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Hook Development
83.9kThis skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.
