Attention Is All You Need? Only If the Context Is Right.

Attention Is All You Need? Only If the Context Is Right.

I built a moderately large codebase from the ground up using Claude Code. It started partly out of necessity — circumstances called for hands-on contributions, and I jumped in despite my SQL skills being rusty after years focused on technical strategy and systems-level decisions. What I discovered was that AI-assisted development eliminated the forced choice between those roles — not by making coding easier, but by shifting where I spent my cognitive effort.

For most of my career, fluency in developing and presenting strategic options and fluency in code were competing investments — you chose one at the cost of the other, and that trade-off was a persistent frustration. AI-assisted development dissolves that constraint. The skill I had built — understanding how a problem breaks apart and what structural decisions follow — turns out to be exactly what the workflow demands. The patterns I identified could be directly translated to code, because the AI handled the mechanical translation while I stayed at the level of intent and system design. Development became intent-driven rather than syntax-driven. I spent more time thinking about architecture, not less. I no longer have to choose.

It was not frictionless. Claude in particular exhibits a failure mode I would describe as confidence-escalation-as-distraction: the worse things are going, the more enthusiastic the announcements. You learn to read the signs. When Claude starts decorating its output with bullseye icons and proclaiming a “breakthrough,” or leads with “now I completely understand the problem” — that is precisely the moment to stop and verify. The font size of the celebration is inversely proportional to the likelihood that anything was actually fixed. This does not invalidate the technology. It does mean you need architectural layers with built-in observability — multiple levels of verification that the AI’s claims hold. I also want to be clear: you have to be a good software architect to build larger systems with AI support. The ability to read and review the code yourself is not optional — it is essential. We are still very far from being able to describe a high-level problem and receive ready-to-run code. As long as I retained architectural control and could verify at every layer, the outcomes were strong.

Attention Works — The Question Is What It Operates On

The seminal “Attention Is All You Need” paper laid the foundation for LLMs, and the impact on my workflow has been significant. But working with a large codebase revealed a different bottleneck: attention is only as good as the context it operates on.

The context window is all an LLM knows. Even at 1–2M tokens, it is not enough — not because any single prompt exceeds the window, but because working with a large codebase means sustained dialogue with the code over many interactions. Architectural decisions, constraints, debugging history, domain invariants — all of it accumulates across sessions, and the model has no durable memory of any of it. Anthropic has made meaningful improvements — prompt caching in Claude Code avoids resending the full history and codebase with every interaction — but the constraint remains.

A concrete example of how quickly this becomes an issue without smart caching: when I switched to Bedrock instances, a misconfiguration led me to set DISABLE_PROMPT_CACHING=1. Without caching, every single prompt re-examined the full conversation history and codebase from scratch. I burned through 11M tokens — the full daily limit hardwired to an AWS account on Bedrock — in two hours. That is how much redundant context the caching layer normally absorbs. It is good to see how effective prompt caching has become.

Managing Context Decay

Even without that mistake, context degrades over time within a session. When Claude auto-compacts a session, the summarization is lossy: it preserves what the model considers important, which often does not align with what the developer considers important. Instructions given three prompts ago get dropped. The session becomes unreliable.

My first mitigation was a session-handover.md file that I explicitly instructed Claude to update when I flagged an important finding or decision. I also added a reminder in claude.md to update it regularly — with moderate success, though it did at least remind me to do so manually. I checked session-handover.md into git, which gave me both a working history and the ability to recover context from earlier problem-solving sessions.

Scaling Context Through Documentation and Indexing

The second layer was documentation — which at first sounds like ordinary engineering practice, but the purpose here is different. I had Claude generate architecture docs — often verbose, but that was fine, because the audience was the LLM, not a human reader. The documentation existed to reload architectural context into a model that had none. This worked initially, but eventually the documentation itself consumed too much of the context window, increasing the frequency of /clear cycles.

