Context Engineering Beat Prompt Engineering for Me in 2026 — Here's the Setup
· Tutorials
Prompts stopped being the bottleneck. What the model can see is. A practical guide to structuring context: file layout, memory, retrieval, and token budgets.
Last updated: August 3, 2026 · 9-minute read
I spent 2024 collecting prompts. I spent 2026 deleting them. The single biggest quality jump in my agent workflows came from changing what the model can see, not what I ask it.
That shift has a name now — context engineering — and most of it is unglamorous file plumbing. Here is the exact setup I use across every repo.
The mental model: a context budget, not a context window
A 1M-token window is not an invitation to fill it. Every irrelevant token is a distractor, and quality degrades long before the hard limit. I budget context in four tiers:
If tier 1 exceeds 2k tokens, it stops being read carefully. That's the discovery that fixed the most for me.
Tier 1 — The always-on file
One file, at the repo root, that answers the questions a new contractor would ask on day one:
Stack: React 18 + Vite + Tailwind 3 + TypeScript. No Next.js. Styling: semantic tokens only. Never text-white, bg-black, or hex values. Data: content lives in content/posts/.md with YAML frontmatter. Testing: npm run test (vitest). E2E in e2e/ (Playwright).
## Hard rules - Never edit files in public/ by hand — they are generated by scripts/generate-seo.mjs. - Never add a dependency without asking. - Every new route must be added to the prerender list.
Notice what's not there: no architecture essay, no history, no aspirations. Rules the agent can violate, stated as rules.
Tier 2 — Task context that follows imports
The mistake is dumping the whole src/ tree in. The fix is a dependency-aware slice: the file you're changing, everything it imports one level deep, and its test file. Nothing else.
Most agent CLIs do a version of this automatically. The value of doing it explicitly is that you notice when a file has 22 imports — which is usually the real bug.
Tier 3 — Retrieval that isn't a vector database
For 90% of side projects, semantic search over your own repo is overkill. Three cheaper mechanisms cover almost everything:
1. A references/ folder of short markdown files — API schemas, error tables, deploy runbooks — loaded by name when relevant. 2. MCP servers for live data: filesystem, git history, your database schema, your docs. I ranked the ones worth installing in best MCP servers for Claude Code. 3. Skills — packaged, retrievable procedures. When I wired up Hashnode publishing, I used their official GraphQL skill instead of pasting API docs into a prompt. The skill loads only when the task mentions Hashnode.
The pattern is the same in all three: name-addressable context, loaded on match.
Tier 4 — Compaction, and when to just start over
Long sessions rot. Tool output piles up, early decisions scroll out of attention, and the agent starts contradicting itself. Two habits:
- Checkpoint to disk. At the end of a working session, have the agent write a 10-line DECISIONS.md entry. Next session starts from the file, not from a 200-message transcript.
- Restart on contradiction. The moment the agent re-suggests something you already rejected, the context is poisoned. A fresh session with the checkpoint file beats another correction.
I keep a persistent memory layer for the durable half of this — the setup is in Claude Code memory + MCP.
A concrete before/after
Before (prompt engineering): a 400-word prompt describing my design system, pasted into every session. The agent still shipped bg-white twice a week.
After (context engineering): a 12-line conventions file, plus a pre-commit check that greps for hardcoded colours and fails loudly. Violations went to zero — not because the model got smarter, but because the rule became both visible and enforced.
That's the whole thesis. Context is what the model sees; enforcement is what makes it true. Prompts sit awkwardly between the two and do neither job well.
Checklist you can copy today
- [ ] One root conventions file, under 2k tokens, rules-only
- [ ] A forbidden list, written before the goal
- [ ] Task context sliced by imports, not by folder
- [ ] references/ for anything longer than a paragraph
- [ ] MCP or skills for live/external data
- [ ] A DECISIONS.md checkpoint per session
- [ ] A grep-able CI check for every rule you actually care about
None of this needs a new tool. It needs about 40 minutes and the willingness to delete your prompt library.
Related: the 6 agent workflows I ran for 90 days and the AI Agents topic hub.