---
title: "07 — Context — The AI Knows Only What You Tell It"
uid: context
tags: ["workflow", "vibe-coding", "roadmap:vibe-coding", "ai", "context-engineering", "subagents"]
excerpt: "Context is everything — the model has no memory of your project or preferences unless you provide them in the current session. Keep sessions focused, start fresh, use subagents."
date: 2026-08-13T03:27:25+0000
source: https://www.aveshina.my.id/en/blog/context
---

"Background info the model just has" was how I dismissed context, and every fresh session proved the assumption wrong. Writing it down forced the central idea into view: **context is everything when working with AI** [1]. Not metaphorically. Literally. The model has no memory of my project, no knowledge of my past decisions, no awareness of my preferences — unless I provide them in the current session. Every fresh session is an amnesiac junior who reads only what I hand them, then forgets it all when the session closes.

The framing that clicked: **context is a budget, not a backdrop.** I used to dump everything into every prompt on the theory that more is better. In practice the model has a finite attention window, and irrelevant context crowds out the relevant. The discipline isn't "tell it everything." It's "tell it the right things, and keep the rest out."

## Why context engineering is a first-class skill

The roadmap treats context as its own topic, separate from prompting, and I want to respect that distinction. Prompting is how I phrase a single request. Context engineering is the broader discipline of deciding what the model sees at all — across a session, across a project, across multiple agents [2]. It earned its own name because it turns out to be the single largest lever on output quality after model choice itself.

Three things I had to internalize:

- **Sessions are short-lived.** What the model learned in last night's session is gone this morning. Stable context has to be re-supplied every time, which is why a context document is worth its weight.
- **Attention is finite.** The model doesn't weight everything equally. As context grows, early or buried details get less attention. A focused session with twenty relevant lines beats a sprawling one with two thousand.
- **Irrelevant context is active harm.** Pasting the whole codebase "just in case" doesn't help — it introduces noise the model has to wade through, and it can mislead. A stale comment from six months ago can send the model down a wrong path today.

```figure
<svg viewBox="0 0 700 280" xmlns="http://www.w3.org/2000/svg" class="my-6 w-full max-w-2xl" role="img" aria-label="Two context states around the same AI core. Left, focused context: a tight ring of relevant items — context doc, current file, relevant decisions. Right, polluted context: the same core buried under unrelated files, stale comments, off-topic history, and duplicate notes. A label reads: attention is finite — keep it focused.">
  <g font-family="ui-sans-serif, system-ui, sans-serif" text-rendering="geometricPrecision">

    <text x="175" y="24" font-size="11" font-weight="700" fill="#052e16" text-anchor="middle">Focused context</text>
    <circle cx="175" cy="140" r="22" fill="#16a34a"/>
    <text x="175" y="145" font-size="10" font-weight="700" fill="#fff" text-anchor="middle">AI</text>

    <g font-size="9.5" fill="#052e16" text-anchor="middle">
      <rect x="60" y="60" width="90" height="24" rx="6" fill="#dcfce7" stroke="#16a34a" stroke-width="1.2"/>
      <text x="105" y="76">context doc</text>
      <rect x="200" y="60" width="90" height="24" rx="6" fill="#dcfce7" stroke="#16a34a" stroke-width="1.2"/>
      <text x="245" y="76">current file</text>
      <rect x="60" y="196" width="90" height="24" rx="6" fill="#dcfce7" stroke="#16a34a" stroke-width="1.2"/>
      <text x="105" y="212">key decisions</text>
      <rect x="200" y="196" width="90" height="24" rx="6" fill="#dcfce7" stroke="#16a34a" stroke-width="1.2"/>
      <text x="245" y="212">relevant error</text>
    </g>
    <text x="175" y="256" font-size="10" font-style="italic" fill="#052e16" text-anchor="middle">relevant, fresh, small</text>

    <text x="525" y="24" font-size="11" font-weight="700" fill="#7f1d1d" text-anchor="middle">Polluted context</text>
    <circle cx="525" cy="140" r="22" fill="#dc2626"/>
    <text x="525" y="145" font-size="10" font-weight="700" fill="#fff" text-anchor="middle">AI</text>

    <g font-size="9" fill="#7f1d1d" text-anchor="middle">
      <rect x="390" y="40" width="80" height="20" rx="5" fill="#fecaca" stroke="#dc2626" stroke-width="1"/>
      <text x="430" y="54">stale comment</text>
      <rect x="480" y="40" width="80" height="20" rx="5" fill="#fecaca" stroke="#dc2626" stroke-width="1"/>
      <text x="520" y="54">old file</text>
      <rect x="570" y="40" width="80" height="20" rx="5" fill="#fecaca" stroke="#dc2626" stroke-width="1"/>
      <text x="610" y="54">unrelated log</text>

      <rect x="390" y="72" width="80" height="20" rx="5" fill="#fecaca" stroke="#dc2626" stroke-width="1"/>
      <text x="430" y="86">whole codebase</text>
      <rect x="480" y="72" width="80" height="20" rx="5" fill="#fecaca" stroke="#dc2626" stroke-width="1"/>
      <text x="520" y="86">old decisions</text>

      <rect x="390" y="104" width="80" height="20" rx="5" fill="#fecaca" stroke="#dc2626" stroke-width="1"/>
      <text x="430" y="118">duplicate notes</text>

      <rect x="390" y="196" width="80" height="20" rx="5" fill="#fecaca" stroke="#dc2626" stroke-width="1"/>
      <text x="430" y="210">off-topic thread</text>
      <rect x="480" y="196" width="80" height="20" rx="5" fill="#fecaca" stroke="#dc2626" stroke-width="1"/>
      <text x="520" y="210">dead code</text>
      <rect x="570" y="196" width="80" height="20" rx="5" fill="#fecaca" stroke="#dc2626" stroke-width="1"/>
      <text x="610" y="210">stale doc</text>
      <rect x="390" y="224" width="80" height="20" rx="5" fill="#fecaca" stroke="#dc2626" stroke-width="1"/>
      <text x="430" y="238">chatty history</text>
    </g>
    <text x="525" y="266" font-size="10" font-style="italic" fill="#7f1d1d" text-anchor="middle">noisy, stale, bloated — buries the signal</text>

    <text x="350" y="276" font-size="10" fill="#64748b" text-anchor="middle">attention is finite — keep the ring small and relevant</text>
  </g>
</svg>
```

