ClaudeCodeMod

All shelves / Mods / Usage

write-guard

By VedantAndhale

write-guard is a Claude Code usage mod by VedantAndhale.

Lets the first full rewrite of an existing file through, holds the next one so Claude uses Edit, and counts the rewrites it held.

DrawsHolds a command

Install

The marketplace name is claude-pro-kit.

In Claude Code
/plugin marketplace add VedantAndhale/claude-pro-kit
/plugin install write-guard@claude-pro-kit
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
0.1.0
License
MIT
Repo stars
10
Last change
2026-10-08

What it can reach

  • Draws in the session
  • Holds a command
  • Sees tool calls

Write sends the whole file as output tokens, and Edit sends only the lines that change. The first rewrite of an existing file in a conversation goes through, with one line after the result telling Claude to use Edit for later changes. A later rewrite is held back once. Claude is told the file exists and to change it with Edit, or to retry the same Write when a full rewrite is intended. New files, and files under 2,048 bytes, are never touched. A subagent has its own first rewrite. A compaction or /clear starts over. The status line counts the ones held back. The author, in 272 of their own session transcripts, counted 141 writes that rewrote a file Claude had already read or written. That one line after the first rewrite is what this adds for Claude to read.

One plugin from VedantAndhale/claude-pro-kit. The root README says prompt-polish is the only mod in that kit that makes a model call, and write-guard makes none. The plugin folder has no README. These lines are the repository README. file-guard holds writes outside the project and writes into .git, and asks before lockfiles and CI files. Nothing else on the shelf holds a full rewrite of an existing file so Claude uses Edit.

Demo

The write-guard section: the first full rewrite of an existing file goes through with a note to use Edit, a later rewrite is held back once, and the status line counts the ones held.
Screenshot of the author's GitHub page.

What it hooks into

  • tool.callAround a tool call, where it can hold oneWrite
  • session.compactWhen the context is compacted
  • session.endWhen a session ends

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Files

The author's source, 3 files. They load when you open them.

Facts

Author
VedantAndhale
Category
Usage
Marketplace
claude-pro-kit
Repo
VedantAndhale/claude-pro-kit
Folder
plugins/write-guard
Version
0.1.0
License
MIT
Repo stars
10
Last change
2026-10-08
Language
TypeScript
Files
5

Other mods in Usage

usage-hudronanworksDraws model, effort, context, and the 5-hour and weekly limits in a panel, and a pixel crab above the prompt that acts out the tool.cache-maxxervayaan-labsDraws the prompt-cache time left and hit rate above the input, says why the cache was rebuilt, and can send a short request to keep it warm.session-hudofeklevy11Draws four cards above the prompt: context left, the 5-hour limit, prompt clocks, and what the session cost.token-pilotDigital-ThreadsHolds a commandFor Token Pilot, which cuts what Claude reads from code, draws tokens saved and the 5-hour and 7-day limits above the prompt, and outlines a big file Read.laya-routermarcreichelRoutes the session once from its first prompt to a model and effort, and draws that route on the status line.cache-clockray-amjadDraws a line above the prompt with the time until the prompt cache goes cold, the context fill, and a subagent clock, and has Claude write a handoff first.antiburnantiburnDraws the five-hour and weekly limits above the prompt with reset times and even-pace markers, in the terminal and the desktop Code tab.context-metermidudevDraws how full the context window is at the right end of the band above the prompt: gray, then yellow from 50 percent, then red from 75.sub-metermidudevDraws your 5-hour and weekly subscription usage at the bottom right, on the permission mode's line, with a bar and the time until it resets.token-metermidudevEnds the hint line under the prompt with the last turn's input, output, and cache tokens, and the session's running total, in color.use-haikumidudevRuns a prompt that starts with _ on Haiku, subagents included, and shows it as you type, while it runs, and under the answer.agent-usage-guardrbartoliHolds a commandAsks before a subagent starts, a heavy prompt is sent, or a tool loop runs on, from the 5-hour and weekly usage, and refuses when nobody can answer.
All 183 in Usage