Skip to main content

Why Claude Code Isn’t “Coding,” It’s Just Good At Sudoku Filling in the Blanks

The Sudoku of Software: AI isn’t “coding” but trying to fit puzzle pieces

Updated 13 min readMarkdown
Why Claude Code Isn’t “Coding,” It’s Just Good At Sudoku Filling in the Blanks

Let’s get straight to the point: AI doesn’t code the way you think it does.

You type a prompt into Claude Code or GPT, and it spits out a perfectly formatted Python script that integrates with the Polygon API to fetch real-time stock data. It feels like magic. It feels like the AI understood your request, planned a solution, and executed it.

But it didn’t. And understanding what actually happened—the mechanics behind that illusion—will transform how effectively you use these tools.

What the AI just did was solve a high-dimensional Sudoku puzzle. If you want to build actual software with AI assistance without setting your production environment on fire, you need to understand how this game is played.

The Myth of the “Thinking” Machine

We need to kill the word “reasoning” when we talk about LLMs. It implies a conscious walk from Problem A to Solution B, a deliberate engineering of logic.

Distinguished AI researcher Subbarao Kambhampati at Arizona State University has spent years challenging this misconception. His research demonstrates that LLMs don’t actually plan or reason—they perform what he calls “approximate retrieval.” Rather than generating novel solutions, they’re retrieving cached patterns from their training data that statistically match your request.

Think of it as geometric recovery—and understanding this distinction explains almost every frustrating behavior you’ve experienced with AI coding assistants.

Imagine all the code in the world—every GitHub repo, every StackOverflow answer, every documentation page—mapped out on a massive, invisible landscape. This isn’t just a metaphor; it’s how researchers describe what’s called latent space, the high-dimensional terrain where AI models actually operate. In this landscape, common patterns carve out deep, stable valleys. Rare edge cases exist as unexplored wilderness.

When you write a prompt like:

async def fetch_crypto_prices(symbols: list):

You’re not asking the AI to think. You’re showing it a pattern with a hole—a curve that stops abruptly. The model’s job isn’t to engineer the rest from first principles. It’s to mathematically calculate the smoothest way to complete that pattern based on the millions of similar shapes it’s seen before.

Here’s Kambhampati’s key insight in practice: The AI is not generating novel logic; it’s performing approximate retrieval. It’s searching through its training data for a cached template that best fits the geometric constraints of your prompt. The code looks like understanding because the pattern is so well-worn that the retrieval is nearly perfect.

Until it isn’t.

And that’s when you run into the problems every developer faces in 2026: getting stuck in loops with Claude Sonnet 4.5, watching quality degrade over a long session in Cursor, or getting confidently wrong answers from GPT that compile but fail in production.

The “Box of Puzzle Pieces” (Why Your Choice of AI Actually Matters)

This geometric recovery model explains something most developers discover by accident: different AI models are better at different things, and it’s not just about “intelligence.”

Think of an AI model as a box of puzzle pieces—each piece a token, a fragment of code or text collected during training.

  • Common code (React hooks, FastAPI endpoints, PostgreSQL queries, TypeScript types): The model has millions of pieces for these. The valley is deep, smooth, and well-traveled. Retrieval is nearly instant and highly accurate.

  • Niche code (Legacy Java EE patterns, custom GraphQL federation, cutting-edge WebGPU shaders): The box is nearly empty. The model is guessing based on vague similarities to other patterns.

This is why AI coding is fundamentally corpus-dependent. If the model hasn’t seen the shape of your problem a thousand times before, it cannot reconstruct the solution from experience. It can only extrapolate—and extrapolation is where things get dangerous.

Here’s what most developers miss: every AI model was trained on a slightly different corpus. GPT-5 saw different open-source repos than Claude Opus 4.5. Claude processed different documentation than Gemini 3. DeepSeek’s training emphasized different coding patterns than any of them.

They each have different boxes of puzzle pieces. Different maps of the landscape. This is a feature you should exploit, not ignore.

