---
title: "How to ACTUALLY code with an agent with the 40% rule?"
url: https://daily.dev/posts/how-to-actually-code-with-an-agent-with-the-40-rule--4iahias4m
source_url: https://daily.dev/posts/how-to-actually-code-with-an-agent-with-the-40-rule--4iahias4m
type: freeform
source: "Lakshya Mehta"
author: "Lakshya Mehta"
published: 2026-05-10T23:02:49.684Z
updated: 2026-05-10T23:03:35.867Z
reading_time: 2
upvotes: 1
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to ACTUALLY code with an agent with the 40% rule?

**[Lakshya Mehta](https://daily.dev/sources/onsyjkgn80hu65zx2ibyg)** · [@lakshyam03](https://daily.dev/lakshyam03) · 2 min read · 1 upvotes · 0 comments

## Summary

Google reports 75% of new code is AI-generated, signaling a major shift in developer roles. A key insight for working effectively with AI coding agents is the '40% rule': keeping the context window below 40% capacity keeps the model in its 'smart zone,' producing more coherent and relevant output. Beyond that threshold, LLMs lose track of the bigger picture and produce increasingly poor results. The recommended strategy is to break work into small, focused 'tracer bullet' tasks rather than dumping all context at once, and to start fresh chat sessions when context grows too large.

## Content

Google claimed that around 75% of its newly written code is generated using AI. That number is only poised to rise over the coming years. Jobs have seen a remarkable shift with the work of junior devs being done using AI and a fall in the demand for devs altogether. Sometimes, it feels like AI is lifting a lot of weight, but, other times, it just feels like its going off on a tangent and doing a lot that does not make sense. Particularly the lower-end "dumb" models. Albeit, the friction of having to code has boiled down to being able to review and architect a system. Being able to use agents to code efficiently is a skill worth learning to keep your job (or maybe not, companies fire anyways 😢).

![image.png](https://media.daily.dev/image/upload/s--ud0gBh9G--/f_auto/v1778453538/ugc/content_bc077a46-5691-4070-bc04-49c4a35d3593?_a=BAMAMiWQ0)

You might have noticed that if you keep on prompting to the same window, and maybe keep screaming "FIX THIS" repeatedly, the answers get dumber and dumber. LLMs are not great at keeping the bigger picture in mind per-se if you keep feeding it context. Particularly, making it work on large chunks of code, ingesting a lot of skills makes it forgetful about what it had initially started off to do.

You might also have noticed that a fresh chat works much better than that one forsaken chat with all the errors. At around 40% of the size of the context window, the agent is said to work in the "Smart" zone. Keeping the context window to this limit actually makes the agent work to your "vibe". So, rather than flooding it with all the context at once, one strategy would be to break down the tasks into tracer bullet tasks rather than implementing all of them in a horizontal fashion.

## Similar posts on daily.dev

- [AI coding tools still suck at context — here’s how to work around it](https://daily.dev/posts/ai-coding-tools-still-suck-at-context-here-s-how-to-work-around-it-odm2d6y9f) · LogRocket · 1 upvotes · 0 comments

---

[View this post on daily.dev](https://daily.dev/posts/how-to-actually-code-with-an-agent-with-the-40-rule--4iahias4m)
