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

推荐订阅源

I
InfoQ
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
月光博客
月光博客
博客园 - 聂微东
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
F
Fortinet All Blogs
H
Help Net Security
J
Java Code Geeks
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
L
LangChain Blog
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium

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
I Cut Coding Agent Context Usage by 22–45% by Killing Con...
Sam · 2026-05-13 · via DEV Community

Sam

A lot of AI coding workflows degrade the exact same way.

At first, everything feels incredible.

Your coding agent:

  • understands the project
  • moves insanely fast
  • eliminates boilerplate
  • compounds your momentum

Then a few weeks later:

AGENTS.md turns into a novel.

Prompts get bloated.

The model starts missing obvious things.

Responses become inconsistent.

Token usage quietly becomes absurd.

I kept running into this while building Empirical.

Eventually I realized the problem wasn’t:

“The model needs more context.”

The problem was:

“The model is carrying too much irrelevant context at once.”

That distinction changed everything.


The Hidden Failure Mode of Coding Agents

Most teams solve AI memory like this:

“Just add it to the prompt.”

And over time the context fills up with:

Permanent Context Soup

  • architecture decisions
  • coding standards
  • deployment notes
  • UI preferences
  • old implementation details
  • temporary fixes
  • abandoned experiments
  • half-finished thoughts

Eventually every request drags all of it around forever.

Even when most of it has absolutely nothing to do with the current task.

That creates a brutal signal-to-noise problem.

The model starts treating temporary junk and critical architecture decisions with equal importance.

You can actually feel the degradation happen.

Symptoms:

  • the agent gets fuzzier
  • architecture drift increases
  • outputs become inconsistent
  • you spend more time correcting than building

Bigger Context Windows Aren’t the Real Solution

I think the industry is optimizing the wrong thing right now.

Everyone keeps pushing toward:

Bigger Everything

  • million-token windows
  • infinite memory
  • larger context sizes
  • stuffing more into prompts

But humans don’t work like that either.

Good engineering teams don’t bring every document into every meeting.

Most information is situational.

Most memory should stay dormant until it becomes relevant.

That was the shift for me.

Not:

“How do I fit more into context?”

But:

“How do I load only what matters right now?”


What Worked Better

I started treating AI memory more like layered working memory instead of permanent prompt stuffing.


1. Lean Persistent Context

Keep permanent instructions extremely small.

Only things like:

  • architecture principles
  • coding philosophy
  • project identity
  • non-negotiables

That layer should stay lean on purpose.


2. Retrieved Context

Pull implementation knowledge dynamically based on:

Relevance Signals

  • semantic similarity
  • current task
  • related code paths
  • previous work in the same area

Only relevant context enters the active prompt.


3. Session Context

Use temporary working memory for:

Active Work

  • bugs
  • in-progress features
  • short-lived implementation decisions

Then let it expire naturally instead of polluting long-term memory forever.


What Changed

The biggest surprise wasn’t even the token savings.

It was how much sharper the agents became once the noise disappeared.

After reducing context bloat:

  • responses became more focused
  • architecture stayed more consistent
  • prompt babysitting dropped significantly
  • outputs drifted less between sessions

The token reduction was just the measurable side effect.


Results

Workflow Context Reduction
Smaller focused tasks ~22%
Larger iterative workflows Up to ~45%

That compounds fast once agents start looping.


The Bigger Realization

I think a lot of AI tooling is accidentally recreating bad human organizational habits.

We already know what happens when people dump everything into:

Organizational Chaos

  • giant docs
  • giant meetings
  • giant Slack threads
  • giant Notion pages

Clarity collapses.

Coding agents seem to behave better when memory works more like human working memory:

Better Memory Pattern

  • small active focus
  • relevant recall
  • long-term memory separated from immediate attention

That mattered far more than raw context size.


Full Breakdown

I wrote the complete breakdown here:

  • retrieval architecture
  • layered memory strategy
  • implementation lessons
  • where the 22–45% savings actually came from

Reducing Coding Agent Context Usage by 22–45% with Retrieval-Based Memory Systems