Agent skill

Knowledge Filesystem Search And Atomic Patching

by echoVic in echoVic/blade-code

Covers Read/Write/Edit/ApplyPatch、Snapshot、Read-Before-Write、Glob/Grep、Notebook 编辑及本地/ACP 文件系统差异。

MITAuto-check passedDevelopment

Install Knowledge Filesystem Search And Atomic Patching

skills CLI
$ npx skills add echoVic/blade-code --skill knowledge-filesystem-search-and-atomic-patching -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install echoVic/blade-code knowledge-filesystem-search-and-atomic-patching --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/echoVic/blade-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.trae/knowledges/tool-and-automation-platform/filesystem-search-and-atomic-patching .claude/skills/knowledge-filesystem-search-and-atomic-patching && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
knowledge-filesystem-search-and-atomic-patching
GitHub stars
180
Token cost
~1.7k tokens
SKILL.md length
328 words
Files
1
Skills in repo
38
Repo updated
First seen
Licence
MIT

At a glance

Covers Read/Write/Edit/ApplyPatch、Snapshot、Read-Before-Write、Glob/Grep、Notebook 编辑及本地/ACP 文件系统差异。

  • Tasks that involve Git worktrees
  • SKILL.md covers Module Structure, Gotchas, Architecture and Decisions, plus 2 more sections
  • Calls git

What it does

Knowledge Filesystem Search And Atomic Patching is an agent skill from echoVic/blade-code. Covers Read/Write/Edit/ApplyPatch、Snapshot、Read-Before-Write、Glob/Grep、Notebook 编辑及本地/ACP 文件系统差异。 Navigate when: 修改文件读写、智能替换、原子多文件补丁、会话回退、搜索降级、Git ignore 处理或 ACP 远端文件行为。 Excludes: 通用权限与执行阶段(见 ../tool-execution-pipeline/)、Shell 进程和 worktree(见 ../shell-process-and-worktree/)。 Keywords: Read, Write, Edit, ApplyPatch, FileAccessTracker, SnapshotManager, PatchTransactionCoordinator, FileSystemService, Glob, Grep.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees. It works with Git. The repository describes itself as: AI-powered CLI coding agent with 20+ built-in tools, MCP support, and multi-model providers. The licence is MIT.

When your agent uses it

  • Tasks that involve Git worktrees

Example prompts

  • “Use the knowledge-filesystem-search-and-atomic-patching skill to cover Read/Write/Edit/ApplyPatch、Snapshot、Read-Before-Write、Glob/Grep、Notebook…”
  • “/knowledge-filesystem-search-and-atomic-patching”

What it can do on your machine

Read from SKILL.md and the folder at commit 30f8684. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Knowledge Filesystem Search And Atomic Patching loads about 1.7k tokens when it runs. Until then it costs about 115 tokens; SKILL.md has 328 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~115
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from echoVic/blade-code at commit 30f8684, republished under its MIT licence (© echoVic). 328 words, ~1,688 tokens.

Download SKILL.mdSave it as .claude/skills/knowledge-filesystem-search-and-atomic-patching/SKILL.md (or your agent's skills folder).
name
knowledge-filesystem-search-and-atomic-patching
description
Covers Read/Write/Edit/ApplyPatch、Snapshot、Read-Before-Write、Glob/Grep、Notebook 编辑及本地/ACP 文件系统差异。 Navigate when: 修改文件读写、智能替换、原子多文件补丁、会话回退、搜索降级、Git ignore 处理或 ACP 远端文件行为。 Excludes: 通用权限与执行阶段(见 ../tool-execution-pipeline/)、Shell 进程和 worktree(见 ../shell-process-and-worktree/)。 Keywords: Read, Write, Edit, ApplyPatch, FileAccessTracker, SnapshotManager, PatchTransactionCoordinator, FileSystemService, Glob, Grep.

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)

Architecture

  • Read 既返回内容也更新 Session 访问记录,写工具再检查该记录;这是跨工具的时序契约,不是单个 schema 能表达的约束 (packages/cli/src/tools/builtin/file/read.ts, packages/cli/src/tools/builtin/file/FileAccessTracker.ts)
  • 本地 ApplyPatch 分为 parse、纯预演 plan、workspace/多路径锁、stage+backup+journal 发布、快照完成和访问记录更新;解析或预演失败发生在任何目标文件变更之前 (packages/cli/src/tools/builtin/file/applyPatch.ts, packages/cli/src/tools/builtin/file/applyPatchTransaction.ts)
  • patch journal 以 canonical workspace 哈希分区并使用 0600 文件;preparing 在恢复时回滚,committed 只清理遗留 stage/backup,畸形或越界 journal 直接失败 (packages/cli/src/tools/builtin/file/PatchTransactionCoordinator.ts)
  • Snapshot 存储按 canonical workspace 与 Session 双重隔离,记录写前内容、是否原本存在和写后哈希,因此 Add、Delete、Move 都能参与 message 级回退 (packages/cli/src/tools/builtin/file/SnapshotManager.ts)
  • 本地和 ACP 文件工具共享接口但能力不对称;是否使用远端文件由 Session 的 ACP service context 决定,而不是由路径形式猜测 (packages/cli/src/services/FileSystemService.ts, packages/cli/src/acp/AcpServiceContext.ts)

