Every AI edits files without reading them first. This skill fixes that.
Free and open source · MIT Licence · Built by Speedrun AI Labs, Sydney, Australia
On the morning this skill was written, two things happened within an hour of each other:
- Our in-house AI agent tried to update a memory file — and silently overwrote it from scratch instead of editing it.
- Claude.ai, in a separate session, did the exact same thing to a different file.
Same mistake. Two different AI systems. One morning.
This is not a rare edge case. Every LLM — Claude, ChatGPT, Gemini, all of them — defaults to rewriting files instead of patching them. They don't read what's already there. They just write over it. Silently. Without flagging the conflict.
A contract lawyer reads the whole document before changing a word. A financial adviser reads the existing portfolio before recommending changes. An accountant reads the existing ledger before posting an entry.
Your AI agent should do the same. Now it can.
Installs a mandatory read-before-write discipline into any AI agent:
- Read first, always — the full file, before any edit
- Patch, don't replace — surgical edits only; never rewrite the whole file unless explicitly instructed
- Flag conflicts — if existing content contradicts the intended change, surface it before proceeding
- Hard stop on unreadable files — if the file can't be read for any reason, the agent stops and says so; it does not proceed blind
mkdir -p ~/.claude/skills
git clone https://github.com/Speedrunlab/read-before-write.git ~/.claude/skills/read-before-writeThen run: /read-before-write
mkdir -p ~/.openclaw/skills
git clone https://github.com/Speedrunlab/read-before-write.git ~/.openclaw/skills/read-before-writeOpenClaw picks it up automatically on next session.
Copy the contents of SKILL.md into your system prompt or custom instructions.
| Tool | Supported |
|---|---|
| Claude Code | ✅ |
| OpenClaw | ✅ |
| ChatGPT (custom instructions) | ✅ |
| Gemini (system prompt) | ✅ |
| Any LLM with system prompt access | ✅ |
This skill is part of the open-source skill library at speedrunlab.ai.
Other skills:
- /deep-audit — four-phase code auditor with evidence standards
- /no-slop-writing — eliminates AI-speak from generated text (American English)
- /no-slop-writing-au — same, Australian English edition
MIT. Free to use, modify, and distribute.
Built in Sydney by Speedrun AI Labs — where we caught this bug the hard way.