<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: LYES CHIOUKH ✨</title>
    <description>The latest articles on DEV Community by LYES CHIOUKH ✨ (@lyeschioukh).</description>
    <link>https://dev.to/lyeschioukh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F160782%2F7c01be38-f234-47a7-b3f4-15b9924891d2.jpg</url>
      <title>DEV Community: LYES CHIOUKH ✨</title>
      <link>https://dev.to/lyeschioukh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lyeschioukh"/>
    <language>en</language>
    <item>
      <title>Code Agents: What They Read Before Writing a Single Line</title>
      <dc:creator>LYES CHIOUKH ✨</dc:creator>
      <pubDate>Fri, 23 Oct 2026 17:04:44 +0000</pubDate>
      <link>https://dev.to/lyeschioukh/code-agents-what-they-read-before-writing-a-single-line-1lpe</link>
      <guid>https://dev.to/lyeschioukh/code-agents-what-they-read-before-writing-a-single-line-1lpe</guid>
      <description>&lt;p&gt;With Claude Code, Codex, or Gemini CLI, the quality of a session - and its cost - largely depends on what the agent reads. Managing that context is an architectural discipline: a concise baseline, knowledge loaded at the right time, sessions kept under control, and costs that are actively measured.&lt;/p&gt;

&lt;p&gt;Code assistants and coding agents have become part of developers’ daily workflows. According to Stack Overflow’s latest Developer Survey, conducted among more than 30,000 developers and technology professionals across 169 countries, coding assistants and agents have become the leading AI use case, with 66% adoption, ahead of general-purpose chatbots. Among users of AI coding assistants or agents, 73% use them daily.&lt;/p&gt;

&lt;p&gt;When a session goes wrong or the bill starts to rise, the first suspect is usually the model - or the way the prompt was phrased. Far less attention is paid to what the agent had already read before answering. Yet an agent can only work with what is available in its context, and part of that context never appears on screen.&lt;/p&gt;

&lt;p&gt;This raises the central question of this article: how can we give a coding agent enough context to work effectively, without overwhelming it or paying for the same information at every turn ? To answer that, we need to follow the context throughout a session: from what is loaded before the first prompt to what eventually drives cost.&lt;/p&gt;

&lt;h1&gt;
  
  
  What the agent reads before it starts working
&lt;/h1&gt;

&lt;p&gt;An agent does not read like a chatbot. It opens files, runs commands, receives tool outputs, and adds all of that to its context. Anthropic notes that Claude Code sessions are more token-intensive than standard chat because they include system prompts, file context, tool calls, and multi-turn reasoning.&lt;/p&gt;

&lt;p&gt;Part of this context is loaded before the first user prompt. At startup, the agent loads its instruction file - CLAUDE.md for Claude Code, AGENTS.md for Codex and other agents, and GEMINI.md for Gemini CLI - along with memory, available tools, and capability descriptions. In Claude Code, the &lt;code&gt;/context&lt;/code&gt; command shows what is currently loaded into the context window.&lt;/p&gt;

&lt;p&gt;Connected tools can consume more context than teams expect. Anthropic has documented cases where tool definitions consumed more than 50,000 tokens before the agent even processed the user’s request, which is why tool discovery and on-demand loading are important for keeping context manageable.&lt;/p&gt;

&lt;p&gt;Then there is the instruction file, which every team is tempted to expand. Recent studies have measured its impact, with mixed results. A study associated with ETH Zurich and LogicStar.ai found no general improvement in task success, but reported an inference cost increase of more than 20%.&lt;/p&gt;

&lt;p&gt;Repository overviews, although common, did not help much. Another study on AGENTS.md files measured faster execution on 124 pull-request tasks, with median runtime reduced by nearly 29%, but without evaluating result correctness. Khatri’s ablation study, by contrast, found no measurable improvement in the correctness of generated code.&lt;/p&gt;

&lt;p&gt;These studies nevertheless point in the same direction: an instruction file does not make an agent fundamentally more capable. It prevents the agent from guessing what cannot be inferred. The best content for such a file is therefore information that is not already available in the README or codebase: project-specific conventions, non-functional requirements, unusual build steps, architectural constraints, or rules that are easy to violate. Anthropic similarly recommends keeping CLAUDE.md lean - roughly under 200 lines.&lt;/p&gt;