In 2026, this matters more than ever. Claude Sonnet 4.5 excels at nuanced refactoring and understanding complex codebases. GPT-5 is faster for standard boilerplate. Gemini 3 handles multi-file context well. Knowing which valley each model has carved deepest helps you pick the right tool.

Why You Get Stuck: Understanding Context Drift and Local Minimums

Now we can explain some of the most frustrating experiences in AI-assisted development.

Context Drift (Why Long Conversations Degrade)

You’ve experienced this: the first response is great, the second is good, the third starts introducing bugs, and by the tenth iteration in Claude Code, the AI seems to have forgotten what you were building entirely.

This is context drift, and it’s a direct result of geometric recovery. Each response the AI generates becomes part of the context for the next response. Over time, you’re no longer retrieving from the original, well-worn valley in the training data—you’re retrieving from the AI’s own previous outputs, which are themselves statistical approximations.

It’s like making a photocopy of a photocopy of a photocopy. Each iteration introduces small distortions, and those distortions compound. Research suggests quality degrades noticeably after about 30% of the context window is filled with AI-generated content.

Practical fix: Start fresh conversations more often. Don’t try to iterate 20 times in the same thread. Once you hit 5-7 exchanges, export your working code and start a new conversation with clear context. In Claude Code, use /clear or start a new terminal session. Tools like CLAUDE.md files can help maintain persistent rules across sessions without polluting context.

Getting Stuck in Loops (The Local Minimum Problem)

You’ve also experienced this: you get an error, paste it back to the AI, and it gives you a slightly different solution. You try that, get a different error, paste it back… and the AI gives you the exact same solution from three iterations ago.

This is the local minimum problem—exactly what Kambhampati’s research predicts. In the geometric landscape, the AI has found a shallow valley—a pattern that looks reasonable based on the immediate context—but it’s the wrong valley. The statistical pressure keeps pulling the model back to the same pattern because, from the AI’s perspective, it’s the smoothest fit for the geometry of your conversation.

The model isn’t learning or reasoning its way out. It’s stuck in a statistical loop, cycling through the limited set of patterns that seem to fit. This is approximate retrieval failing: the cache doesn’t contain the right pattern, but the model keeps retrieving the closest (wrong) matches.

Practical fix: Don’t keep rephrasing the same prompt. You’re just reinforcing the same geometric constraints. Instead, either (a) dramatically change your approach in the prompt, providing totally different context, or (b) switch models entirely. After 3-4 attempts, eject and think through the problem manually.

Confident Hallucinations (The “Out of Distribution” Trap)

This is the most dangerous pattern: the AI generates code that looks perfect—proper syntax, logical structure, confident naming—but uses API endpoints that were deprecated in the 2024 version, or library methods that simply don’t exist.

This happens when you’ve asked for something out of distribution (OOD)—statistically rare in the training data. The model runs out of good puzzle pieces, but it’s programmed to always generate something. The geometric pressure to complete the pattern overrides the logical requirement for correctness.

The model will invent a method that sounds real (polygon_client.get_real_time_quotes()) because it has seen hundreds of similar patterns in other financial APIs. The geometry is right; the reality is wrong.

This connects to what researchers call the “Platonic Representation Hypothesis.” Models converge on representing human discourse about reality, not reality itself. The AI will confidently describe patterns that appear frequently in documentation or tutorials, even if those patterns are outdated, fictional, or wrong. It’s modeling the shape of how developers talk about APIs, not the actual API specification.

Practical fix: Always verify generated code against actual documentation, especially for: (1) specific library functions, (2) API endpoints, (3) configuration syntax, and (4) anything involving authentication or security. In 2026, use AI extensions or unit tests to validate outputs—hold AI code to the same bar as human code. If it’s critical, test it. Don’t trust the confidence.

The Practical Framework: Three Rules for AI-Assisted Development

Now that you understand the mechanics, here’s how to work with the geometry instead of fighting it.

Rule 1: Match the Task to the Model’s Strengths (Use for Patterns, Not Novelty)

Don’t ask AI to “design a microservices architecture for our fintech platform.” That’s engineering. That’s novelty. That’s out of distribution.

