Urgent.News

What's breaking now, across thousands of outlets.

AI

The Context Window Is Full Before the First Prompt — When Project Rules in Claude Code Become a Fixed Cost of Every Session

A subagent in Claude Code is supposed to answer a one-line question about the tool's documentation. It aborts before taking its first step: Prompt is too long , 347,814 tokens against a limit of 200,000. The question itself had loaded nothing. What had loaded were the project instructions that every session in this repository receives at start. The subagent ran on a model with a context window of…

A subagent in Claude Code, designed to answer a brief question about the tool's documentation, prematurely terminated its operation due to a prompt that was too lengthy. The problematic prompt measured 347,814 tokens, surpassing the 200,000-token limit set for each session. The issue arose not from the initial query but from the project instructions that every session receives at its outset.

These instructions, contained within the repository's CLAUDE.md file and its associated rule files, consumed a substantial portion of Claude Code's context window before the first prompt even arrived. The measured size of these instructions amounted to 454,900 tokens on October 15, 2026, which equated to more than half of a one-million-token context window, and more than double a 200,000-token window.

The root cause of this issue is not specific to Claude Code alone but extends to any tool that includes project rules at the beginning of a session. These rules consist of two categories: instructions for subsequent steps and records of past steps. While both categories are necessary for the workflow, the former must be included in the context at the beginning, as it is essential for guiding the next step.

The article emphasizes that the quantity of project instructions loaded is a fixed cost that every session incurs, regardless of the complexity of the task. This fixed cost arises from the fact that all instructions - the project's CLAUDE.md file, its imported files (up to four levels deep), and any rule files lacking a file scope - are loaded into the context before the first prompt is issued.

This loading process remains consistent across sessions, irrespective of the task's duration or intricacy.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

How we review AI agent skills for security before publishing them

A SKILL.md file is plain text, but an agent treats it as instructions. If it says "read this file and send it there", a capable agent with shell access may simply do it.

  • Scanner reviews skill text without execution or import
  • Identifies threats like overrides, credential theft, exfiltration
  • Reports findings with redacted excerpts, not safety guarantee

SlowMate AI: Do Less. Move Forward.

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady. What I Built Meet SlowMate AI , a local-first productivity assistant designed for people who feel…

  • SlowMate AI simplifies productivity by generating action plans from user input
  • Uses locally hosted Qwen2.5 3B model for privacy and control
  • Deployed on GitHub Pages with HTML/CSS/JS frontend

More from Thursday 22 October →