# python-code-simplifier

The python-code-simplifier plugin refines recently changed Python code without altering its behavior. Use it after edits to make the code easier to read and maintain.

- plugin · `type=plugin` · Claude Code · ★ 540 repo stars
- Author: Anthropic
- License: CC-BY-SA-4.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/trailofbits/skills-curated/tree/HEAD/plugins/python-code-simplifier
- Updated: 2026-07-14
- Security check: automated, 2026-11-16 (text and 1 script file) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/plugins/python-code-simplifier

## What it does

After Python code is added or changed, the plugin reviews the recent work. It can reduce needless indentation, use consistent Python naming, add annotations to public function signatures, and reorder imports. Dense expressions can be rewritten in a more readable form.

It also removes duplicate logic and comments that do not help explain the code, while grouping related operations without adding unnecessary abstractions. The program’s behavior should stay the same; the edits target how the code is expressed. Its usual scope is recent changes, so ask explicitly when you want it to inspect more.

## Install

### Claude Code (native platform)

**Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add trailofbits/skills-curated
```
In the agent chat (not a shell):
```text
/plugin install python-code-simplifier@skills-curated
```

## When to use it
- flatten nested conditions in Python functions
- align names with common Python casing conventions
- add type annotations to public function signatures
- untangle dense expressions and remove redundant comments

## Example prompts
- Simplify the Python code I just changed while keeping its behavior the same.
- Review the edited files and sort their imports in Python style.
- Inspect this whole module and make its expressions easier to follow without changing the logic.

## Similar
- [python-design-patterns](https://affpapa.org/en/nevibecode/skills/python-design-patterns.md) — skill · 22842 installs
- [python-anti-patterns](https://affpapa.org/en/nevibecode/skills/python-anti-patterns.md) — skill · 13278 installs
- [code-simplifier](https://affpapa.org/en/nevibecode/skills/rtk-ai-code-simplifier.md) — skill · 2300 installs
- [python-best-practices](https://affpapa.org/en/nevibecode/skills/python-best-practices.md) — skill · 871 installs
- [python-expert-best-practices-code-review](https://affpapa.org/en/nevibecode/skills/python-expert-best-practices-code-review.md) — skill · 692 installs
- [python](https://affpapa.org/en/nevibecode/skills/pproenca-python.md) — skill · 329 installs

From the same set: [trailofbits/skills-curated](https://affpapa.org/en/nevibecode/by/trailofbits/skills-curated.md) — 51 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
