• About
  • Advertise
  • Privacy & Policy
  • Contact
Wednesday, January 7, 2026
  • Login
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
Advertisement
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
No Result
View All Result
Home Machine Learning

How to Optimize Your AI Coding Agent Context

AiNEWS2025 by AiNEWS2025
2026-01-06
in Machine Learning
0
How to Optimize Your AI Coding Agent Context
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


of your AI coding agent is critical to its performance. It is likely one of the most significant factors determining how many tasks you can perform with a coding agent and your success rate in doing so.

In this article, I’ll discuss specific techniques I use to improve the context of my AI agents. I’ll explain specifically how I do it, and why. It’s important to understand why I’m using these techniques, so you can start developing your own techniques in the future, and really optimize your agentic coding.

Optimize coding agent context
This infographic highlights the main techniques I’ll cover in this article, which you can use to make your coding agents more efficient. First, I’ll discuss how you should always update AGENTS.md with context that is relevant across threads. Furthermore, I’ll discuss how you should provide documentation links and provide the IaC stack as context. Lastly, I’ll also cover why you should always start new threads whenever working with new contexts. Image by Gemini.

Table of Contents

Why optimize agentic context

The context you provide your coding agent is all the information it has to complete a task. Thus, properly managing your context is incredibly important if you want your coding agent to work well.

Improving your context by a few percent will have a massive impact on your efficiency as an engineer if you spend many hours each day programming. I thus spend a lot of time, constantly trying to optimize my programming with my coding agent.

The four techniques I’ll present in the next section are a result of my testing a wide variety of different techniques and approaches. In this article, I’ll only cover four of the most important techniques and why they work so well. In the future, I might also cover some failed techniques and reflect on why they didn’t work

4 specific techniques

In this section, I’ll cover four specific techniques I utilize to optimize the context for my coding agents. I’ve written the techniques in no particular order, and I consider them all important to me in my quest to be as efficient an engineer as possible.

Always update AGENTS.md

Probably the most important technique I use is to constantly update the AGENTS.md file. Continual learning is still an unsolved problem for LLMs, thus we need to come up with our own solutions to make coding agents remember our preferences.

I’ve written a rules file for my coding agent, which specifies some preferences I have:

  • Always write Python 3.13 syntax if using Python
  • Never use the Any type
  • Always use types and docstrings for functions

These are preferences I have across all the repositories I touch, and which I thus always want my agent to follow. I recommend spending time reflecting on your own coding rules and specifying them to your agent.


Furthermore, whenever my coding agent makes an error, I help it correct the error and tell the agent to remember the fix in AGENTS.md. This makes sure the agent avoids this error in the future, and simply makes the agent faster and more efficient.

If you continue doing this over time, you’ll notice the agent becoming significantly better and more proficient at performing the tasks you ask it to perform. This could be:

  • Implementing new features
  • Fixing bugs
  • Checking production logs

This works so well because you’re providing your coding agent with the necessary context that you possess, but you never wrote down. By informing the coding agent in AGENTS.md, you provide the model critical context for problem solving.

Note that you can use any Markdown files that you prefer. Claude Code uses CLAUDE.md, Warp uses WARP.md, and Cursor uses .cursorrules. However, I find that most coding agents always read AGENTS.md, which makes it a good file name to store agentic memory in.

Provide documentation links

Another tip is to provide relevant documentation links to the model, or to explicitly tell the model to find documentation online through a web search.

I sometimes find that my coding agent is using outdated syntax, for example, when interacting with the OpenAI API. In these instances, I provide the model a link to the latest OpenAI documentation and tell it to base its code on this.

The problem of coding agents using outdated code typically occurs because LLMs have a cut-off date, which necessarily must be before the model was done training. The cutoff date for any given model could be over a year ago, in which a lot of API documentation has changed. Thus, it’s very important to make sure the model uses the latest available documentation by providing it with links to these docs.

Coding agents often uses outdated code because of the model knowledge cutoff. The fix to this problem is to provide the agents with the latest API documentation

Provide IaC stack as context

Another technique I utilize is to provide information about my infrastructure as code (IaC) stack as context to my coding agent. This is incredibly useful when using an agent to check out production logs (which you should do).

I started using this technique after I noticed my agent was spending a lot of time finding information, such as the names of my database tables. For example, if the agent wanted to find information from a table, it first had to list all tables, guess which table is relevant, and try it. If it failed, it would have to try a different table.

This takes a lot of time and tokens, costing you both efficiency and money, and is thus something you need to avoid.

To provide my agent with all the IaC context, I had an agent go through all of the relevant IaC repositories and create a single Markdown file containing all relevant context, for example, the names of all my database tables. I then provide this file as context to my coding agent whenever it’s relevant.

New threads on a new context

