How to Make Gemini 4 Finish Long Coding Jobs: Google's 5 Tips as Copy-Paste Prompts
- Get link
- X
- Other Apps
Coding Agents · Guide
Google DeepMind's five developer habits for long Gemini 4 coding runs, translated into copy-paste prompts, model pricing tiers, and official skill commands.
By The Benchmarque Staff · · Updated Dec 6, 2026 · 8 min read
Compiled from Google DeepMind's developer briefing and official Gemini API documentation (Choosing a model, Latest Gemini models, Coding agent setup). Pricing and free-tier rules verified December 4, 2026.

Gemini 4 coding setup in 4 cards
Default coding pick
Hydrogen
gemini-4-hydrogen costs $1.50 / $7.50 per 1M tokens and includes a free API tier.
Shared context window
1M tokens
Hydrogen, Neon, and Carbon all share 1M context and 64K default output (1M long decode).
Sub-agent savings
8x gap
Carbon output ($20/1M) costs 8x Flash-Lite ($2.50/1M), making delegation pay quickly.
Most expensive tier
$4 / $20
gemini-4-carbon is paid-only and slower; reserve it for reasoning where Hydrogen stalls.
Google DeepMind's guidance for getting Gemini 4 to finish long coding jobs autonomously boils down to five repeatable habits: align on a plan before writing code, supply an objective self-verification check, attach visual references instead of prose, delegate sub-tasks to cheaper worker models, and distill session fixes into a reusable SKILL.md file. Start with gemini-4-hydrogen ($1.50 in / $7.50 out per 1M tokens, plus a free tier in Google AI Studio) before stepping up to Neon or Carbon.
- Method
- Official developer guidance and Gemini API docs synthesized into ready-to-use prompt templates
- Primary video
- "5 developer tips for working with Gemini 4" by Patrick Lober and Genevieve Huskens, Google DeepMind (Google for Developers)
- Official docs
- Gemini API documentation: Choosing a model, Latest Gemini models, Coding agent setup
- Verification date
- Pricing, context limits, and free-tier rules checked December 4, 2026
Video: "5 developer tips for working with Gemini 4" by Patrick Lober and Genevieve Huskens, Google DeepMind (Google for Developers). The briefing omits model selection, token pricing, and exact prompt syntax, which are compiled below from the Gemini API docs.
Which Gemini 4 model should coding agents start with?
Start with gemini-4-hydrogen for day-to-day coding and agent loops, and pair it with gemini-3.5-flash-lite for high-volume sub-tasks. All three Gemini 4 models share a 1M-token context window and identical built-in tools (Google Search, code execution, function calling, computer use, and structured outputs); they differ in latency, thinking levels, and price.
| Model | Speed | Thinking levels | Input / Output per 1M | Free access |
|---|---|---|---|---|
gemini-4-hydrogen | Fast | low, medium, high (default), xhigh | $1.50 / $7.50 | Free API tier and AI Studio |
gemini-4-neon | Moderate | low, medium, high (default), xhigh | $3.00 / $15.00 | Paid API (or AI Pro/Ultra) |
gemini-4-carbon | Deliberate | low, medium (default), high | $4.00 / $20.00 | Paid API (or AI Ultra) |
gemini-3.5-flash-lite | Fastest | minimal (default) to high | $0.30 / $2.50 | Free API tier |
Source: Google Gemini API documentation (Choosing a model and Latest Gemini models), verified December 4, 2026.
Because Carbon output costs 8 times Flash-Lite and 2.7 times Hydrogen, reserving heavier models for architecture and offloading routine checks to cheaper workers cuts billings sharply on long runs.
Tip 1: Why agree on a plan before an autonomous run starts?
The costliest agent failure is spending an hour editing files in the wrong direction. Google's first rule is to align on intent up front. In Google AI Studio, plan mode produces a structured proposal for approval before any code changes happen. In editors or CLI tools without built-in plan mode, prepend this prompt:
Before writing any code, give me a numbered plan:
1. What you will build and what you will NOT touch
2. Files you expect to change
3. How you will verify each step
4. Open questions for me
Wait for my "go" before starting.
Placing "what you will NOT touch" at item 1 stops coding agents from opportunistically refactoring unrelated modules.
Tip 2: How does the agent verify that the job is actually done?
An agent that can execute an objective check repairs its own bugs without human intervention. Google recommends binding completion to executable proof such as a unit test suite, linter, or browser screenshot diff:
Done means: `npm test` passes with 0 failures AND a screenshot of
/settings matches the attached mockup. After each change, run the tests.
If they fail, fix and re-run before telling me you're finished.
"Looks done" stalls multi-hour jobs; "all tests pass with 0 failures" gives the loop an unambiguous exit condition.
Tip 3: Why attach screenshots and recordings instead of prose?
Gemini 4 natively ingests images, audio, video, and PDFs. Attaching a visual artifact communicates layout and state transitions faster and with fewer misunderstandings than multi-paragraph bug descriptions:
- UI layout work: attach a target screenshot or Figma export alongside the prompt.
- Interactive bugs: attach a short screen recording demonstrating the reproduction steps and broken state.
- Data pipelines: attach a concrete sample of the raw input file and expected structured output.
Tip 4: How should Gemini 4 lead and delegate to sub-agents?
On large multi-file jobs, Google recommends designating one model as lead orchestrator to break work into bounded briefs for focused sub-agents (editing one module, running verification, or searching docs). Delegation keeps each sub-agent's context focused and saves money by pairing a stronger lead model with Hydrogen or Flash-Lite workers:
You are the lead. Split this task into independent sub-tasks.
For each one, write a short brief (goal, files, definition of done)
and delegate it. Review every result before merging it.
Tip 5: How do you stop re-teaching the same repository rules?
At the close of a complex session, instruct the model to audit what failed initially and package the working procedure into a concise SKILL.md file loaded automatically in future sessions:
Look back at this session. What did you get wrong at first, and what
fixed it? Write a SKILL.md with: when to use it, the steps that worked,
commands to run, and mistakes to avoid. Keep it under 60 lines.
An illustrative minimal SKILL.md structure:
---
name: deploy-preview
description: Build and deploy a preview of the web app and verify it
---
# Steps
1. Run `npm ci` then `npm run build` (never skip the clean install).
2. Run `npm test`; stop if anything fails.
3. Deploy with `npm run deploy:preview` and open the printed URL.
4. Screenshot /, /login and /settings and compare with the last run.
# Mistakes to avoid
- The build fails silently if .env.preview is missing. Check it first.
Among all five practices, capturing skills compounds longest because every solved edge case carries forward into subsequent runs.
Bonus: How do you stop coding agents from suggesting deprecated Gemini SDKs?
Because pretrained weights lag behind recent API releases, coding agents often reach for deprecated model strings or the legacy google-generativeai package instead of the current google-genai SDK. Google publishes official skill packages and a live Gemini Docs MCP server to eliminate stale boilerplate. Install the primary skill globally or inspect the full catalog with:
npx skills add google-gemini/gemini-skills --skill gemini-api-dev --global
npx skills add google-gemini/gemini-skills --list
Google's documentation lists native support across Claude Code, Cursor, OpenAI Codex, and VS Code, and bundles both the skills and Gemini Docs MCP server inside Google Antigravity via the Gemini API plugin. The five workflow habits themselves (plan-first, self-verification, multimodal references, delegation, and SKILL.md) transfer directly to any coding agent.
When should teams skip these steps, and what is unmeasured?
Avoid setting gemini-4-carbon as a blanket default: at $4 input / $20 output per million tokens, it is the priciest option in the family and Google's own docs point standard coding loops to Hydrogen first.
Scope note: these prompt templates are synthesized from official Google DeepMind guidance and Gemini API docs rather than timed benchmark runs, so exact completion-rate lifts are unmeasured here. Verify live pricing and free-tier terms on Google's API documentation before deploying production pipelines.
The verdict
Single highest-return habit: adopt Tip 2 first. Writing an explicit, executable definition of done takes two lines and gives any coding agent a self-correcting finish line.
Default model pairing: start every repository on gemini-4-hydrogen with the plan-first and verification prompts, install the official gemini-api-dev skill to prevent deprecated SDK imports, and offload high-volume worker tasks to gemini-3.5-flash-lite.
Escalating to Neon or Carbon: switch up only on architectural debugging or hard reasoning steps where Hydrogen visibly loops.
The catch: on the free Gemini API and AI Studio tier, Google may use submitted prompts to improve its products, so keep proprietary or private source code strictly on the paid API tier.
Quick answers
Which Gemini 4 model is best to start with for coding?
Google recommends starting with gemini-4-hydrogen ($1.50 in / $7.50 out per 1M tokens) for fast coding and agent loops, escalating to gemini-4-neon or gemini-4-carbon only for harder reasoning.
Is Gemini 4 free to use for coding?
gemini-4-hydrogen and gemini-3.5-flash-lite offer a free API tier and free access in Google AI Studio, while Neon and Carbon require the paid API tier or paid Google AI plans. Keep private code off the free tier because Google may train on free-tier prompts.
What is a SKILL.md file in coding-agent workflows?
A SKILL.md file is a short Markdown instruction sheet recording verified build commands, deployment steps, and pitfalls so a coding agent loads those lessons automatically instead of repeating past mistakes.
How large is Gemini 4's context window and output limit?
Hydrogen, Neon, and Carbon all support a 1 million token context window. Output defaults to a 64K-token ceiling and can extend up to 1M tokens with long decode enabled.
Next steps and tools
Compare coding and AI models on the Benchmarks Leaderboard
In the app: Benchmarks Leaderboard · PC and Local AI Builder · Hardware Market
Read next: One change makes a small AI 3.4x faster and cuts error from 320% to 7% · A 16GB Mac mini runs a 27B model and gets 20 of 20 tasks right · Running a 120B AI model at home
Sources
- Google for Developers: 5 developer tips for working with Gemini 4 (Patrick Lober and Genevieve Huskens, Google DeepMind) youtube.com
- Google AI Studio: Choosing a Gemini model (checked Dec 4, 2026) aistudio.google.com
- Google AI Studio: Latest Gemini models and pricing (checked Dec 4, 2026) aistudio.google.com
- Google AI Studio: Coding agent setup, official skills, and Gemini Docs MCP server aistudio.google.com
Comments
Post a Comment