Gemini 4 Neon: Schmid trims his GEMINI.md to one screen
Philipp Schmid's five context changes for Gemini 4 Neon, checked against outside studies, for developers maintaining agent rules files.
Say you're a full-stack developer at a five-person agency, and the rules file behind your coding agent has been growing for a year. Each time a model misbehaved, you added a line: no code comments, never edit files outside the ticket, call the search tool like this, and here are three example calls. The project's instruction file carries a directory tree and a running log of decisions. Then you ask the agent to document a public function, and it stalls or skips the docstring because line 40 still bans comments. The file you wrote to make the agent dependable now argues with your request, and you pay for the argument in tokens.
Philipp Schmid's account of how he rebuilt his context for Gemini 4 Neon is about removing that argument. He cut most of the guardrails, duplicated tool rules and project files he had written for older models, and says the model wasted less thinking and got more accurate. He published the five changes on Nov 25, 2026, after what he describes as weeks of running evals and building daily with Neon. Two days later, Sulat AI & Tech News (Sulat) checked each habit against outside studies and found support somewhere for four of the five, with none of the measured support gathered on Neon.
What it is
The post is one practitioner's write-up of his own setup. It describes five changes, and each one maps to a part of the overgrown file above.
- Judgment cues instead of bans. When instructions conflict, Schmid writes, Neon "spends extra thinking tokens trying to resolve them and often follows the older rule instead of my current request." He replaced rigid code-style bans with cues such as matching the surrounding codebase's style, naming and comment density. His user-level GEMINI.md now fits on one screen. It holds hard safety limits around approvals, source verification and long jobs, plus short preferences for how the agent formats replies. That cue resolves the comment ban in the scenario.
- Tool rules stated once. He stopped describing each tool twice, once in its definition and again in the system instructions, and he deleted his few-shot examples. His reasoning is that examples help on common inputs but narrow edge cases: the model copies extra fields or the wrong argument shape and sends invalid calls. For agents built on the Gemini API, the rule goes into the tool's JSON schema as parameter types, enums and required fields. For daily coding agents, he applies the same idea to repo scripts, with clear flags, strict options and direct error messages. He also drops overlapping search tools and writes long command logs to a file so they don't fill the context.
- Thin project files, workflows in skills. He deleted almost every project-level AGENTS.md and GEMINI.md. Most repeated directory layouts the model can read for itself, or had turned into stale append-only logs. What remains is a short summary plus gotchas the model can't infer, such as a non-standard test command or the single file where all shared types must live. Domain workflows like UI guidelines and API reviews moved into skills with a one-line description in an index, and long skills split into a small tree of linked files.
- Pictures as spec and as test. For UI, diagrams and motion, he drops in a reference screenshot or a short screen recording. The agent then renders its output and opens the actual PNG or clip before calling the task done.
- Handoffs instead of compaction. At a phase change, the agent writes a handoff file with the goal, verified decisions and exact file paths, and a new session starts from that file. A second parallel track gets a forked session. If you run your own loop with automatic compaction as a fallback, he waits until around 500k tokens.
The contradiction problem shows up outside Gemini too. Anthropic's Claude Code memory docs warn that "if two instructions contradict each other, Claude may pick one arbitrarily." They recommend keeping each CLAUDE.md under 200 lines, and they describe a /doctor prompt-audit command that looks for problems including instructions written for older models.
The alternatives below are described from their own sources:
- Path-scoped rules. In Claude Code,
.claude/rules/files withpathsfrontmatter load only when Claude works with matching files. A path-scoped rule over its per-file size limit reaches Claude only up to the limit, with a note telling Claude to read the rest. Cursor's.mdcrules do the same job withglobsfrontmatter, according to BetterClaw's AGENTS.md guide. - Hooks and permission rules in place of prose bans. That guide says an instruction file "is guidance, not enforcement; if something must never happen, use a pre-commit hook or a permission rule." The trade-off is scope: this covers the must-never items, not style.
- A short committed AGENTS.md rather than none. BetterClaw recommends staying under 150 lines and puts the best files at 40 to 100, committed so every teammate and tool reads the same file. The cost it names is that every line loads into every session and costs tokens on every run.
Who it's for
Pick this up if your rules file has piled up across model generations and you can point to lines you added to patch one older model's habits. Schmid's diagnosis fits that file. The nearest measured evidence is the ETH Zurich and LogicStar.ai study Sulat summarizes, which Sulat calls a supporting result, not a test of his claim. LLM-generated context files lowered task success by about 3% and raised inference cost by over 20%. Developer-written files cost up to 19% more but lifted success by about 4%. Our reading: the cost figures back trimming, while the success figure for developer-written files points the other way. The agents weren't ignoring those files: they followed them closely, running more tests and using more reasoning tokens.
It also fits anyone building a custom agent on the Gemini API. The schema-first tool advice lines up with Google's Neon migration checklist, which Sulat reports tells developers to declare tools natively. The same checklist warns that prompting for raw-text JSON tool calls with zero declared tools "can return MALFORMED_FUNCTION_CALL".
Go slower in three cases:
- Your file is already short and specific. If you're in the 40-to-100-line range BetterClaw points to, there's little left to cut.
- A rule guards something that must never happen. Don't delete it; move it into a hook or permission rule first.
- You can't spend an hour rerunning tasks with and without a rule. Then don't delete on Schmid's word. According to Sulat, his own conference talk recommends with-and-without ablation tests, and the five-habits post publishes no results from them.
Before and after
Before:
- A session opens with a long user rules file, a project file holding a directory tree and old decision notes, and tool rules repeated in system instructions alongside few-shot examples.
- You ask for something an old ban forbids. On Schmid's account, Neon spends thinking tokens on the conflict and often obeys the ban.
- For a UI change, you write paragraphs of CSS rules and judge the result from text logs.
- The session runs on until compaction. He says compaction breaks the prompt cache, drops line-level details and sends the model back to re-read files it already opened.
After:
- The user file fits on a screen: safety limits, reply preferences and judgment cues.
- The project file is a summary plus the real gotchas. Workflows sit in skills that load on demand. The open Agent Skills specification, as Sulat describes it, puts the startup cost at about 100 tokens per skill and recommends bodies under 5,000 tokens.
- Tool rules live in the schema, or in a script's flags and error messages.
- UI work starts from a screenshot and ends with the agent opening its rendered PNG.
- A phase change means a handoff file and a fresh session.
The cache point carries real money. Microsoft's CompactionBench preprint covers 13.5 million GitHub Copilot agentic sessions. In that data, the median cache hit rate fell from 99.0% before a compaction to 27.0% after. Sulat gives Neon's prices as US$3 per million input tokens and US$0.15 per million cached tokens (Nov 27, 2026). By its arithmetic, a 500,000-token prompt costs US$1.50 in input on a miss and US$0.075 on a hit.
Try it
Run a with-and-without test on your own rules file before you delete anything. For Gemini users there's nothing to install: the changes are edits to GEMINI.md, AGENTS.md or CLAUDE.md.
-
Pick your tasks. Write down five tasks that currently pass or fail because of a rule you suspect, the first step in Sulat's checklist. Run them and note the results.
-
Measure the file. Anthropic's docs target under 200 lines per CLAUDE.md file. Check whichever file your agent loads against that before you cut anything.
-
Audit it (Claude Code). On Claude Code v2.1.283 or later, run the audit below. It reports problems such as instructions written for older models, references to missing files and files that contradict each other. It proposes edits and changes nothing until you ask.
/doctor prompt-audit
- Rewrite the user-level file to Schmid's pattern. This is our example, not his file. Keep it to judgment cues, safety limits and reply preferences:
- Match the surrounding code's style, naming and comment density.
- Ask for approval before deleting files, pushing, or touching production.
- Verify facts against a source before stating them.
- For long jobs, write logs to a file and report the path.
- Reply in short paragraphs, result first.
- Move one workflow out. Take a multi-step procedure, such as a release checklist or a review guide. Turn it into a skill with a one-line description, or in Claude Code a
.claude/rules/file withpathsfrontmatter so it loads only for matching files. - Rerun the five tasks. In Claude Code,
/context alllists loaded files under Memory files, so you can confirm the slimmer file is the one in use. The test passed if the tasks succeed at least as often as before with a shorter file. If one regresses, restore that single rule.
For the handoff habit, here's a skeleton built from the three things Schmid puts in his (our template):
# Handoff
Goal: <one sentence>
Verified decisions: <what was tested and settled>
Files: <exact paths touched or needed next>
Where it breaks
- No numbers. Schmid says he ran evals, but Sulat notes the post has no accuracy figures, token counts or task lists. The same piece points out that the model Schmid praises is his employer's product, and says Sulat did not contact Google or Schmid for it.
- Adjacent evidence. By that outlet's own account, the outside studies it cites (ETH Zurich, CompactionBench, LangWatch) were not run on Neon. The ETH paper also covers repository context files, not user-level rules files like GEMINI.md.
- A counterpoint on length. BetterClaw cites a controlled study by Damon McMillan of 1,650 Claude Code sessions. For a single simple style rule, file size and rule position made no detectable difference to compliance. The task mattered: each extra function the agent wrote was linked to about 5.6% lower odds of following the rule. Our reading is that conflicts and task complexity may matter more than raw line count, which fits Schmid's emphasis on conflict but undercuts trimming for its own sake.
- The 500k threshold. LangWatch's case study, as Sulat reports it, puts sensible compaction at 250,000 to 450,000 tokens depending on the task, and the cost-optimal point near 220,000 to 240,000. Microsoft's CompactionBench authors don't advise abandoning compaction; they propose running it progressively, off the critical path. Google's Neon guide adds that cumulative input counts rise within a single turn, so harness builders should check
initial_input_tokensand compact only after the turn finishes. - The image loop. Sulat found no published test of render-and-inspect. It's cheap to try, but it rests on Schmid's account alone.
- Deleted safety rules. A ban that protected production doesn't belong in a cleanup pass. Prose was never enforcement, per both Anthropic's docs and BetterClaw, so move it into a hook or permission rule before cutting it.
The open number is the one Schmid's post doesn't give: how much accuracy and how many thinking tokens the trim buys on Neon. None of our sources tests a smaller or cheaper executor model on the same one-screen rules file; his post covers Neon only.
Sources
- How my context engineering changed for Gemini 4 Neon · Philipp Schmid
- How Claude remembers your project - Claude Code Docs · Claude Code Docs
- Schmid’s five Gemini 4 Neon habits checked against outside studies · Sulat AI & Tech News
- AGENTS.md Best Practices (2026): Template, Length, Examples · BetterClaw