## Keep sessions focused, and start fresh for unrelated tasks

The roadmap's first practical rule: _keep sessions focused, start fresh for unrelated tasks_ [1]. The temptation is to keep one long-running session for everything — it remembers, right? — but that's the trap. A session that worked on auth, then styling, then a migration, then a bug fix carries all four threads in its history. By the time I ask it to fix a fifth thing, the relevant context is buried under four unrelated topics, and the model's attention is split.

The discipline: one session, one thread of work. When the task changes — auth is done, now I'm on the dashboard — start a new session, paste the context doc, and begin clean. The cost is thirty seconds of setup. The payoff is that the model's full attention is on the current task, with only relevant history in view.

## Use subagents to keep context clean

The roadmap's second rule is the one that took me longest to use: _use subagents when possible to keep context clean and costs low_ [1]. A subagent is a separate AI session, spun up for a bounded sub-task, that reports its result back to the main session. Its key property is that **its context doesn't pollute the main session** — the main session sees only the result, not the hundred files the subagent read to produce it.

The payoff shows up on tasks that require a lot of reading but produce a small answer:

- "Find every place we call the old auth API and list the files." The subagent reads forty files; the main session sees a ten-line list.
- "Summarize what this dependency does and whether we still need it." The subagent digests the docs; the main session sees a paragraph.
- "Write the migration script." The subagent experiments in a scratch space; the main session sees the working script.

Without subagents, all that reading enters the main session's history and stays there, diluting everything after. With them, the main session stays focused on the actual work, and each sub-task's exploration is isolated and cheap [3].

```figure
<svg viewBox="0 0 700 240" xmlns="http://www.w3.org/2000/svg" class="my-6 w-full max-w-2xl" role="img" aria-label="A main AI session spawns three subagents for bounded sub-tasks: one reads many files and returns a short list, one digests docs and returns a summary, one writes a migration in a scratch space and returns the working script. Only the small results flow back into the main session; the bulk of each subagent's reading stays out.">
  <defs>
    <marker id="scarrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">
      <path d="M0,0 L10,5 L0,10 z" fill="#64748b"/>
    </marker>
  </defs>
  <g font-family="ui-sans-serif, system-ui, sans-serif" text-rendering="geometricPrecision">

    <rect x="270" y="100" width="160" height="48" rx="8" fill="#e0e7ff" stroke="#6366f1" stroke-width="1.5"/>
    <text x="350" y="122" font-size="12" font-weight="700" fill="#1e1b4b" text-anchor="middle">main session</text>
    <text x="350" y="138" font-size="10" fill="#1e1b4b" text-anchor="middle">stays focused</text>

    <rect x="40" y="40" width="180" height="40" rx="8" fill="#dcfce7" stroke="#16a34a" stroke-width="1.5"/>
    <text x="130" y="58" font-size="10" font-weight="700" fill="#052e16" text-anchor="middle">subagent — find old API calls</text>
    <text x="130" y="72" font-size="9.5" fill="#052e16" text-anchor="middle">reads 40 files</text>
    <path d="M222,60 C250,60 250,118 268,118" fill="none" stroke="#64748b" stroke-width="1.5" marker-end="url(#scarrow)"/>
    <text x="180" y="92" font-size="9" font-style="italic" fill="#64748b" text-anchor="middle">returns a 10-line list</text>

    <rect x="40" y="170" width="180" height="40" rx="8" fill="#dcfce7" stroke="#16a34a" stroke-width="1.5"/>
    <text x="130" y="188" font-size="10" font-weight="700" fill="#052e16" text-anchor="middle">subagent — summarize dep</text>
    <text x="130" y="202" font-size="9.5" fill="#052e16" text-anchor="middle">digests the docs</text>
    <path d="M222,190 C250,190 250,140 268,140" fill="none" stroke="#64748b" stroke-width="1.5" marker-end="url(#scarrow)"/>
    <text x="180" y="162" font-size="9" font-style="italic" fill="#64748b" text-anchor="middle">returns a paragraph</text>

    <rect x="480" y="40" width="180" height="40" rx="8" fill="#dcfce7" stroke="#16a34a" stroke-width="1.5"/>
    <text x="570" y="58" font-size="10" font-weight="700" fill="#052e16" text-anchor="middle">subagent — write migration</text>
    <text x="570" y="72" font-size="9.5" fill="#052e16" text-anchor="middle">experiments in scratch</text>
    <path d="M478,60 C450,60 450,118 432,118" fill="none" stroke="#64748b" stroke-width="1.5" marker-end="url(#scarrow)"/>
    <text x="520" y="92" font-size="9" font-style="italic" fill="#64748b" text-anchor="middle">returns the working script</text>

    <rect x="480" y="170" width="180" height="40" rx="8" fill="#fef9c3" stroke="#ca8a04" stroke-width="1.5"/>
    <text x="570" y="194" font-size="10" fill="#422006" text-anchor="middle">bulk reading stays OUT</text>
    <path d="M478,190 C450,190 450,140 432,140" fill="none" stroke="#ca8a04" stroke-width="1.5" stroke-dasharray="4 3" marker-end="url(#scarrow)"/>

    <text x="350" y="226" font-size="10" font-style="italic" fill="#64748b" text-anchor="middle">main session sees only the small results, not the exploration</text>
  </g>
</svg>
```