Instead, ask it to “generate a FastAPI endpoint with JWT authentication that validates requests and returns JSON.” That’s retrieval. That’s pattern-matching. The model has seen that valley thousands of times.

Use AI for the boring stuff—the repetitive patterns that humans hate but that appear constantly in training data:

  • Boilerplate generation (REST endpoints, CRUD operations)

  • Standard integrations (OAuth flows, database connections)

  • Common algorithm implementations (pagination, sorting, filtering)

  • Format conversions (JSON to CSV, API response mapping)

  • Regex patterns for validation

  • TypeScript type definitions from API schemas

In 2026, tools like Claude Code’s Plan Mode excel at breaking down these repetitive tasks into discrete steps. Use that for boilerplate, then engineer the novel business logic yourself.

Save your engineering brain for the parts that actually require novel thinking, edge case handling, and business logic.

Rule 2: Model-Shop When You Get Stuck (Different Boxes, Different Pieces)

This is the debugging strategy that influencers are finally talking about but many developers still miss.

When you hit a wall with one model, switch models entirely. Don’t just rephrase—change the box of puzzle pieces you’re working with.

Here’s the workflow I use in 2026:

  1. Try to solve the problem with Claude Sonnet 4.5 or GPT-5

  2. Hit a wall or get stuck in a loop? Don’t waste time rephrasing

  3. Copy the entire context (your requirements + the problematic code)

  4. Paste into a different model (if you were using Claude, try GPT; if GPT, try Gemini 3 or DeepSeek)

  5. Often, you’ll get an immediate solution

Why does this work? Different training data means different valleys in the landscape. Claude might have processed more documentation for that specific TypeScript library. GPT might have seen more GitHub repos with that React pattern. Gemini might handle multi-file context better for your refactoring task.

Some developers even run parallel agents—asking multiple Claudes or using tools like Cursor with different models—to compare puzzle pieces simultaneously.

I’ve watched developers waste hours fighting with one model when the solution was a 30-second switch to a different one. This isn’t a hack; it’s understanding corpus dependency.

Rule 3: Recognize the Edge of the Map (When to Stop Using AI)

Here’s the most important rule: If you try three different AI models and they all give you garbage, stop.

You’ve hit a problem that is genuinely out of distribution. The collective knowledge of the internet hasn’t paved a road here yet. No valley exists. No pattern matches closely enough.

This is your signal to actually engineer a solution. You’re no longer retrieving and adapting; you’re creating something new. This is where human creativity, logical reasoning, and novel problem-solving become essential.

Kambhampati’s research confirms this: when LLMs encounter truly novel planning problems—situations outside their training distribution—they can’t reason their way to solutions. They can only retrieve and approximate. When retrieval fails, engineering begins.

The AIs aren’t failing you. They’re correctly telling you that you’ve reached the edge of the map. This is where you add value as a developer.

Managing Context: Practical Strategies for Better Sessions

Let me give you some concrete strategies I use in 2026 to avoid context drift and maintain quality:

Start Fresh Often: I start a new conversation every 5-7 exchanges. Once I have working code, I export it and begin the next feature in a clean thread with updated context. In tools like Claude Code, I use /clear or restart terminals rather than fighting degradation.

Provide Explicit Context: Instead of “fix this bug,” I write: “This is a Next.js 14 server component that fetches cryptocurrency prices from the Polygon.io REST API. The API returns JSON with fields: ticker, price, timestamp. The error happens when the API rate limit is hit (429 response). Here’s the current code and the error message…”

Use the “Rubber Duck” Technique: Before asking AI to solve something, I write out what I think should happen. This clarifies my own mental model and gives the AI better geometric constraints to work with. It’s treating AI as a pair programmer—you still need to think.

Version Your Prompts: When iterating on generated code, I don’t just say “add error handling.” I say “add error handling for: (1) network timeouts after 5 seconds, (2) 429 rate limit responses with exponential backoff, (3) 404 responses with graceful fallback. Use try-catch blocks with specific error messages for each case.”