&lt;h1&gt;
  
  
  Keeping context useful during the session
&lt;/h1&gt;

&lt;p&gt;Once a session starts, the context grows with every file read and every command executed. As the context window fills up, the tool may summarize the conversation to free space. Claude Code exposes this through &lt;code&gt;/compact&lt;/code&gt;, while &lt;code&gt;/clear&lt;/code&gt; starts a new conversation when switching tasks. Anthropic’s practical rule is simple: use &lt;code&gt;/clear&lt;/code&gt; for a new task, and &lt;code&gt;/compact&lt;/code&gt; when continuing a long task.&lt;/p&gt;

&lt;p&gt;That matters because context quality directly affects output quality. A long debugging session may include dozens of files, command outputs, failed attempts, and intermediate reasoning. If all of that remains in the session, each new request carries more noise and more cost.&lt;/p&gt;

&lt;p&gt;Some steps generate a large amount of text for a single conclusion: exploring a codebase, checking a result, reading a long log, or reviewing test output. A sub-agent can handle this work in its own context and return only a concise summary to the main session. Claude Code documentation describes subagents as secondary Claude instances that work in their own context window before reporting back.&lt;/p&gt;

&lt;p&gt;The key question is straightforward: will the raw output be useful later, or only the conclusion? If only the conclusion matters, isolating the task can keep the main context cleaner. But isolation also has a cost: each sub-agent may still explore files, run commands, and consume tokens.&lt;/p&gt;

&lt;p&gt;Claude Code also supports workflows where different models are used for different parts of the task. Anthropic recommends Sonnet for most coding work, Opus for harder architectural or debugging problems, and Haiku for faster, cheaper lookups or simple edits. A common pattern is to plan with a stronger model and execute with a more economical one.&lt;/p&gt;

&lt;h1&gt;
  
  
  And then there is the cost
&lt;/h1&gt;

&lt;p&gt;In Claude Code, cost comes primarily from repeated context. Every turn sends the conversation so far, project context, files read, and the new user prompt back to the model. The longer the session, the more expensive each additional interaction can become. Anthropic’s documentation recommends using &lt;code&gt;/cost&lt;/code&gt; for API-billed sessions and usage analytics for team or enterprise monitoring.&lt;/p&gt;

&lt;p&gt;Prompt caching is usually one of the main levers for reducing cost: stable context can be reused more cheaply than context that changes constantly. A stable baseline therefore costs less over time; a baseline that is repeatedly rewritten loses part of that advantage.&lt;/p&gt;

&lt;p&gt;Context is also a security surface. Everything the agent reads can influence its behavior: a web page, an issue, a pull request, a log file, or the output of a tool. OWASP ranks prompt injection - direct or indirect - as the top risk for LLM-based applications in its 2025 Top 10.&lt;/p&gt;

&lt;p&gt;This leads to two important practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;treat external content as data, never as instructions;&lt;/li&gt;
&lt;li&gt;connect only useful, verified, and necessary MCP connectors.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Principles for managing coding-agent context
&lt;/h1&gt;

&lt;p&gt;Managing the context of a coding agent relies on several principles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;short instructions that are reviewed regularly;&lt;/li&gt;
&lt;li&gt;knowledge loaded only when needed;&lt;/li&gt;
&lt;li&gt;sessions kept focused and bounded;&lt;/li&gt;
&lt;li&gt;noisy tasks isolated where appropriate;&lt;/li&gt;
&lt;li&gt;costs monitored continuously;&lt;/li&gt;
&lt;li&gt;external inputs treated as untrusted data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each team member contributes at their own level: checking which information the agent loads, maintaining versioned and reviewed instruction files, defining access rights, or setting usage budgets. These complementary responsibilities determine what the agent can access, how much it can consume, and how reliably it can work.&lt;/p&gt;

