惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
博客园 - 司徒正美
I
InfoQ
宝玉的分享
宝玉的分享
G
Google Developers Blog
J
Java Code Geeks
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
罗磊的独立博客
腾讯CDC
F
Fortinet All Blogs
A
About on SuperTechFans
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
B
Blog RSS Feed
博客园 - 聂微东
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Context Rot: Why Your AI Coding Agent Gets Dumber Mid-Ses...
Enjoy Kumawat · 2026-06-23 · via DEV Community

Enjoy Kumawat

You've felt it. The first twenty minutes with Claude Code, Cursor, or whatever agent you live in are magic. It nails the refactor, remembers your conventions, one-shots the test.

Then, an hour in, it turns into an intern who skipped lunch. It forgets a function you defined ten messages ago. It re-suggests a fix you already rejected. It loops. You start a sentence with "as I said earlier..." and feel slightly insane.

Everyone has a theory. "The model got nerfed." "It's MCP." "They're throttling me." I believed all three at various points.

The boring truth is none of them. It's your context window quietly filling up with garbage — and I can show you exactly where the garbage comes from.

The model didn't get dumber. The signal did.

LLMs don't have memory. Every turn, the entire conversation gets re-sent to the model: your messages, its replies, and — this is the killer — every byte of output from every tool it ran.

That last part is where it falls apart. Watch what a single innocent command costs you:

  • npm run build on a real project: 2–10 KB of webpack noise.
  • git log without limits: pages of commits.
  • One cat of a 600-line file: the whole file, verbatim, forever.
  • A failing test suite: stack traces stacked on stack traces.

Ask your agent to "check why the build is failing" and it might dump 50 KB into the context in a single tool call. You never see most of it — it scrolls past — but the model carries all of it on every subsequent turn.

This is context rot: as the window fills, the ratio of signal (your actual task) to noise (raw tool sludge) collapses. Attention spreads thinner across a longer, junkier transcript. The model isn't lazier. It's drowning. There's solid research now showing model accuracy drops well before you hit the hard token limit — performance degrades with how full the window is, not just whether it overflowed.

So the agent that "got dumber mid-session" got dumber because you (via its tools) fed it a haystack and then asked it to find a needle in it.

How I actually confirmed it

I stopped guessing and measured. Before blaming the model, look at what's eating your window:

  • In Claude Code, run /context to see the breakdown. The first time I did this, tool results were the single biggest slice — bigger than my code, bigger than the conversation.
  • Notice which calls are fat. For me it was always the same culprits: build output, git log, dependency trees, and reading whole files just to "have a look."

That was the whole diagnosis. The expensive stuff wasn't my thinking or the model's replies. It was raw command output I never needed to read in full.

The fix: keep raw output OUT of the window

The principle is one sentence: the model should see conclusions, not raw data.

Once I framed it that way, the fixes were obvious — and most of them need zero special tooling:

1. Summarize at the source. Don't let the agent run npm test and inhale 8 KB. Run it so it returns "3 failures: auth.test.ts:40, 51, 77". Pipe through grep, tail -n 20, --quiet, wc -l. A summary is worth a thousand log lines.

2. Never read a whole file just to understand it. Reading is for editing. For "where is JWT validated?", search and read the 15 relevant lines, not the 600-line file. Whole-file reads are the most common self-inflicted context wound I see.

3. Use sub-agents as a firewall. Spin a throwaway agent to do the noisy exploration — grep the codebase, read the logs, crawl the docs — and have it report back only a paragraph of findings. All the sludge dies with the sub-agent. Your main context stays clean.

4. Start fresh more often than feels necessary. Finished a sub-task? New session. A clean window with a tight summary beats a "full" window with all the history every single time. Long-lived threads are a vanity metric.

5. Route the truly heavy stuff through a sandbox. This is the one I leaned on hardest. I run my commands through a layer that executes them outside the model's context, indexes the full output, and returns only the slice I searched for. So a 56 KB build log becomes "here are the 4 lines mentioning the error." The model gets the answer; the noise never touches the window. (I use a tool called context-mode for this, but the pattern matters more than the tool — you can fake it with command | tee log.txt | grep ERROR and only ever feeding the agent the grep.)

The mindset shift

Stop treating the context window like RAM you fill until it's full. Treat it like a whiteboard in a meeting: everything you write on it competes for attention, and a cluttered board makes the whole room dumber. Wipe it often. Only write what matters.

Your agent didn't get nerfed. It got buried. Dig it out and the magic comes back — for the whole session, not just the first twenty minutes.


If this matched your experience, I'd love to hear which tool eats your context the most — for me it's git log every time. Follow me @enjoy_kumawat for more practical AI-tooling notes.