Context
Every agent reply is based on context — the text the model receives in that moment: your messages, open files, tool results, rules, and earlier turns. Context is the agent's working memory. It is powerful but not unlimited. This lesson explains what that means in 4RGE and how to work with it without micromanaging every file.
What this page is for
Pair with How AI models work and Tokens & pricing.
For day-to-day @ mentions and the context ring in the app, see Prompting.
Who this page is for
What context means
Context is everything the model reads before it answers. The model does not silently know your whole repo — it only works with what 4RGE puts in the prompt for that run.
Think of context like desk space: you can spread out plans, logs, and notes — but only so much fits before you shuffle papers or start a clean pile.
What fills the window
In a typical 4RGE agent chat, context grows from several sources:
In the desktop app, the context ring next to the chat input shows how full the window is. Click it for a breakdown by category (conversation, rules, tools, summarized history, and more). You do not need to optimize every slice — use it when a run feels slow, forgetful, or expensive.
When the window fills up
When a conversation approaches the model's limit, 4RGE compresses older turns into a summary so new messages still fit. That keeps the agent running, but fine detail from early in the thread can fade.
Compression is normal — not a bug. It is why short, focused threads often outperform one marathon chat for a whole feature.
Attach what matters
You have two good patterns — often combined:
More attachments is not always better. Irrelevant files can confuse the model the same way a cluttered desk makes it hard to find the right note. When exploratory work is enough, a clear sentence ("find where we validate JWTs") beats tagging half the monorepo.
Habits that keep context useful
- One main task per conversation — planning, implement, and polish can be separate runs.
- Say what "done" looks like — less back-and-forth means less context churn.
- Start fresh when you switch features — carry over a three-line summary, not the whole thread.
- Use
@for anchors, search for discovery — match the pattern in Prompting. - Watch the context ring on long jobs — if quality slips, split the work before tokens spike.
- Verify after big edits — compressed history makes hallucination more likely on edge cases.
Leads: if reviews show "the agent forgot X from message 3," treat that as a context workflow issue — shorter runs and explicit acceptance criteria — not only a model problem.