ConfigsApr 6, 2026·2 min read

Sentrux — Architectural Feedback Sensor for AI Agents

Real-time code quality sensor written in pure Rust that closes the feedback loop for AI coding agents. Monitors architecture patterns and feeds improvement signals back to agents. 800+ stars.

TL;DR
Sentrux monitors code quality in real time and feeds structured feedback to AI coding agents.
§01

What it is

Sentrux is a real-time architectural sensor written in pure Rust that helps AI coding agents close the feedback loop for code quality improvement. It monitors your codebase for architectural patterns, complexity metrics, and code smells, then feeds structured feedback back to AI agents so they can iteratively improve their own output.

Sentrux targets teams using AI agents in production who want to ensure code quality does not degrade over time. It works with Claude Code, Cursor, and any agent that accepts structured feedback.

§02

How it saves time or tokens

Without Sentrux, AI agents operate without visibility into the architectural quality of the code they generate. They may introduce high cyclomatic complexity, tight coupling, or naming inconsistencies that accumulate over time. Sentrux provides continuous monitoring with structured JSON output that agents can parse and act on, creating a self-improving loop. The estimated overhead is 2,400 tokens per analysis cycle.

§03

How to use

  1. Install Sentrux:
cargo install sentrux
  1. Run watch mode for continuous monitoring:
sentrux watch ./src --rules complexity,coupling,naming
  1. Integrate with your AI agent:
# Agent writes code, then Sentrux analyzes it
sentrux analyze ./src --format json | your-agent

# Example output:
# {"file": "src/auth/handler.rs", "line": 45,
#  "severity": "warn",
#  "rule": "complexity",
#  "message": "Cyclomatic complexity 23 (threshold: 15)"}
§04

Example

The agent feedback loop in practice:

# Step 1: Agent writes code
codex --auto 'Implement the payment processing module'

# Step 2: Sentrux analyzes the result
sentrux analyze ./src/payments --format json > feedback.json

# Step 3: Agent reads feedback and improves
codex --auto 'Fix the issues in feedback.json:
  - Reduce complexity in process_payment() from 23 to under 15
  - Extract helper functions for validation logic
  - Fix naming: use snake_case consistently'

# Step 4: Verify improvements
sentrux analyze ./src/payments --format pretty
# [OK] All checks pass
§05

Related on TokRepo

§06

Common pitfalls

  • Setting complexity thresholds too low generates excessive warnings that agents cannot prioritize. Start with standard thresholds and tighten gradually.
  • Running Sentrux on generated code (tests, migrations) produces false positives. Exclude auto-generated directories from the analysis path.
  • Relying solely on Sentrux for code review misses semantic issues that static analysis cannot catch. Use Sentrux as a complement to human code review, not a replacement.

Frequently Asked Questions

What metrics does Sentrux monitor?+

Sentrux monitors cyclomatic complexity, module coupling scores, naming convention compliance, code duplication, function length, and configurable custom rules. Each metric has a configurable threshold and severity level.

Does Sentrux replace linters like ESLint?+

No. Sentrux focuses on architectural-level metrics (complexity, coupling, module structure) rather than syntax and formatting. Use Sentrux alongside your existing linter for comprehensive code quality monitoring.

What languages does Sentrux support?+

Sentrux supports Rust, Python, TypeScript, JavaScript, Go, and Java through language-specific analyzers. Language support is extensible through plugins.

How does the agent feedback loop work?+

The agent writes code, Sentrux analyzes it and produces structured JSON feedback, and the agent reads the feedback to make targeted improvements. This creates an iterative self-improvement cycle.

Is Sentrux fast enough for watch mode?+

Yes. Written in Rust, Sentrux analyzes most codebases in under a second. Watch mode re-analyzes only changed files, making the feedback loop near-instantaneous.

Citations (3)
🙏

Source & Thanks

Created by Sentrux. Licensed under MIT.

sentrux — ⭐ 800+

Thanks for building the feedback loop AI coding agents need.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets