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 agentmods add skills/sharpninja/mcpserver/edit-file-usagenpx skills add sharpninja/McpServer --skill edit-file-usagegit clone --depth 1 https://github.com/sharpninja/McpServerWhat 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 | $0.00044 | $0.01236 |
| Opus 5 | $0.00022 | $0.00618 |
| Sonnet 5 | $0.00009 | $0.00247 |
| 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 yesterday.
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 MCP Server RepoFileService (interface IRepoFileService,
src/McpServer.Services/Services/RepoFileService.cs) and are wrapped by
TransactionGatedRepoFileService (src/McpServer.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.
- yesterday First seen · 90 lines · 44 tokens per session scan A ce0aac1cdfa5
edit-file-usage is a skill published in the GitHub repository sharpninja/McpServer (2 stars, last pushed 11d ago), licensed Apache-2.0. It adds 44 tokens to every session and 1,236 once invoked, about $0.0002 per session on Opus 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
opencli-sitemap-author
Use when creating or maintaining OpenCLI site sitemaps: agent-facing navigation, page-state, action, workflow, API-reference, pitfall, and fallback knowledge for a website. Use after browser exploration discovers durable site context, when a sitemap is stale, or when promoting local site knowledge into the repo.
golden-rss
Use when testing the rss golden build.
omh-code-review
This is a Hermes-native code-review workflow skill.
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
安卓应用渗透测试 — APK分析、Hook、自动化测试、运行态驱动、签名恢复、抓包分析.
studio
Architecture Studio control plane — initialize or inspect a studio workspace, create and register projects, or route an architecture/AEC task to the right agent or skill. Use when the user runs /as:studio, asks to set up or open their studio, manage its projects, or describes a task without naming a skill.