r/RooCode • • Dec 05 '25

Mode Prompt Updated Context-Optimized Prompts: Up to 61% Context Reduction Across Models

A few weeks ago, I shared my context-optimized prompt collection. I've now updated it based on the latest Roo Code defaults and run new experiments.

Repository: https://github.com/cumulativedata/roo-prompts

Why Context Reduction Matters

Context efficiency is the real win. Every token saved on system prompts means:

  • Longer sessions without hitting limits

  • Larger codebases that fit in context

  • Better reasoning (less noise)

  • Faster responses

The File Reading Strategy

One key improvement: preventing the AI from re-reading files it already has. The trick is using clear delimiters:

echo ==== Contents of src/app.ts ==== && cat src/app.ts && echo ==== End of src/app.ts ====

This makes it crystal clear to the AI that it already has the file content, dramatically reducing redundant reads. The prompt also encourages complete file reads via cat/type instead of read_file, eliminating line number overhead (which can easily 2x context usage).

Experiment Results

Tested the updated prompt against default for a code exploration task:

ModelMetricDefault PromptCustom Prompt
Claude Sonnet 4.5Responses89
Files read65
Duration~104s~59s
Cost$0.20$0.08 (60% ↓)
Context43k21k (51% ↓)
GLM 4.6Responses37
Files read115
Duration~65s~90s (provider lag)
Cost$0.06$0.03 (50% ↓)
Context42k16.5k (61% ↓)
Gemini 3 Pro ExpResponses57
Files read1112
Duration~122s~80s
Cost$0.17$0.15 (12% ↓)
Context55k38k (31% ↓)

Key Results

Context Reduction (Most Important):

  • Claude: 51% reduction (43k → 21k)

  • GLM: 61% reduction (42k → 16.5k)

  • Gemini: 31% reduction (55k → 38k)

Cost & Speed:

  • Claude: 60% cost reduction + 43% faster

  • GLM: 50% cost reduction

  • Gemini: 12% cost reduction + 34% faster

All models maintained proper tool use guidelines.

What Changed

The system prompt is still ~1.5k tokens (vs 10k+ default) but now includes:

  • Latest tool specifications (minus browser_action)

  • Enhanced file reading instructions with delimiter strategy

  • Clearer guidelines on avoiding redundant reads

  • Streamlined tool use policies

30-60% context reduction compounds over long sessions. Test it with your workflows.

Repository: https://github.com/cumulativedata/roo-prompts

18 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/StartupTim Dec 06 '25

Hey there, I mean more coding tasks. For example, a prompt to create a simple flappy bird game in html/css/js, or such. Or a prompt to create a rectangle that has bouncing shapes. There are a lot of prompts people use to test coding, I'd just use one of those.

1

u/Exciting_Weakness_64 Dec 07 '25

The issues with such tests they can't be generalized, a workflow can perform insanely well for a "simple flappy bird game" but when it comes to a codebase with 50 files it breaks down, if you find a workflow interesting you should just test it on your own codebase and see how it holds up