Skip to main content
subagent CX Codex

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add trailofbits/skills-curated
/plugin install python-code-simplifier@skills-curated
Open on GitHub

What 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.py and 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-curated

2Manually: put the files in place

.claude/agents/python-code-simplifier.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

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.

Similar subagents

All subagents for Code review and refactoring →

From the same set51

The whole set →
plan Creates task_plan.md, findings.md and progress.md in the project root, so the goal, research and session log sit next to the code. CX Codex +1 ★ 540repo stars grilling The grilling skill questions a plan or design one decision at a time, surfacing unresolved choices and dependencies. Use it before implementation when the details still need agreement. CX Codex +1 ★ 540repo stars openai-yeet openai-yeet takes your changes from a dirty working tree to a draft pull request in one run through GitHub CLI. Handy when the whole chain has to happen at once. CX Codex +1 ★ 540repo stars openai-sentry The openai-sentry Claude Code skill reads Sentry issues and events through the API and summarizes production errors in a compact report. CX Codex +1 ★ 540repo stars openai-playwright openai-playwright is a Claude Code skill that controls a real browser from the terminal. It runs for page navigation, form entry, data collection, screenshots, and UI debugging. CX Codex +1 ★ 540repo stars openai-gh-fix-ci openai-gh-fix-ci reads the failing GitHub Actions checks on a pull request, pulls the logs, names the cause and drafts a fix. Edits land only after you approve the plan. CX Codex +1 ★ 540repo stars openai-jupyter-notebook openai-jupyter-notebook is a Claude Code skill that generates, structures, and edits clean Jupyter notebooks (.ipynb) for analytical experiments and step-by-step guides. CX Codex +1 ★ 540repo stars security-awareness The security-awareness skill guides an agent through phishing checks, domain verification, and safer handling of credentials. Use it when an agent works with email, links, or sensitive data. CX Codex +1 ★ 540repo stars

Project sponsors

Companies that keep this analytics open