DEV Community

YuhaoLin2005
YuhaoLin2005

Posted on

Context Engineering Isn't Just for Prompts — It's for Config Files Too

Karpathy said it best in mid-2025: prompt engineering is dead. Context engineering is what replaced it. The LLM is a CPU. The context window is RAM. Your job is to be the operating system — loading exactly the right information, no more, no less.

Everyone applied this insight to prompts. Nobody applied it to the config files that control AI agents themselves.

I did. And I found that my 5-file Claude Code config system was doing to my LLM what bad context assembly does to any prompt — wasting attention, creating ambiguity, and silently degrading behavior.

The problem hides between files

A single config file with bad formatting is easy to spot. The problem I had was subtler: each of my 5 files looked fine on its own. The issues only surfaced when the LLM read them together.

1. Circular authority references. INTERFACE.md said "I'm the authority." agent-rules.md said "INTERFACE.md is the authority." Both had the same rules. The LLM got two copies with no signal about which wins on conflict.

2. Rules duplicated across files. The same disk thresholds appeared in 3 files. The same 7 behavioral rules appeared in both INTERFACE.md and agent-rules.md. Every duplicate: update one, others silently stale, LLM reads inconsistent instructions.

3. Ambiguous references. Does "last round" mean the previous turn or the previous session? A human infers. An LLM guesses.

4. Model names that don't exist. My interface said "complex→opus/pro" — Anthropic names in a DeepSeek system.

5. Format inconsistency. One file used numbered lists. Four used bullets. Every file transition forced the LLM to re-learn parsing.

13 fixes from a 2-agent review

I ran all 5 files through two reviews: one for DeepSeek V4 Pro parsing, one for cross-file consistency. 13 problems found:

Category Count Example
Circular references 1 INTERFACE ↔ agent-rules
Rule duplication 3 Disk thresholds ×3, rules ×2
Ambiguous references 3 "Last round", "violation = invalid"
Model mismatches 2 Anthropic names on DeepSeek
Format violations 4 Numbered lists, template traps, path errors

All text-only fixes. No behavior changed. 5% smaller, dramatically clearer.

Why this matters

Most AI agent users have config files. CLAUDE.md, AGENTS.md, .cursorrules. These load every session. Every ambiguity costs attention. Every duplicate is maintenance debt. Every circular reference is a tiny parsing loop.

This is context engineering at the infrastructure layer. Not "write better prompts." Treat your config files like code: review for consistency, eliminate duplication, break circular references, verify your model names exist.

The portability connection

My config system runs on SOUL/INTERFACE/BODY: swap INTERFACE.md when switching models. Making those files LLM-optimized means portability actually works. A clean INTERFACE loads correctly on Claude, DeepSeek, or Gemini. A polluted one confuses all of them.

Context engineering your config files isn't cleanup. It's what makes model portability real.

Top comments (0)