Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Flatten deeply nested conditionals into readable, early-return code. Use on any function with 3+ levels of indentation.
.claude/skills/archive228-reduce-nesting/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -35% | 0% |
| case-14 | ✗→✓ | ▲ Improved | -36% | 0% |
| case-13 | ✓→✗ | ▼ Worse | -17% | 0% |
| case-20 | ✓→✗ | ▼ Worse | -22% | 0% |
Deep nesting hides bugs in the branches you didn't read.
if (!valid) return; instead of wrapping the whole body in if (valid) {...}.Target: no function deeper than 2-3 levels. If you still need more, the function is doing too much — split it.
Other measured skills in the registry, with their headline benchmark lift.