DEV Community

Cover image for Context Is the New Code
Karl Wirth
Karl Wirth

Posted on • Originally published at nimbalyst.com

Context Is the New Code

The Prompt Isn’t the Problem

The prompt is the last mile. The tip of the iceberg. What actually determines the quality of AI-generated code is everything you give the agent before the prompt: your spec, your architecture diagram, your mockup, your data model, your existing codebase, your test suite, your acceptance criteria.

That’s context. And context is the new code.

The Evidence

Consider two approaches to the same task. Same Claude Code model. Same feature request: “Build a team management settings page.” Same developer.

Approach 1: Prompt only The developer opens a Claude Code session and types: “Build a team management settings page where admins can invite members, assign roles, and remove people.”

The result is a generic CRUD page. Hardcoded role values. No error handling for edge cases. No loading states. No confirmation dialogs. No empty state. Functional but shallow. The AI had to guess at every design decision, and it shows.

Approach 2: Context-rich session The developer writes the same prompt, but the Claude Code session also has access to:

  • A 2-page spec with acceptance criteria, edge cases, and error states
  • A visual wireframe showing the exact layout, including empty state and delete confirmation
  • An entity diagram showing Team, TeamMember, and Invitation entities with relationships
  • The existing codebase’s component library and style patterns
  • Three relevant test files showing the project’s testing patterns
  • The result is a production-quality page matching the existing design system. Proper role-based access control. Loading skeletons. Error boundaries. Confirmation dialogs. Empty state. Tests following project conventions. Practically shippable.

The second approach doesn’t just produce marginally better code — it produces categorically different output. The AI stops guessing and starts executing. Same model, same prompt, radically different results. The difference is context.

Why Context Beats Prompts

A prompt tells the AI what to do. Context tells the AI what you know, what you’ve decided, and what good looks like.

Context provides constraints
“Build a settings page” has infinite solutions. A mockup showing the exact layout has one. Constraints improve output because they reduce the solution space to the right answer.

Context provides patterns
When Claude Code can see your existing components, it follows your patterns. When it can see your test suite, it writes tests the same way. Without context, it invents patterns. With context, it matches yours.

Context provides decisions
A spec with edge cases represents decisions you’ve already made. “When you remove the last admin, show an error” is a decision. Without that context, the AI either ignores the edge case or makes a different decision. Your context encodes your judgment.

Context provides standards
A data model with specific field names, types, and constraints is a standard. It eliminates the “what should I name this column?” decisions that produce inconsistent code when made ad hoc.

The Craft of Context

If context is the new code, then crafting context is the new programming.

Here’s what good context looks like for a feature:

  • Plan/Spec (markdown): What the feature does, who it’s for, acceptance criteria, edge cases, error states, non-requirements (what it explicitly doesn’t do)
  • Architecture (Mermaid or Excalidraw diagram): How the feature fits into the existing system. Services, databases, APIs involved.
  • Mockup (HTML/CSS): What the UI should look like. Layout, components, interactions, states (loading, error, empty).
  • Data model (visual schema): Entities, relationships, fields, constraints, indexes.
  • Existing code (codebase access): Component library, style conventions, test patterns, API conventions.
  • Test cases (markdown): What success looks like. Expected behaviors, user flows, and validation criteria the AI can code against.
  • And here’s the key: you’re not building all this context by hand. You’re building it with your AI agents. Claude Code helps you write the spec, generate the architecture diagram, scaffold the mockup, draft the data model. The AI is your co-author for context, not just for code. You bring the judgment and decisions; the agent helps you capture and structure them.

Each piece of context eliminates a category of decisions the AI would otherwise make randomly (or badly). The more context, the less variance. The less variance, the higher quality.

Excalidraw architecture diagram providing visual context for AI agents in Nimbalyst

The Context Workspace

This is why we built Nimbalyst as an integrated workspace rather than a standalone AI chat.

If context matters most, then the tool should optimize for context creation and delivery:

  • WYSIWYG markdown for writing specs that Claude Code can read and edit
  • Mermaid and Excalidraw diagrams embedded in specs for architecture context
  • MockupLM for visual mockups that Claude Code can see and reference
  • Excalidraw for data model and architecture diagrams that Claude Code uses as a blueprint
  • Session linking so context from previous sessions carries forward
  • File-to-session tracking so the AI knows which sessions touched which files
  • Everything in one workspace. Everything visible to Claude Code. No copy-pasting context from one tool to another. No “let me describe what the mockup looks like.”

The Implication for Teams

If context is the new code, then context quality is the new code quality.

Code review becomes context review. “Did you provide enough context before asking the agent to code?” “Is the spec missing edge cases?” “Does the mockup match the design system?” “Is the data model normalized?”

The best developers won’t be the best coders. They’ll be the best context crafters — people who can build complete, precise, well-structured context that produces excellent AI-generated code on the first try.

FAQ
Q: This sounds like you’re just saying “write better specs.” A: Partly, yes. But it’s more than specs. It’s the combination of specs + visual mockups + data models + existing code patterns all being visible to the AI simultaneously. That integration is the key — not any single piece of context.

Q: Doesn’t this make the PM role more important than the developer role? A: It makes context creation more important than code writing. Whether that’s the PM’s job or the developer’s job depends on your team structure. Many developers write their own specs. The point is that whoever crafts the context determines the output quality.

Q: What about complex code where context isn’t enough? A: Context doesn’t replace engineering expertise. For performance optimization, distributed systems, complex algorithms — you need deep technical knowledge. Context gets you 80% of features. The other 20% still needs human engineering judgment.

Top comments (0)