Solving Gemini CLI write_file Not Found in OpenClaw: Two Fixes Required

A Reddit user posted a solution for a common issue when using OpenClaw with google-gemini-cli (Gemini CLI): agents cannot write files, reporting write_file not found or attempting default_api_write_file and getting "Tool not found. Did you mean: write_file, read_file, list_directory?". The root cause is twofold.
Root causes
- tools.profile defaults to
coding– this profile does not exposewrite_file. - OpenClaw spawns Gemini CLI as a headless subprocess without
--approval-mode auto_edit– without that flag,write_fileis not available in the tool list.
Fix steps
- Change the tools profile:
openclaw config set tools.profile full - Edit
~/.openclaw/openclaw.jsonand add thecliBackendsblock insideagents.defaults:
"cliBackends": { "google-gemini-cli": { "command": "/home/YOUR_USER/.npm-global/bin/gemini", "args": ["--approval-mode", "auto_edit"], "output": "json", "input": "arg" } } - Restart the gateway:
systemctl --user restart openclaw-gateway
The cliBackends key overrides how OpenClaw spawns the Gemini CLI process, injecting the required flag. Without it, the subprocess runs in default approval mode requiring interactive input, which silently removes the tool.
What doesn't work
- Creating
settings.jsonin the workspace withapprovalMode: auto_edit– OpenClaw doesn't pass the right working directory. - Setting
agents.defaults.sandbox.workspaceAccess: rw– that's OpenClaw's sandbox, unrelated to tool availability. - Injecting
GEMINI_CLI_ACTIVE_APPROVAL_MODEvia env – schema rejects it. - Modifying the gemini binary directly – works in isolation but OpenClaw may not use the same PATH.
Who it's for: Developers using OpenClaw with Gemini CLI who encounter missing file write tools during bootstrap or agent execution.
📖 Read the full source: r/openclaw
👀 See Also

Vibe Coding Rules: Build Side Projects from Your Phone Using Claude Code Without Reading Code
A senior engineer shares their rules for building side projects entirely from a phone using Claude Code without reading code: start in plan mode, commit to git, write tests, use subagents for reviews, and auto-mode.

Short Leash AI Coding Method: Beat Fable by Keeping Control
Greg Slepak's short leash method for AI coding agents: plan, review every diff, deny bad changes, commit after subtasks. Beats Fable quality by keeping the developer in the loop.

Effortlessly Capture Google Meet and Teams Transcripts with OpenClaw — Skill and Setup Guide
Integrating OpenClaw into Google Meet and Microsoft Teams provides seamless transcription capabilities. Learn how to set up and optimize this process for better workflow efficiency.

RAG Chatbot Evaluation: How a Model Sweep + Retrieval Fixes Cut Costs 79% and Raised Quality 19%
A developer evaluated a customer support RAG bot and found retrieval misconfigurations, heuristic evaluator flaws, and a cheaper model that outperformed the production one. Quality improved from 6.62 to 7.88 while cost dropped from $0.002420 to $0.000509 per session.