Decisions

  • Blade 的 ApplyPatch 拒绝“前缀已提交、失败返回 delta”语义,选择完整预演和全事务回滚,避免多文件修改留下半完成状态 (docs/reference/atomic-apply-patch.md, git:df17b2eb)
  • 本地发布使用目标同目录的 exclusive stage/backup、文件和目录 fsync,再写 committed journal;这是为了同时覆盖原子 rename 与进程崩溃恢复 (packages/cli/src/tools/builtin/file/applyPatchTransaction.ts, packages/cli/src/tools/builtin/file/PatchTransactionCoordinator.ts)
  • Edit 保留渐进式匹配但对多处命中要求显式 replace_all 或更大上下文,优先让模型修正定位而非猜测目标 (packages/cli/src/tools/builtin/file/edit.ts, git:300cc776)

Patterns

  • 文件修改成功后 metadata 保留完整 old/new content 或 changes[],模型侧只接收摘要/diff;Session rewind、Web changed-files 和 ACP diff 都复用同一结果事实 (packages/cli/src/tools/types/ToolTypes.ts, packages/cli/src/tools/builtin/file/applyPatch.ts)
  • 多路径 patch 在拿锁前先提取并去重目标,锁键解析已有祖先的 realpath,避免路径别名形成两把独立锁 (packages/cli/src/tools/builtin/file/applyPatch.ts, packages/cli/src/tools/execution/FileLockManager.ts)
  • ApplyPatch 限制为 1 MiB 输入、100 个文件操作、1000 个 hunk、50000 行;本地/远端规划再限制单文件 10 MiB和事务预演 32 MiB (packages/cli/src/tools/builtin/file/applyPatchParser.ts, packages/cli/src/tools/builtin/file/applyPatchTransaction.ts)
  • Glob 使用递归 .gitignore 解析、禁用符号链接跟随并二次应用 negation;结果先文件后目录,再按修改时间降序 (packages/cli/src/tools/builtin/search/glob.ts)
  • 搜索工具把取消视为失败而不是返回部分结果;Glob 只有达到结果上限才返回成功且标记截断 (packages/cli/src/tools/builtin/search/glob.ts, packages/cli/src/tools/builtin/search/grep.ts)

Recovery And Consistency

  • Session 初始化会在本地模式恢复未完成的 patch journal;恢复本身也在 workspace 跨进程锁和多路径锁内执行 (packages/cli/src/agent/runtime/SessionRuntime.ts, packages/cli/src/tools/builtin/file/PatchTransactionCoordinator.ts)
  • 本地发布中途失败会删除已发布新文件、逆序恢复 backup、删除 stage 与本次创建的空目录;回滚失败升级为 AggregateError,绝不报告成功 (packages/cli/src/tools/builtin/file/applyPatchTransaction.ts, packages/cli/tests/integration/apply-patch-transaction.test.ts)
  • Session rewind 先收集所有文件当前状态,再验证所有 post-edit hash,最后批量恢复;恢复中途失败还会尝试恢复到 rewind 前状态 (packages/cli/src/tools/builtin/file/SnapshotManager.ts)

© echoVic, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .trae/knowledges/tool-and-automation-platform/filesystem-search-and-atomic-patching of echoVic/blade-code.

Open the folder on GitHubat commit 30f8684

Compare with similar skills

Knowledge Filesystem Search And Atomic Patching next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Knowledge Filesystem Search And Atomic Patching compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Knowledge Filesystem Search And Atomic Patching this skillechoVic/blade-code180—~1.7kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k33 repos~1.8kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 33 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated 10 days ago
    DevelopmentAuto-check passed
  • Builds a Cap feature in an isolated Git worktree with disposable dev resources, verification, a recorded demo and a neutral pull request, started with /building.

    23k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: warnings

More from echoVic/blade-code