Another simple technique I utilize is to start new threads whenever I’m dealing with new contexts. For example ,if I just finished implementing a new feature, and now want to fix a bug, I almost always start a new thread in Cursor.

The reason is that when implementing the new feature, the model stores a lot of context that is completely irrelevant to fixing the bug. This not only fills up the model context, but can also act as noise, distracting the model from more relevant information.

Thus, whenever you can, you should make sure to start new threads whenever changing contexts. This could be after you implemented a new feature, and want to fix a bug. Or after you fixed a bug, and want to check out production logs with your agent.

This works well because the important context that should be stored across threads is stored in AGENTS.md, as I discussed in an earlier section.

Conclusion

In this article, I’ve covered four specific techniques I utilize to optimize the context of my coding agents. Utilizing these techniques makes me a significantly more efficient engineer, because my coding agents can work much more efficiently. I recommend trying out these techniques for yourself to find out if they work well for you. Furthermore, I recommend experimenting with new techniques and approaches yourself, which can make you more effective. Whenever you notice your coding agents are unable to do something, you should immediately start ideating and thinking about how to make them able to perform such tasks.

👉 My Free Resources

🚀 10x Your Engineering with LLMs (Free 3-Day Email Course)

📚 Get my free Vision Language Models ebook

💻 My webinar on Vision Language Models

👉 Find me on socials:

📩 Subscribe to my newsletter

🧑‍💻 Get in touch

🔗 LinkedIn

🐦 X / Twitter

✍️ Medium

Source link

#Optimize #Coding #Agent #Context

Tags: Agentic AiAi Agentcoding agentsGeminiLlm
Previous Post

Private equity deal shows just how far America’s legacy rocket industry has fallen

Next Post

The future of autonomous warfare is unfolding in Europe

AiNEWS2025

AiNEWS2025

Next Post
The future of autonomous warfare is unfolding in Europe

The future of autonomous warfare is unfolding in Europe

Stay Connected test

  • 23.9k Followers
  • 99 Subscribers
  • Trending
  • Comments
  • Latest
A tiny new open source AI model performs as well as powerful big ones

A tiny new open source AI model performs as well as powerful big ones

0
Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

0
Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

0
Best Headphones for Working Out (2024): Bose, Shokz, JLab

Best Headphones for Working Out (2024): Bose, Shokz, JLab

0
Meet the AI-powered robotic dog ready to help with emergency response

Meet the AI-powered robotic dog ready to help with emergency response

2026-01-07
The Download: War in Europe, and the company that wants to cool the planet

The Download: War in Europe, and the company that wants to cool the planet

2026-01-07
HNSW at Scale: Why Your RAG System Gets Worse as the Vector Database Grows

HNSW at Scale: Why Your RAG System Gets Worse as the Vector Database Grows

2026-01-07
Bose open-sources its SoundTouch home theater smart speakers ahead of end-of-life

Bose open-sources its SoundTouch home theater smart speakers ahead of end-of-life

2026-01-07

Recent News

Meet the AI-powered robotic dog ready to help with emergency response

Meet the AI-powered robotic dog ready to help with emergency response

2026-01-07
The Download: War in Europe, and the company that wants to cool the planet

The Download: War in Europe, and the company that wants to cool the planet

2026-01-07
HNSW at Scale: Why Your RAG System Gets Worse as the Vector Database Grows

HNSW at Scale: Why Your RAG System Gets Worse as the Vector Database Grows

2026-01-07
Bose open-sources its SoundTouch home theater smart speakers ahead of end-of-life

Bose open-sources its SoundTouch home theater smart speakers ahead of end-of-life

2026-01-07
Footer logo

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

Follow Us

Browse by Category

  • AI & Cloud Computing
  • AI & Cybersecurity
  • AI & Sentiment Analysis
  • AI Applications
  • AI Ethics
  • AI Future Predictions
  • AI in Education
  • AI in Fintech
  • AI in Gaming
  • AI in Healthcare
  • AI in Startups
  • AI Innovations
  • AI News
  • AI Research
  • AI Tools & Automation
  • Apps
  • AR/VR & AI
  • Business
  • Deep Learning
  • Emerging Technologies
  • Entertainment
  • Fashion
  • Food
  • Gadget
  • Gaming
  • Health
  • Lifestyle
  • Machine Learning
  • Mobile
  • Movie
  • Music
  • News
  • Politics
  • Review
  • Robotics & Smart Systems
  • Science
  • Sports
  • Startup
  • Tech
  • Travel
  • World

Recent News

Meet the AI-powered robotic dog ready to help with emergency response

Meet the AI-powered robotic dog ready to help with emergency response

2026-01-07
The Download: War in Europe, and the company that wants to cool the planet

The Download: War in Europe, and the company that wants to cool the planet

2026-01-07
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2026 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result

© 2026 JNews - Premium WordPress news & magazine theme by Jegtheme.