# MUE-X

A Python agent that edits and mutates its own source code in a continuous loop, using AST-level transformations rather than model-generated diffs, to add error handling, optimizations, and new capabilities.

MUE-X is an experimental agent that opens its own Python modules and rewrites them while running, in a continuous observe-absorb-mutate-verify loop. It generates candidate changes with six AST-level mutation strategies -- adding retry and error-handling code, folding constants and caching pure functions, drawing from a pool of pre-validated patterns, fusing two behaviors into a new one, and removing duplicate functions -- then validates each change with Python's own parser, backs up the original file, and rolls back on failure.

When a module grows past 350 lines the agent splits it into two modules at function boundaries. It also periodically queries the GitHub API for related repositories to absorb into its own codebase.

It runs as a Claude Code command, a standalone CLI, or inside Gemini CLI and Copilot CLI.

Website: https://github.com/KorroAi/mue-x
