Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add sharpninja/McpServer --skill edit-file-usagegit clone --depth 1 https://github.com/sharpninja/McpServerWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/sharpninja/mcpserver/edit-file-usage)<a href="https://agentmods.dev/skills/sharpninja/mcpserver/edit-file-usage"><img src="https://agentmods.dev/badge/skills/sharpninja/mcpserver/edit-file-usage/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/sharpninja/mcpserver/edit-file-usage"><img src="https://agentmods.dev/badge/skills/sharpninja/mcpserver/edit-file-usage.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00044 | $0.01238 |
| Opus 5.5 | $0.00018 | $0.00495 |
| Sonnet 5.5 | $0.00009 | $0.00248 |
| Haiku 4.5 | $0.00004 | $0.00124 |
Grade A, and why
edit-file-usage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
edit_file Usage
The QBAgent edit_file tool performs a surgical, in-place change to a single file by
replacing an exact oldString with a newString. Edits are not raw filesystem writes:
they route through the QBrain.AI RepoFileService (interface IRepoFileService,
src/QBrainAi.Services/Services/RepoFileService.cs) and are wrapped by
TransactionGatedRepoFileService (src/QBrainAi.Support.Mcp/Services/TransactionGatedRepoFileService.cs),
which enforces the path allowlist (FR-SUPPORT-010, TR-PLANNED-CORE-013) and transactional
rollback compensation via IRepoFileCompensation (TR-MCP-TXN-001).
When to Use
- Changing a known region of an existing file: one function, one config key, a few lines.
- Renaming or retargeting a symbol where you can pin a unique surrounding context.
- Any edit where most of the file should stay byte-for-byte unchanged.
When Not to Use
- Creating a brand new file, or replacing essentially all of a file's content: use
write_file(backed byRepoFileService.WriteAsync) instead. - The target path is outside the workspace allowlist: the write will be rejected.
- You cannot read the file first to obtain an exact
oldString. Never guess at content.
Inputs
filePath(orrelativePath): path to the existing file, relative to the repo root.oldString: exact text to find, including original indentation and line breaks.newString: replacement text. Must differ fromoldString.replaceAll(optional, default false): replace every occurrence instead of one.expectedOccurrences(optional): assert the number of matches before applying; the edit fails if the actual count differs. Use this as a guard whenreplaceAllis true.
Critical Rules
- Read the file first.
oldStringmust match the on-disk bytes exactly, including leading whitespace. Strip any line-number orcat -nprefixes before matching. oldStringmust be unique within the file unlessreplaceAllis set. A non-uniqueoldStringwithoutreplaceAllis an error; widen the surrounding context to a unique span rather than forcing it.oldStringandnewStringmust differ. A no-op edit is an error.- Prefer
edit_fileoverwrite_filefor partial changes. Rewriting a whole file discards unrelated content, defeats the diff, and risks clobbering concurrent edits. - Edits are transactional. On a failed turn transaction,
IRepoFileCompensationrestores the prior file state, so a rejected edit leaves the file unchanged. Do not add your own manual rollback logic. - Do not chase path-safety or rollback yourself: the server owns both. Treat a rejected
edit as a signal to fix the path or the
oldString, not to retry blindly.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago Changed 8cc3a39175fa
- 1mo ago First seen · 90 lines · 44 tokens per session scan A ce0aac1cdfa5
edit-file-usage is a skill published in the GitHub repository sharpninja/McpServer (4 stars, last pushed today), licensed Apache-2.0. It adds 44 tokens to every session and 1,238 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
omh-code-review
This is an OMH code-review workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).
omh-rust
This is an OMH rust workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).
redteam-web-detail-pack
Routing and boundary guidance for authorized general web application security testing. Use as a web testing router when the attack surface should be dispatched to more specific web vulnerability skills.
android-pentest
A guide for authorized security testing of Android apps, covering APK inspection, runtime testing, traffic capture, code review, and function hooking. An APK is the installable package used by an Android app.
manage-schemas
Creates, views, edits, deletes, and validates note schemas for the MCP Task Orchestrator in .taskorchestrator/config.yaml — the templates that define which notes agents must fill at each workflow phase. Also recommends schema designs from a library of workflow patterns (autonomous coding loops, spec-driven teams…
lighting-report-extract
Check reported lighting quantities and results in supplied simulation PDFs without adding repeated calculation surfaces. Use for scoped luminaire inventories and illuminance results; not simulation or compliance.