python-code-simplifier — Claude Code subagent: setup and guide
python-code-simplifier refines recently modified Python code for clarity and maintainability without altering existing program logic or outputs.
CC-BY-SA-4.0 ★ 540 updated 2026-07-14
/plugin marketplace add trailofbits/skills-curated
/plugin install python-code-simplifier@skills-curatedWhat python-code-simplifier does
Operating on the opus model, this subagent inspects freshly edited Python files to streamline their structure. It unrolls deeply nested conditionals with guard clauses and adds type annotations across public signatures.
Readability takes priority over short one-liners. The agent avoids syntax tricks like overloaded walrus operators or dense comprehensions. Unless you explicitly ask for a wider pass, changes stay confined to code touched in the current session.
What it helps with
- flatten nested conditional branches using early returns
- apply type hints across public functions and return values
- organize absolute imports into clean standard library and local tiers
- replace complex lambda expressions with explicit function definitions
Example prompts for the agent
- Review the latest changes in
services/auth.pyand simplify nested logic. - Clean up recent edits in the current session and add missing type annotations.
- Flatten the condition checks in our API route handler using guard clauses.
How to install python-code-simplifier
1Plugin marketplace
/plugin marketplace add trailofbits/skills-curated/plugin install python-code-simplifier@skills-curated2Manually: put the files in place
.claude/agents/python-code-simplifier.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/python-code-simplifier.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/python-code-simplifier.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about python-code-simplifier
How do I install python-code-simplifier in Claude Code?
First add the catalog with /plugin marketplace add trailofbits/skills-curated. Then install the subagent by running /plugin install python-code-simplifier@skills-curated.
What does python-code-simplifier do?
It refines Python code touched during the active session to improve style and clarity while keeping the original execution behavior intact.
Which files does this subagent modify?
It concentrates strictly on files edited during the active session unless instructed to inspect a wider scope.