Skip to content

Permutation Frameworks

Generate multiple solution variants and evaluate systematically. Exploring design spaces when there is no obvious single answer.

Your first instinct when facing a design decision is to pick something and start building. Usually fine. But some problems genuinely don't have an obvious answer. Database schemas, caching strategies, API designs, component architectures. These have real tradeoffs that are hard to reason about in your head, and committing to the first idea that sounds reasonable means you might miss something better.

Permutation frameworks flip this. Generate multiple variants, then evaluate them against each other. Claude Code is unusually good at this because it can produce several complete implementations fast and compare them on whatever criteria you care about.

Why Multiple Variants Win

Ask Claude Code "implement caching for this API" and you get a solid answer. One answer. Whatever approach seemed most reasonable given the context at that moment. Maybe Redis. Maybe in-memory. The choice is somewhat arbitrary, and you'd never know what you missed.

Ask for three different approaches and something shifts. Claude Code has to think about the problem from multiple angles. Tradeoffs that would've stayed hidden surface immediately. You see the decision space, not just one point in it.

This isn't about generating noise. When you see Redis next to in-memory next to CDN-based caching side by side, you understand things about your problem that you wouldn't have noticed looking at any single solution.

The Generate, Evaluate, Select Framework

Three steps. Works for everything from algorithm selection to UI patterns.

Generate. Ask Claude Code to produce multiple variants. Be explicit. Don't say "give me options." Tell it how many variants and what dimensions should differ between them. Three to five works well. Fewer than three isn't enough diversity. More than five is noise.

Evaluate. Compare variants on specific criteria. Most people skip this step or do it in their head. That's a mistake. Define what matters before you compare. Performance? Readability? How easy it is to change six months from now? Ask Claude Code to evaluate each variant against your criteria explicitly. A structured comparison forces clear thinking that gut feel doesn't.

Select. Doesn't always mean picking one winner. Sometimes the best solution borrows from multiple variants. Variant A has the best data model, variant C has the better error handling. Synthesis is a perfectly valid outcome, and often the best one.

Structured Prompts That Actually Work

The difference between a useful comparison and a wall of text comes down to prompt structure.

"Give me some options" produces vague mush. "For each approach, list the pros, cons, implementation complexity, and the scenario where this approach is the best choice" gives you something you can actually reason about. Adding constraints like "one should optimize for read performance, one for write performance, one for simplicity" ensures the variants are meaningfully different.

If you find yourself doing this often for a project, put evaluation criteria in your CLAUDE.md. Something like "when comparing architectural approaches, evaluate on: latency, operational complexity, cost, and team familiarity." Saves you from re-specifying it every time.

Using Subagents for Parallel Exploration

Subagents make permutation frameworks genuinely powerful. Instead of generating all variants in one conversation (where each variant is influenced by the others), have separate subagents explore different approaches independently. Fresh context window each time. No anchoring bias.

Two patterns worth knowing. Competing hypotheses: spawn subagents to investigate different theories about a bug or different architectural approaches. Compare findings. Writer/reviewer: one session writes an implementation, another reviews it with fresh eyes, catching baked-in assumptions the writer didn't even notice.

Both patterns work because they produce genuine diversity in thinking, not variations on a theme.

Try It

Pick a real decision you're facing in a project. Maybe it's how to structure a new feature, or how to handle authentication, or which data fetching pattern to use. Open Claude Code and run something like this:

claude "I need to implement user session management for this app. Give me 3 different approaches with meaningfully different tradeoffs. For each one, describe the approach in 2-3 sentences, list 2 pros and 2 cons, rate the implementation complexity as low/medium/high, and tell me the scenario where this approach is the best choice."

Look at what comes back. You'll probably learn something about your problem that you hadn't considered. If one approach clearly wins, great. Higher confidence. If the decision is genuinely close, you now understand why and can make an informed call instead of a gut-feel one.

Then try synthesis. Ask Claude Code to combine the best elements from two approaches into a hybrid. Sometimes the best answer isn't any single variant.

When This Is Overkill

Formatting a date? You don't need three variants. Just write it.

Reach for permutation frameworks when the decision has real consequences that are hard to reverse. Architecture, database schemas, API contracts, state management. Picking wrong costs weeks of refactoring. Ten minutes generating and comparing variants is nothing against that risk.

The other signal is uncertainty. If you genuinely don't know which approach is better, that's telling you something. The problem has tradeoffs you haven't mapped yet. This is how you map them.

Bottom Line

  • No obvious single answer? Generate three to five variants instead of going with your first idea
  • Structure prompts for comparable output: pros, cons, complexity, best-fit scenario
  • Subagents give you genuine diversity (no anchoring bias)
  • Synthesis often beats picking a single winner
  • Reserve this for consequential, hard-to-reverse decisions

Mastering Claude Code

Lesson 55 of 70