Know When to Restart: If the AI starts suggesting you undo changes it made two iterations ago, or if responses start getting shorter and less detailed, that’s context drift. Start fresh.

Leverage Persistent Context Tools: In 2026, use features like CLAUDE.md or project-level configuration to maintain coding standards and rules across sessions without polluting individual conversation contexts. This is the evolved form of rubber ducking.

Use Extensions and Tests for Verification: Don’t rely on manual checks. Use AI-powered linters, unit test generators, or tools that validate AI outputs automatically. Hold AI code to the same standards as human code.

The Bigger Picture: Maps, Not Minds

There’s a larger point here about what we’re building with and what we should expect from these tools.

The promise of AI has always been thinking machines—entities that reason, plan, and understand. What we’ve actually built, as Kambhampati’s research demonstrates, is something different: statistical cartographers that map the landscape of human coding knowledge and help us navigate it efficiently through approximate retrieval.

These tools are incredibly powerful for:

  • Accelerating repetitive tasks developers hate

  • Providing starting points for standard patterns

  • Handling boilerplate you’ve written a hundred times

  • Offering alternative approaches when you’re stuck

  • Exploring unfamiliar APIs or frameworks quickly

They’re poor at:

  • Novel problem-solving requiring genuine reasoning

  • Understanding business context and requirements beyond the prompt

  • Making architectural decisions with long-term implications

  • Handling edge cases outside their training distribution

  • Designing UI/UX that requires aesthetic judgment

  • Planning systems that don’t match common patterns

The question isn’t whether AI will replace developers. The question is whether developers will learn to read the map, recognize its blank spaces, and know when to trust the valleys and when to forge their own path.

Understanding the geometry—knowing that you’re working with retrieval, not reasoning—transforms these tools from frustrating black boxes into powerful accelerators for the parts of development that are truly pattern-based.

At the edge of the known patterns, where the training data runs out and the geometry breaks down, that’s where actual engineering begins.

And no amount of puzzle pieces can solve a problem that’s never been seen before. That’s still your job.


If you want to understand the theoretical foundations behind these practical tips, here’s where to dig deeper:

Subbarao Kambhampati’s Work on LLMs and Planning: Kambhampati (ASU) has published extensively on why LLMs don’t actually reason or plan. His 2024 paper “LLMs Can’t Plan, But Can Help Planning in LLM-Modulo Frameworks” demonstrates that models perform approximate retrieval of cached solutions rather than novel planning. When problems fall outside training distributions, LLMs fail to generate valid plans—they can only retrieve and adapt existing patterns. This explains why switching models works (different retrieval caches) and why novel problems break them.

The Platonic Representation Hypothesis: Research from 2024 suggests large models converge on shared representations—but not of physical reality. They model human discourse about reality (the “Y” in statistical models), not ground truth (the “Z”). This explains confident hallucinations: models retrieve patterns that appear frequently in documentation, even if those patterns are outdated or fictional.

Geometric Recovery and Latent Space: Modern generative models operate through “inpainting” in high-dimensional latent space. They use simplicity bias to find the most efficient statistical fit to fill gaps in patterns. This isn’t engineering; it’s geometric interpolation. Understanding this explains context drift (compounding approximations) and local minimums (getting stuck in shallow statistical valleys).

For developers, you don’t need a PhD in machine learning to use these tools effectively—you just need to understand that they’re really, really good at Sudoku.


Gerard Sans is a developer advocate and educator helping developers build better mental models for working with AI tools. Follow him on X @gerardsans to share your experiences with AI-assisted development, or hit the feedback button if you’ve discovered new debugging strategies. Let’s map the edge of the map together.

About the author

  • I help developers succeed in Artificial Intelligence and Web3; Former AWS Amplify Developer Advocate. I am very excited about the future of the Web and JavaScript. Always happy Computer Science Engineer and humble Google Developer Expert. I love sharing my knowledge by speaking, training and writing about cool technologies. I love running communities and meetups such as Web3 London, GraphQL London, GraphQL San Francisco, mentoring students and giving back to the community.

No comments yet. Be the first to comment.