All 38 skills in this repo
  • Base64 Parser

    echoVic/blade-code

    Base64 编解码工具,支持编码/解码文本、JSON、二进制文件,自动检测格式,支持批量处理. An agent skill from echoVic/blade-code.

    180 GitHub stars~545 tokensUpdated 10 days ago
    Auto-check: notes
  • Code Review

    echoVic/blade-code

    Review frontend code for best practices, bugs, and improvements.

    180 GitHub stars~377 tokensUpdated 10 days ago
    Auto-check: notes
  • GitHub Explorer

    echoVic/blade-code

    Explore and summarize popular GitHub projects. An agent skill from echoVic/blade-code.

    180 GitHub stars~434 tokensUpdated 10 days ago
    Auto-check passed
  • 覆盖 Session 级 LSP 配置快照、stdio 进程、文档同步、语义查询、诊断回注、崩溃恢复 和子 Session 继承。进入条件:新增语言服务器、修改 LSP 工具、排查诊断缺失/重复、 处理 worktree 或 ACP 差异、修复进程泄漏或 transport 代际问题。不包含:VS Code 扩展桥接(见…

    180 GitHub stars~1.9k tokensUpdated 10 days ago
    Auto-check passed
  • 覆盖 SkillRegistry、SKILL.md 延迟加载、自定义命令 Markdown 解析、来源覆盖、插件 命名空间、Session 快照和模型/用户调用入口。进入条件:新增 Skill 或命令字段、调整 发现优先级、调试 /command 或 Skill 工具、修改 Prompt 元数据或消费者集成。不包含: 插件安装生命周期(见…

    180 GitHub stars~2.1k tokensUpdated 10 days ago
    Auto-check passed
  • Covers 领域能力如何包装成内置工具、getBuiltinTools 的 Session 依赖注入、ToolSearch 延迟激活,以及 Goal/Task/Team/Plan/Skill/LSP/MCP/Web/Config/Worktree 适配边界。

    180 GitHub stars~2.1k tokensUpdated 10 days ago
    Auto-check passed

Works with

Categories

Questions about Knowledge Filesystem Search And Atomic Patching

What does Knowledge Filesystem Search And Atomic Patching do?

Covers Read/Write/Edit/ApplyPatch、Snapshot、Read-Before-Write、Glob/Grep、Notebook 编辑及本地/ACP 文件系统差异。. Knowledge Filesystem Search And Atomic Patching is an agent skill from echoVic/blade-code./shell-process-and-worktree/)。 Keywords: Read, Write, Edit, ApplyPatch, FileAccessTracker, SnapshotManager, PatchTransactionCoordinator, FileSystemService, Glob, Grep.

When should I use Knowledge Filesystem Search And Atomic Patching?

Knowledge Filesystem Search And Atomic Patching fits situations like: tasks that involve Git worktrees.

How do I install Knowledge Filesystem Search And Atomic Patching in Claude Code?

Run `npx skills add echoVic/blade-code --skill knowledge-filesystem-search-and-atomic-patching -a claude-code`. Or copy the skill folder (.trae/knowledges/tool-and-automation-platform/filesystem-search-and-atomic-patching in echoVic/blade-code) into .claude/skills/knowledge-filesystem-search-and-atomic-patching in your project. Claude Code loads it when a task matches its description.

How do I install Knowledge Filesystem Search And Atomic Patching in Codex?

Run `npx skills add echoVic/blade-code --skill knowledge-filesystem-search-and-atomic-patching -a codex`. Or copy the skill folder (.trae/knowledges/tool-and-automation-platform/filesystem-search-and-atomic-patching in echoVic/blade-code) into .agents/skills/knowledge-filesystem-search-and-atomic-patching in your project. Codex loads it when a task matches its description.

Can I use Knowledge Filesystem Search And Atomic Patching in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add echoVic/blade-code --skill knowledge-filesystem-search-and-atomic-patching -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/knowledge-filesystem-search-and-atomic-patching, .gemini/skills/knowledge-filesystem-search-and-atomic-patching, .github/skills/knowledge-filesystem-search-and-atomic-patching and .opencode/skills/knowledge-filesystem-search-and-atomic-patching in your project.

What does Knowledge Filesystem Search And Atomic Patching need to run?

Going by SKILL.md and its folder, Knowledge Filesystem Search And Atomic Patching needs the command-line tools its instructions call (git).

Does Knowledge Filesystem Search And Atomic Patching access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Knowledge Filesystem Search And Atomic Patching safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Knowledge Filesystem Search And Atomic Patching use?

Knowledge Filesystem Search And Atomic Patching is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Knowledge Filesystem Search And Atomic Patching use?

About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Knowledge Filesystem Search And Atomic Patching?

Skills that share tags, products or a category with Knowledge Filesystem Search And Atomic Patching: Finishing a Development Branch (obra/superpowers, 296k stars), Finishing A Development Branch (farm-fe/farm, 5.6k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars) and Pre-Release PR Triage (jamiepine/voicebox, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Knowledge Filesystem Search And Atomic Patching?

echoVic (a GitHub user) maintains it in echoVic/blade-code, which has 180 GitHub stars. The repository holds 38 skills in this directory. The repository was last updated on September 27, 2026.

Source: echoVic/blade-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.