<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Raunaknayak on Medium]]></title>
        <description><![CDATA[Stories by Raunaknayak on Medium]]></description>
        <link>https://medium.com/@raunaknayak2006?source=rss-d32f517b3ea5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4GkvThnxpIfZcM49</url>
            <title>Stories by Raunaknayak on Medium</title>
            <link>https://medium.com/@raunaknayak2006?source=rss-d32f517b3ea5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 01:29:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@raunaknayak2006/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Mustel - The Tool That Stops Your AI Editor From Lying to You]]></title>
            <link>https://medium.com/@raunaknayak2006/mustel-the-tool-that-stops-your-ai-editor-from-lying-to-you-3209ae300976?source=rss-d32f517b3ea5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3209ae300976</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[static-analysis-tool]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mustel]]></category>
            <dc:creator><![CDATA[Raunaknayak]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 19:13:15 GMT</pubDate>
            <atom:updated>2026-07-02T19:13:15.937Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AY7DTKkCODXj7eS4BIlQxw.png" /></figure><p>I’m <a href="https://www.linkedin.com/in/raunak-nayak-5b937732a">Raunak Nayak</a>, a maintainer on Mustel alongside <a href="https://www.linkedin.com/in/ameya-kulkarni-a31b74246/">Ameya Kulkarni</a>. We built Mustel to fix a very specific, very repetitive pattern we kept watching happen inside Cursor, Windsurf, and Claude Code. An agent edits a file, saves it, the save introduces a broken import or a small syntax slip, and the agent doesn’t notice until it tries to run the code and hits a traceback. Then it reads the error, patches the file, runs it again, hits another error, and repeats. Every one of those turns costs real context tokens, and because output tokens are priced higher than input tokens on most models, that loop is quietly expensive as well as slow.</p><h3>Why Ordinary Linters Don’t Solve This</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3eJxCA6znl8C-RuZGzI_Dw.png" /></figure><p>Ruff, ESLint, and Bandit were all built with a human reader in mind. They print to a terminal or underline a line in an editor, and a person reads the message and fixes it whenever they get around to it. An AI agent doesn’t work that way. It tends to ignore an underlined warning until execution actually fails, which means the linter’s output only becomes useful after the expensive part has already happened. On top of that, a raw linter scan handed to an agent usually arrives as a verbose JSON blob or a wall of terminal text, and parsing that costs tokens the agent didn’t need to spend. Mustel’s job is to sit in front of that gap and hand back something small and structured instead.</p><h3>The Save Loop Guardrail</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3UpY3aYntzvNDsqBOSnydQ.png" /></figure><p>The core of Mustel is a guardrail that sits on the save event itself. The moment a file is written, Mustel runs a fast compile and import check through its MCP connection, and if it finds a syntax error, a broken import, or a type mismatch, it doesn’t write that to a log file anywhere. It injects a flagged block directly into the tool result the agent sees next, something close to:</p><pre>=== MUSTEL GUARDRAIL ALERT ===<br>Compile error detected. Fix this before continuing or showing changes to the user.</pre><p>Because the agent receives this as part of its own tool output rather than something it has to go looking for, it tends to resolve the break in the very next turn instead of stumbling into it three prompts later.</p><h3>Keeping It Fast: Stat-Based Caching</h3><p>Running a full analysis pass on every keystroke would make an editor feel sluggish, so Dev Mode leans on a cache that never actually reads file contents. Instead of hashing a file to detect changes, Mustel checks its modification time and size, a system call that’s essentially free compared to reading and hashing bytes. If those two values match what’s cached, Mustel skips straight to returning the stored findings. If they don’t, only the changed file gets re-scanned. That’s what keeps incremental review latency under 30 milliseconds in practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8aBBxp76J0y3VKAIPW_JAw.png" /></figure><h3>Mapping the Codebase Instead of Reading All of It</h3><p>A large share of an agent’s token spend goes toward just understanding a project’s shape, reading whole files to figure out what classes and functions exist and how they connect. Mustel’s get_code_map replaces that with a compressed outline: an AST walk for Python and Jupyter files, a regex-based pass for JS and TS, pulling out class names, function signatures, and the first line of each docstring. A typical map looks something like this:</p><pre>core/runner.py<br>  class ScanRunner<br>    def run_dev_mode(path)<br>    def run_audit_mode(path)<br>  def main()</pre><p>The result usually stays under roughly 1,500 tokens even for a mid-sized repo, which is a fraction of what reading the equivalent files directly would cost.</p><h3>Five Analysis Layers, Running in Parallel</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r76Ct25FjFL-VJYtCLQ-JA.png" /></figure><p>Underneath all of this, Mustel coordinates five checks side by side. Ruff handles Python syntax and style. Oxlint, a Rust-based linter, covers JavaScript and TypeScript, including React and Next.js conventions. Bandit does the security pass, things like SQL injection patterns and unsafe deserialization. Pip-audit checks your installed packages against known CVEs. And a custom pattern engine, driven entirely by YAML, checks framework and library-specific footguns, things like missing timeouts on requests calls, disabled SSL verification, weak hashing algorithms, or debug mode left on in a Flask or Django settings file. The pattern engine is scoped to whatever your file actually imports, so it only runs checks relevant to the libraries you&#39;re using.</p><p>Anyone can extend that pattern library without touching Mustel’s Python codebase at all. A rule is just a YAML block naming the module, the detection method (a keyword match, a regex, or a check for a missing function argument), a severity, and a message. A minimal example, checking that an HTTP call sets a timeout, looks like this:</p><pre>module: requests<br>patterns:<br>  - id: &quot;requests-missing-timeout&quot;<br>    severity: &quot;warning&quot;<br>    detect:<br>      type: &quot;function_call_missing_arg&quot;<br>      functions: [&quot;requests.get&quot;, &quot;requests.post&quot;]<br>      missing_arg: &quot;timeout&quot;<br>    message: &quot;Add timeout=30, an unbounded request can hang indefinitely.&quot;</pre><h3>Fixing Interpreter Path Issues in 0.3.4</h3><p>One practical problem we ran into with earlier releases was editors launching Mustel’s MCP server inside a shell that didn’t inherit the right Python path, which caused silent startup failures. Version 0.3.4 fixes this by resolving the absolute path of the active Python interpreter at setup time and writing that directly into the global MCP configuration for Cursor, Windsurf, Claude Code, and Claude Desktop, so the correct binary gets launched regardless of the shell environment the editor happens to use.</p><p>Getting started is still just pip install mustel followed by mustel bootstrap --global, and it&#39;s open source under MIT. If you want to add coverage for a library we haven&#39;t gotten to yet, the YAML pattern library on GitHub is the easiest place to start.</p><p><strong>Mustel</strong> is open source under the MIT license. Install it with pip install mustel, read the full documentation and architecture breakdown at <a href="https://mustel.vercel.app/">mustel.vercel.app</a>, or look through the source on <a href="https://github.com/mustel-py/mustel">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3209ae300976" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>