Why Long Context Improves Codebase Quality

Explore top LinkedIn content from expert professionals.

Summary

Long context in a codebase means having thorough documentation and recorded knowledge about past decisions, code changes, and business logic, which helps both human engineers and AI tools understand how the system works. This rich context improves codebase quality by making it easier to troubleshoot, update, and automate tasks, reducing confusion and preventing costly mistakes.

  • Build robust documentation: Invest time in creating detailed context maps and business logic guides so every engineer and AI agent has reliable information to draw from.
  • Capture historical decisions: Record architectural changes, reasons for past fixes, and lessons learned to turn fragmented knowledge into accessible, searchable insights.
  • Standardize context files: Maintain up-to-date, standardized documentation files in your repositories to ensure continuity, faster onboarding, and better performance from AI coding tools.
Summarized by AI based on LinkedIn member posts
  • View profile for Cole Medin

    Technology Leader and Entrepreneur | AI Educator & Content Creator | Founder of Dynamous AI

    8,780 followers

    Karpathy's LLM Knowledge Bases post went viral this week, and rightfully so. The idea is simple: raw documents go in, an LLM processes them into a structured wiki, your agent queries that wiki at runtime. No fancy RAG pipeline, no vector database. Just compiled knowledge your agent can navigate. Everyone is applying this to external data: docs, papers, research articles. I went a different direction. The raw material in my version isn't articles from the web. It's Claude Code session logs. Every time I work on the codebase, hooks automatically capture what got built, what decisions were made, what didn't work and why. A daily flush script compiles those logs into wiki articles in my Obsidian vault. When I start a new session, the agent searches that wiki before writing a single line of code. The result feels different from a good CLAUDE.md. It's not just static documentation! It's a living record of every architectural decision, every "we tried X and it broke because Y." Institutional memory, but searchable. The loop compounds quickly. Ask a question, the agent finds a relevant wiki article from three weeks ago, gives a better answer, and that answer eventually feeds back into the wiki. The longer you use it, the more context the agent has about your codebase specifically (not codebases in general, yours). Setup is one prompt into Claude Code: hooks, daily flush script, wiki structure, all generated automatically. Karpathy's insight was "stop RAG-ing raw documents, start compiling them." Most developers are losing context between every session. All that institutional knowledge evaporates. Compiling your session logs applies the same idea one level closer to home. I just posted a full breakdown on YouTube with the complete architecture walkthrough and a live demo of setting up the whole system. Link to my GitHub repo in the replies too!

  • View profile for Andrew Swerdlow

    Exec Engineering Leader at Roblox · ex-Instagram & Google · Author of “Tech Leadership” · AI, Infra, and Developer Productivity

    7,114 followers

    Your codebase already contains the lessons from its last Sev. They are buried across PRs, code reviews, commit history, and rollbacks. That is what the Roblox code intelligence "learnings UI" in our recent Roblox engineering work is designed to surface. Every large codebase accumulates judgment over time. Decisions about patterns, fixes, and tradeoffs live in diffs, review discussions, reverts, and follow-up changes. But that knowledge is fragmented and highly contextual. In the article, we describe how we turn that sprawl into signal. Historical PRs and review activity flow through a multistage system that removes noise, detects recurring themes across thousands of changes, and clusters related signals into candidate learnings. These are ranked by how often they appear and how broadly they are reinforced across different engineers, with links back to the original context. The "learnings UI" makes this legible. Engineers can see which patterns keep resurfacing. Who reinforces them. Where they came from. Domain experts refine the strongest candidates and promote them into exemplars that become durable guardrails. The reaction was immediate. Repository leads recognized their favorite reliability and style topics bubbling up and wanted their repos analyzed next. This is not about replacing engineers. It is about capturing judgment and letting it compound. https://lnkd.in/gme-N7_E #AI #DeveloperTools #CodeIntelligence #PlatformEngineering

  • View profile for Melissa Benua

    Let’s Build! | Seasoned Engineering Leader | Keynote Speaker

    3,461 followers

    My engineer told me a production infrastructure change would take five days. It was in a very old infrastructure-as-code codebase - multiple major versions, three repo migrations, 70+ production services. He wasn't wrong. That's what changes in that codebase cost. I asked him to spend one day building a context map instead. Where things live. What the acronyms mean. How our system differs from how the rest of the internet does things. A real example of a recent good change to follow. He thought I was wasting a day. Then I took that context map - I have never written a line of Terraform in my life - and spent 40 minutes with an AI to generate roughly 80% of the correct answer. My engineer reviewed it, said "this is a B-minus, couple things to fix," and took it to production in another hour. Two days instead of five, including the day building the map. And the context map checked into the repo. Every engineer uses it now. Every change in that area costs 40 minutes instead of five days. The secret wasn't the AI. The secret was the spec! Post 2 in The Boring Parts Matter series is up: it's about why context documentation is the highest-ROI engineering investment you can make right now, and what a spec that actually works looks like in practice. https://lnkd.in/gKiGiuM8

  • View profile for Dileep Krishna

    Co-founder & CEO, Supatest AI | AI agents for software testing

    21,221 followers

    A 60 page doc tripled this engineering team's velocity, I've been talking to engineering leaders for weeks, and there's a pattern nobody's discussing yet: teams aren't optimising for better code anymore. They're optimising for better documentation. They went from "we barely document anything" to maintaining a 60-page AGENTS.md file in just 3 months. Not user docs. Not API specs. Business logic documentation specifically for AI agents. These files include coding conventions, business logic, good vs bad examples, testing workflows, and architecture reasoning. What changed? They started using Cursor and Claude Code heavily. They realized something: when AI writes your code, the quality of what it produces correlates DIRECTLY with how well you explain your business logic. The shift is fundamental: Old way: Write code, document later (maybe) New way: Document first, let AI write the code Another team I spoke with now tracks "context quality" as a KPI. They're not measuring lines of code anymore , they're measuring how well their documentation helps AI understand what they're building. The bottleneck isn't coding speed anymore. It's context clarity. For engineering leaders using AI tools: are you seeing this pattern? How are you handling documentation? PS: if you’re a CTO/Engineering leader facing testing bottleneck and interested in shipping 10x faster, let's chat - https://lnkd.in/gJJUET-S

  • View profile for Jamil Farshchi
    Jamil Farshchi Jamil Farshchi is an Influencer

    Equifax CTO • UKG Board Member • FBI Strategic Advisor • LinkedIn Top Voice in Innovation and Technology

    44,776 followers

    AI didn't create a new problem. It put a price tag on an old one. Every company has a Dave. Nine years in. Knows where the bodies are buried. Knows which service breaks if you breathe on it wrong. Dave IS the documentation. But AI can't ask Dave. We've learned this lesson three times now. Security: you can't protect what you can't see. Cloud: you can't migrate what you don't understand. AI: you can't automate what you haven't documented. Same lesson. Same boring work nobody ever did. Three times. Every piece of knowledge in Dave's head instead of the repo is context your AI tools will never have. Without it, they guess. Confidently. At scale. And it's not just code. It’s the helpdesk KB article nobody has touched since 2019. It’s the IR runbook you promised yourself you'd write after the last 2am P1... but forgot to. The AI isn't failing. We're giving it garbage, but expecting gold. Coding tools. Contact Center. Workflows. Decision logic. Same pattern: undocumented, outdated, contradictory, tribal. It’s like doing a new hire eval with no training… and blaming the new hire for poor performance. The open-source community figured it out: 60,000+ projects ship standardized context files so every AI tool knows how to work in that codebase. No tool selection pit fights. No governance pitfalls.  Here's the thing: the documentation security teams requested, the architecture maps cloud needed, and the context AI requires? It’s the same work. Not similar. The same. Close it and everything compounds. Security gets visibility. AI performs. New engineers ramp faster. And you stop being one Dave-retirement away from a knowledge crisis. Documentation debt is now performance debt. The teams pulling ahead right now aren't the ones with the best AI tools. They're the ones that finally wrote stuff down. #TheBoringWork #CTO #Cybersecurity #EngineeringLeadership

  • View profile for Gregory Raiz

    Founding Partner @ FoundersEdge ⚡ | Exited Founder & Pre-Seed Investor | I invest in startup founders and help them build incredible businesses

    9,389 followers

    When AI is writing 99% of your code, the rules of engineering completely change. Most teams haven't figured this out yet. I hopped on a screen share with one of my portfolio founders this week. They had all the right tools: Cursor, Claude, the works. But their codebase felt unstable. Bugs kept cropping up. They'd track them down, fix them, move on. Then more bugs. We pulled up an agent, ran a git history, and traced it back to two business rules interacting in a subtle, invisible way. Classic. But here's where it got interesting. Once we spotted the bug, I asked: "Where does this knowledge live now?" Nowhere. They were shipping code agentically. Fast. But nobody had checked in the why behind how these systems talk to each other. The tribal knowledge was nowhere. Not in docs, not in the codebase. Nowhere an agent could find it. When humans wrote all the code, tribal knowledge lived in people's heads. That made sense. You didn't document what you already knew. But when AI is writing 98-99% of your code, that breaks. The context, the architectural decisions, the subtle ways things fail, it has to be externalized. Checked into the repo. Living in a CLAUDE.md file, an agents.md, something your AI can actually read and reason from. The context gap is silently killing codebases everywhere. Your agents are only as good as the context you give them. If your team is shipping agentically and you haven't documented your institutional knowledge somewhere the AI can find it, you're building on sand. Where does your team's tribal knowledge actually live right now? #AI #SoftwareEngineering #FounderLessons

Explore categories