The rule I keep: if a sub-task requires a lot of reading to produce a small answer, delegate it to a subagent. If it requires ongoing back-and-forth on the main work, keep it in the main session.

## Context engineering as a team discipline

One thing the reading made clear: context engineering isn't just a personal workflow tweak — at team scale it becomes a shared practice [2][3]. The project's stable context (stack, conventions, structure, decisions) is the same for every engineer and every AI session. Writing it down once, in a place the whole team maintains, means every session — mine, a teammate's, a new hire's — starts from the same caught-up state instead of re-deriving the project's conventions from scratch [3]. The context doc becomes a team artifact, version-controlled, edited as decisions change.

## How I use this

Three habits. First, a context doc — short, stable, version-controlled — pasted into every fresh session so the model starts caught up. Second, one session per thread of work; when the task changes I start a new session rather than carrying unrelated history forward. Third, subagents for any sub-task that needs a lot of reading to produce a small answer, so the bulk of exploration stays out of the main session's history. The way of thinking I keep: context is a budget, and I spend it deliberately on the things that matter for this task, this session.

## References

[1] roadmap.sh, "Context," 2026. [Online]. Available: [https://roadmap.sh/vibe-coding/context](https://roadmap.sh/vibe-coding/context)

[2] Anthropic, "Effective context engineering for AI agents," 2026. [Online]. Available: [https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents)

[3] Packmind, "Context Engineering Best Practices for AI-Powered Dev Teams," 2026. [Online]. Available: [https://packmind.com/context-engineering-ai-coding/context-engineering-best-practices/](https://packmind.com/context-engineering-ai-coding/context-engineering-best-practices/)

```quiz
Q: The roadmap's central claim about context is…
- the model remembers your project across sessions
- the AI only knows what you tell it in the current session
correct: 1
explain: Every fresh session is amnesiac. The model has no memory of past decisions, project structure, or preferences unless you re-supply them. Stable context lives in a doc, not in the model's memory.

Q: Why does pasting "the whole codebase, just in case" usually hurt?
- it doesn't; more context is always better
- attention is finite, and irrelevant context crowds out the relevant signal
correct: 1
explain: Context is a budget, not a backdrop. Stale comments, off-topic history, and dead code actively mislead the model. Focused, relevant context beats large, noisy context.

Q: When should you start a fresh session?
- never; long-running sessions remember more
- when the thread of work changes — e.g. auth is done, now you're on the dashboard
correct: 1
explain: A session that worked on many topics carries all of them in history, burying relevant context. One session, one thread; start fresh and paste the context doc when the task changes.

Q: The main benefit of a subagent is…
- it runs faster than the main session
- its reading doesn't pollute the main session — only the small result flows back
correct: 1
explain: Subagents handle bounded sub-tasks that require lots of reading to produce a small answer (find all call sites, summarize a dep, write a migration). The main session sees only the result, staying focused and cheap.

Q: At team scale, context engineering becomes…
- each engineer's personal preference
- a shared practice — a version-controlled context doc every session and teammate starts from
correct: 1
explain: The project's stable context is the same for everyone. Maintaining it as a team artifact means every session — yours, a teammate's, a new hire's — starts caught up instead of re-deriving conventions.
```