&lt;h1&gt;
  
  
  Sources
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Stack Overflow, 2026 Developer Survey, section AI, données détaillées et méthodologie (30 903 réponses, 169 pays, du 23 juin au 5 août 2026) : &lt;a href="https://survey.stackoverflow.co/2026/ai" rel="noopener noreferrer"&gt;https://survey.stackoverflow.co/2026/ai&lt;/a&gt; ; &lt;a href="https://survey.stackoverflow.co/2026/ai/data" rel="noopener noreferrer"&gt;https://survey.stackoverflow.co/2026/ai/data&lt;/a&gt; ; &lt;a href="https://survey.stackoverflow.co/2026/methodology" rel="noopener noreferrer"&gt;https://survey.stackoverflow.co/2026/methodology&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anthropic, How we built our multi-agent research system : &lt;a href="https://www.anthropic.com/engineering/multi-agent-research-system" rel="noopener noreferrer"&gt;https://www.anthropic.com/engineering/multi-agent-research-system&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anthropic, Explore the context window, documentation Claude Code : &lt;a href="https://code.claude.com/docs/en/context-window" rel="noopener noreferrer"&gt;https://code.claude.com/docs/en/context-window&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;OpenAI, Custom instructions with AGENTS.md, documentation Codex : &lt;a href="https://learn.chatgpt.com/docs/agent-configuration/agents-md" rel="noopener noreferrer"&gt;https://learn.chatgpt.com/docs/agent-configuration/agents-md&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Google, Provide context with GEMINI.md files et référence de configuration, documentation Gemini CLI (Gemini CLI est remplacé par Antigravity CLI pour les comptes gratuits et Google One depuis le 18 juin 2026) : &lt;a href="https://geminicli.com/docs/cli/gemini-md" rel="noopener noreferrer"&gt;https://geminicli.com/docs/cli/gemini-md&lt;/a&gt; ; &lt;a href="https://geminicli.com/docs/reference/configuration" rel="noopener noreferrer"&gt;https://geminicli.com/docs/reference/configuration&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anthropic, Introducing advanced tool use on the Claude Developer Platform : &lt;a href="https://www.anthropic.com/engineering/advanced-tool-use" rel="noopener noreferrer"&gt;https://www.anthropic.com/engineering/advanced-tool-use&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anthropic, Manage costs effectively, documentation Claude Code : &lt;a href="https://code.claude.com/docs/en/costs" rel="noopener noreferrer"&gt;https://code.claude.com/docs/en/costs&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Gloaguen et al., ETH Zurich et LogicStar.ai, Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?, ateliers d'ICLR 2026 : &lt;a href="https://arxiv.org/abs/2602.11988" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2602.11988&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lulla et al., On the Impact of AGENTS.md Files on the Efficiency of AI Coding Agents : &lt;a href="https://arxiv.org/abs/2601.20404" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2601.20404&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Khatri, Do Context Files Help Coding Agents? A Two-Agent Ablation Study on Real Repositories : &lt;a href="https://arxiv.org/abs/2607.27250" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2607.27250&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anthropic, Using Claude Code: session management and 1M context : &lt;a href="https://claude.com/resources/articles/using-claude-code-session-management-and-1m-context" rel="noopener noreferrer"&gt;https://claude.com/resources/articles/using-claude-code-session-management-and-1m-context&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anthropic, Effective context engineering for AI agents : &lt;a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents" rel="noopener noreferrer"&gt;https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anthropic, Escalader les décisions difficiles avec l'outil advisor, documentation Claude Code : &lt;a href="https://code.claude.com/docs/fr/advisor" rel="noopener noreferrer"&gt;https://code.claude.com/docs/fr/advisor&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anthropic, The advisor strategy (Sonnet 4.6 conseillé par Opus 4.6) : &lt;a href="https://claude.com/blog/the-advisor-strategy" rel="noopener noreferrer"&gt;https://claude.com/blog/the-advisor-strategy&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anthropic, Optimizing for cost and intelligence, documentation de la plateforme Claude : &lt;a href="https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence" rel="noopener noreferrer"&gt;https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Anthropic, Pricing, documentation de la plateforme Claude : &lt;a href="https://platform.claude.com/docs/en/about-claude/pricing" rel="noopener noreferrer"&gt;https://platform.claude.com/docs/en/about-claude/pricing&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;OWASP Gen AI Security Project, LLM01:2025 Prompt Injection, Top 10 pour les applications LLM : &lt;a href="https://genai.owasp.org/llmrisk/llm01-prompt-injection/" rel="noopener noreferrer"&gt;https://genai.owasp.org/llmrisk/llm01-prompt-injection/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>claudecode</category>
      <category>codex</category>
      <category>gemini</category>
      <category>mcp</category>
    </item>
  </channel>
</rss>
