Open Source MIT License

Guardrails for the new AI coding era

Mustel is a local, non-AI static analysis layer that intercepts editor save loops. It formats and compresses code diagnostics into ultra-short prompts to guide coding agents without context bloat.

pip install mustel
GitHub
Want to learn more?Read our blog on Medium
Mustel Mascot
API Overhead & Context Bloat

Your AI IDE wastes piles of tokens

Standard coding agents transfer thousands of lines of raw, duplicate linter logs on every save loop. These verbose payloads clog context windows, increase latency, and inflate your API bills.

AI Token Waste Pile
Comprehensive Integrations

Mustel supports a huge ecosystem

Out-of-the-box rule configurations covering 26 core packages, cloud SDKs, web frameworks, and system utilities.

Python
TypeScript
JavaScript
Node.js
Jupyter
AWS
Azure
Google Cloud
GitHub
Django
FastAPI
Flask
Streamlit
Next.js
React
Vue
Svelte
SolidJS
NumPy
SQLite
PickleDB
Images
Images Jpg
Python
TypeScript
JavaScript
Node.js
Jupyter
AWS
Azure
Google Cloud
GitHub
Django
FastAPI
Flask
Streamlit
Next.js
React
Vue
Svelte
SolidJS
NumPy
SQLite
PickleDB
Images
Images Jpg
Mustel Architecture

Deterministic Code Quality

Mustel executes linter checks, deduplicates overlap reports, and runs custom YAML pattern checks locally. It formats all issues and creates a sub-200 character summary to instruct AI agents clearly.

01 / Dev Mode Cache

Fast file stat validation (mtime + size) returns findings in under 30ms.

02 / Local Pipeline

Written-in-Rust linter tools (Ruff, Oxlint) scan scripts concurrently.

Mustel MCP Runtime Pipeline

File Saved
Concurrence
Normalizer
agent_prompt

mustel map [PATH]

Compiles files into structured AST outline nodes, reducing prompt context overhead by 95%.

← Swipe horizontally to explore map →
Prompt Context Size
30,000 tokens
AST Outline Mapping0%
Hover over nodes inside the canvas to inspect outlines.
auth.pymodels.pydatabase.pyutils.pyconfig.yaml
Empirical Performance

System Benchmarks

Measured empirically via tiktoken (`cl100k_base` and `o200k_base` encodings) on real codebases.

-34.4%

Context Token Savings

Empirical reduction in total input tokens sent to LLMs.

-64.9%

Output Token Reduction

By presenting pre-summarized errors, LLMs write solutions directly.

75%

Independent Recall

Measured against external, un-tuned test code. 100% on customized benchmarks.

Benchmark Test Subjects

Project NameSourceFilesLinesVulnerabilitiesDetection Rate
project_authInternal1825100%
project_backendInternal1835100%
project_independentUn-tuned21921675%
EVFAOpen-source23453955.6%

How Mustel Integrates

Mustel runs locally and hooks directly into your editor or terminal pipeline.

mustel-scan
~/project$mustel scan
Ruff linter... ✓ 0 issues
Bandit security... ✓ Secure
pip-audit CVE... ✓ Clean
1

Local Scanning

Run `mustel scan` or initialize the MCP server. Mustel runs Ruff linting, Bandit security audits, and pip-audit CVE lookups locally in milliseconds.

src/auth.pypython
1234
# yaml check: insecure-jwt
algorithm = "none"
Rule:YAML_04 (No Verify)
jwt.decode(token, verify=False)
2

Pattern Matching

It parses your python files and runs YAML-defined regex rules to scan for anti-patterns across 22 popular libraries.

MCP Server
Coding Agent
Fixing B608...
3

Structured Context

An MCP server outputs the compressed findings into the system instructions, allowing the coding agent to query issues by ID and solve them immediately.