The solution was a document index with a Claude Skill that taught the model how to search for concepts it did not remember. The design was intentional: Claude would not read the full index. Instead, it had a grep-able lookup — find a concept, read the relevant document, follow references to related concepts, and reconstruct the complete architectural context on demand. The result was an LLM that could rediscover my design intent, understand how I reasoned about architecture, and align its work accordingly.

I had seen a precursor to this behavior earlier, when Claude internalized my complete metamodel for a medical data quality control framework. At that point, I no longer wrote SQL; it explored data by issuing Snowflake commands directly — within the guardrails I had established for data access. (This was also the point where running Anthropic models on Amazon Bedrock became essential, to ensure 100% data privacy.)

Automation Through Skills and Hooks

Claude Skills extended this further. I built a CI/CD skill that aligned Jira tickets with requirements and their associated test cases. Claude could run tests against generic synthetic data, evaluate whether the output matched expected results for correctly cleansed data, and — when it didn’t — investigate the failure and frequently self-correct. It could then deploy corrected Snowflake code and update the Jira ticket automatically. My role was to watch, interject when direction was wrong, and intervene when it entered a failure loop it could not exit. It is certainly a change from the old way of developing software.

Even with Skills, though, some invariants require unconditional enforcement. For example, I discovered that Snowflake’s snow sql command has a templating feature where &variable is treated as a substitution marker — which silently converts logical && operators in JavaScript stored procedures to bitwise &. That kind of latent defect took two days to debug. It cannot be solved by documentation or skills alone, because the LLM might not consult them. Claude Code hooks solve this: reminders that are invisibly injected into every prompt, ensuring certain constraints are never violated.

What This Actually Is

Everything I have described — session handovers, documentation, document indices, skills, hooks — is a form of developer-side RAG. Not vector-based retrieval, but a structured system for making the things that matter most discoverable and persistent beyond the boundaries of a context window. The real work of AI-assisted development at scale is not writing code. It is designing the information architecture that keeps the LLM coherent.

Hi Michael, thanks for the insight. Let me translate your findings / best practices to the far less elaborated personal usage of publicly available LLMs. When using Chatbots for refining search or do planning iteratively, regardless of what product you actually use, it turns out that from time you should stop for a second, ask for „which consolidated prompt has led to the output“ and „please provide a canonical fact base in a way that the prompt and the factbase will allow to transfer the entire context to a new session, even using another product“. This allows to review the facts, correct them if necessary, clean up or add, and also re-prioritize if needed, and you learn a lot about how your input gets translated into context. So this means „less vibe, more facts“ and allows me (the human) to reflect what I am really doing. Also, it easly allows me to compare various chatbots / models and observe what is really generated out of the same facts and i can switch at any stop (even the ones from the past). My personal finding is that this not only improves the quality of the overall output/results, but also hels me (the human) to better understand whats going on „inside“ the LLMs. I‘d call this „New Medienkompetenz“

Like
Reply

A great reality check on AI coding. I’m going through this too and share some similar experiences. I’ve been writing Pac-Man over and over again on different LLMs, with different prompts, with VS code extensions, CLIs, Cline and trying may models in cloud and locally. ChatGPT is quite good at sharing insights about what your going to get, last time it told me that AI coding is like a caffeinated junior developer with a deadline. I’m currently experimenting with write some code then after feature complete, refactoring. The results are light and can take 30 minutes on 100s of lines of code. Nicely enough, i do find it’s almost perfect for us old folks who don’t code but know high level arch, strategy, etc..

Excellent read . I really like the skills part and how relevant it is to implement agentic solutions that “works”

Michael, very cool to see your RAG solution setup. The handover doc, index, skills is the right move for non trivial codebase. One nuanced thought I’ve come across recently, some of this may belong in a real memory layer, not just 'persistence'. That’s the Plastic Labs argument, check it out: https://www.youtube.com/watch?v=uCeRCJ6zot4&t=1s

To view or add a comment, sign in

More articles by Michael Bechauf

Others also viewed

Explore content categories