How It Works
Watch Mode
Continuously monitors your codebase and reports issues in real-time:
sentrux watch ./src --rules complexity,coupling,namingOutput:
[WARN] src/auth/handler.rs:45 — Cyclomatic complexity 23 (threshold: 15)
[WARN] src/api/routes.rs:12 — Module coupling score 0.89 (threshold: 0.7)
[INFO] src/db/queries.rs — Clean, no issues detectedAgent Feedback Loop
Feed Sentrux output directly into your AI agent for self-improvement:
# Agent writes code → Sentrux analyzes → Agent improves
sentrux analyze ./src --format json | claude-code "Fix these architectural issues"Metrics Tracked
| Metric | What It Measures |
|---|---|
| Cyclomatic complexity | Control flow complexity per function |
| Module coupling | Dependencies between modules |
| Cohesion score | How focused each module is |
| Naming consistency | Convention adherence |
| Dead code detection | Unused functions and imports |
| Dependency depth | Import chain length |
Custom Rules
# sentrux.toml
[rules]
max_complexity = 15
max_coupling = 0.7
max_function_lines = 50
naming_convention = "snake_case"Performance
Written in pure Rust — analyzes 100K LOC in under 2 seconds. Zero runtime dependencies.
Key Stats
- 800+ GitHub stars
- Pure Rust, zero dependencies
- 100K LOC in <2 seconds
- 6 built-in metric categories
- JSON output for agent integration
FAQ
Q: What is Sentrux? A: Sentrux is a Rust-based code quality sensor that monitors architectural patterns and feeds structured feedback to AI coding agents, enabling recursive self-improvement of code quality.
Q: Is Sentrux free? A: Yes, fully open-source under MIT license.
Q: How is Sentrux different from ESLint or Clippy? A: Sentrux focuses on architectural-level metrics (coupling, cohesion, complexity) rather than syntax-level linting. It is designed specifically to feed AI agents, not just display warnings.