knowledge-filesystem-search-and-atomic-patching

knowledge-filesystem-search-and-atomic-patching is a skill for Claude Code, Codex from echoVic/blade-code. It costs 151 tokens per session (2,447 once invoked), scanned A, a copy of knowledge-tool-and-automation-platform, MIT.

A file-management component for reading, searching, editing, and patching files, including notebooks and files on remote systems.

In plain words
What is it for?
It is for finding files and text, making single- or multi-file edits, applying atomic patches, and recovering from failed or unwanted changes.
Why use it?
It reduces accidental overwrites by checking that files were read first and by keeping snapshots and recovery information for changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: names the NotebookEdit tool.

Good fit It is for finding files and text, making single- or multi-file edits, applying atomic patches, and recovering from failed or unwanted changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/echovic/blade-code/filesystem-search-and-atomic-patching
Install

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.

Any agent
npx skills add echoVic/blade-code --skill filesystem-search-and-atomic-patching
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for knowledge-filesystem-search-and-atomic-patching

README.md
[![agentmods](https://agentmods.dev/badge/skills/echovic/blade-code/filesystem-search-and-atomic-patching/github.svg)](https://agentmods.dev/skills/echovic/blade-code/filesystem-search-and-atomic-patching)
Your own site
<a href="https://agentmods.dev/skills/echovic/blade-code/filesystem-search-and-atomic-patching"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/filesystem-search-and-atomic-patching/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.

agentmods 80×15 button for knowledge-filesystem-search-and-atomic-patching

Your own site · 80×15
<a href="https://agentmods.dev/skills/echovic/blade-code/filesystem-search-and-atomic-patching"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/filesystem-search-and-atomic-patching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 151 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,447 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 84% copy Near-identical to another mod in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00151 $0.02447
Opus 5.5 $0.00060 $0.00979
Sonnet 5.5 $0.00030 $0.00489
Haiku 4.5 $0.00015 $0.00245

Measured 1mo ago against content hash 78891525cbeb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

knowledge-filesystem-search-and-atomic-patching 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 1mo 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.

Origin

This is a copy

84% identical to knowledge-tool-and-automation-platform — 89 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.trae/knowledges/tool-and-automation-platform/filesystem-search-and-atomic-patching/SKILL.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Module Structure

文件工具在统一 FileSystemService 上实现读取和单文件写入,并用 Session 访问记录与 快照保护编辑;ApplyPatch 对本地文件另建完整事务协议,对 ACP 远端文件使用受限的 补偿事务。搜索工具独立选择高性能后端并返回有界结果。

Directory Layout

  • packages/cli/src/tools/builtin/file/ — Read/Write/Edit/ApplyPatch、访问跟踪、快照和事务
  • packages/cli/src/tools/builtin/search/ — Glob/Grep 与多级搜索后端
  • packages/cli/src/tools/builtin/notebook/ — Notebook 结构化编辑
  • packages/cli/src/services/FileSystemService.ts — 本地与 ACP 文件操作接口
  • docs/reference/atomic-apply-patch.md — ApplyPatch 的事务与恢复契约

Key Entry Points

  • readTool / editTool / writeTool in packages/cli/src/tools/builtin/file/ — 单文件读取与编辑入口
  • applyPatchTool in packages/cli/src/tools/builtin/file/applyPatch.ts — 原子多文件变更入口
  • SnapshotManager in packages/cli/src/tools/builtin/file/SnapshotManager.ts — 按 Session、workspace 和 message 保存回退点
  • FileAccessTracker in packages/cli/src/tools/builtin/file/FileAccessTracker.ts — Read-Before-Write 与外部修改检测
  • globTool / grepTool in packages/cli/src/tools/builtin/search/ — 文件名与内容检索

Gotchas

  • 现有文件的 Write、Edit 和本地 ApplyPatch 要求当前 Session 先成功登记 Read;记录按 Session 隔离,并把符号链接别名与 canonical path 归并 (packages/cli/src/tools/builtin/file/FileAccessTracker.ts, packages/cli/src/tools/builtin/file/applyPatch.ts)
  • FileAccessTracker.checkExternalModification() 对 mtime 使用 2 秒缓冲,适合规避文件系统时间抖动但不是内容哈希锁;原子补丁另会在发布前逐字节重验旧内容 (packages/cli/src/tools/builtin/file/FileAccessTracker.ts, packages/cli/src/tools/builtin/file/applyPatchTransaction.ts)
  • Edit 不只做精确替换,还依次尝试行尾空白、智能引号、反转义、空白归一化、弹性缩进和块锚点;非唯一匹配仍会在 replace_all=false 时失败,不能把容错匹配当成模糊批改 (packages/cli/src/tools/builtin/file/edit.ts, git:300cc776)
  • Edit/Write 的快照创建或 post-state 登记失败只记录警告并继续报告文件写入成功,snapshot_created=false 才是能否 rewind 的权威标志 (packages/cli/src/tools/builtin/file/edit.ts, packages/cli/src/tools/builtin/file/write.ts)
  • ApplyPatch 在提交前创建所有快照,任一快照失败会阻止整个提交;这与单文件 Edit/Write 的 best-effort 快照策略不同 (packages/cli/src/tools/builtin/file/applyPatch.ts)
  • ApplyPatch 工具声明 isConcurrencySafe=true 与 parallelism='shared',因为它在内部解析全部路径并获取稳定排序的多路径锁;改回通用单路径锁会破坏多文件原子性 (packages/cli/src/tools/builtin/file/applyPatch.ts, packages/cli/src/tools/execution/FileLockManager.ts)
  • ACP 远端 ApplyPatch 只支持 Update,Add/Delete/Move 必须 fail closed;每次远端写后 read-back,失败时按逆序补偿并再次校验,而不是错误写入同名本地路径 (packages/cli/src/tools/builtin/file/applyPatchTransaction.ts, packages/cli/tests/integration/apply-patch-transaction.test.ts)
  • ACP 模式的二进制 Write 明确拒绝;绕过 FileSystemService 写本地文件会把远端编辑错误落到 Blade 宿主机 (packages/cli/src/tools/builtin/file/write.ts, packages/cli/src/services/FileSystemService.ts)
  • Snapshot rewind 只接受目标 message 对每个文件形成历史连续后缀,并要求当前文件哈希仍等于 Blade 最后写后哈希;否则整批回退前即拒绝 (packages/cli/src/tools/builtin/file/SnapshotManager.ts)
  • Glob 达到 max_results 后主动销毁流并把 truncated=true,此时 total_matches 只是已返回数量,不是实际总数 (packages/cli/src/tools/builtin/search/glob.ts)
  • Grep 的后端依次为系统 rg、随包 vendor rg、可选 @vscode/ripgrep,再降级到 git grep、系统 grep 和 JavaScript;不同降级层的 ignore、glob 与 multiline 能力并不完全等价 (packages/cli/src/tools/builtin/search/grep.ts)
  • 当前仅 Read、Glob、Grep 在本节点显式 opt-in isRetrySafe;Write、Edit、ApplyPatch 和 NotebookEdit 即使错误码看似瞬态也默认只调用一次 (packages/cli/src/tools/builtin/file/read.ts, packages/cli/src/tools/builtin/search/glob.ts, packages/cli/src/tools/builtin/search/grep.ts)

Read the full file on GitHub · 67 lines

Changes

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.

  1. 1mo ago First seen · 67 lines · 151 tokens per session scan A 78891525cbeb

Subscribe to this mod's changes

knowledge-filesystem-search-and-atomic-patching is a skill published in the GitHub repository echoVic/blade-code (181 stars, last pushed 3d ago), licensed MIT. It adds 151 tokens to every session and 2,447 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 84% identical to knowledge-tool-and-automation-platform, differing in 89 lines, and is treated as a copy.

Related

Other skills, from other repositories

delegation

Delegates independent work to worker agents through the Task tool, choosing between the explore scout and the ml, biology, physics, chemistry and data specialists, writing a self-contained brief for a worker that cannot see the conversation, setting boundaries on files and compute, using two independent annotators…

synthetic-sciences/openscience · 118 tokens

email

Manage emails via Himalaya CLI. Use when the user wants to read, send, search, or organize emails. Triggers on "email", "inbox", "send email", "check mail", "reply to", "forward", or mentions of Gmail, Outlook, iCloud, Proton Mail.

lvndry/jazz · 63 tokens

install-jazz-github-action

Set up Jazz as a GitHub Action for automated PR code review and on-demand /jazz PR assistance. Use when the user asks to add Jazz to CI, create a GitHub Action workflow, set up PR review automation, enable /jazz commands on PRs, or integrate Jazz with GitHub.

lvndry/jazz · 69 tokens

create-workflow

Create Jazz workflow automation files (WORKFLOW.md). Use this for scheduling Jazz agents to run recurring tasks. For OS-level scripts/commands, use create-system-routine.

lvndry/jazz · 38 tokens

obsidian

Use the official Obsidian CLI (v1.12+) to manage vaults, notes, daily notes, search, tasks, tags, properties, links, templates, sync, publish, and workspaces. Use when the user mentions Obsidian, vaults, notes, or wants to automate note-taking and knowledge base workflows.

lvndry/jazz · 71 tokens

skill-creator

Create new Jazz skills for automating workflows. Use when the user asks to create a skill, make a skill, or wants to define custom automation behavior.

lvndry/jazz · 35 tokens