replacing-text

replacing-text is a skill for Claude Code, Codex from SebastienDegodez/copilot-instructions. It costs 28 tokens per session (724 once invoked), scanned A, original, Apache-2.0.

A guide to using sd, a command-line tool for finding and replacing text in files.

In plain words
What is it for?
Use it for simple replacements, batch edits, and text transformations after locating the files or patterns that need changing.
Why use it?
It provides a consistent way to replace known text or patterns across one or many files, including patterns written with JavaScript-style regular expressions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

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.

agentmods
npx agentmods add skills/sebastiendegodez/copilot-instructions/replacing-text
Any agent
npx skills add SebastienDegodez/copilot-instructions --skill replacing-text
Clone the repo
git clone --depth 1 https://github.com/SebastienDegodez/copilot-instructions

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 replacing-text

README.md
[![agentmods](https://agentmods.dev/badge/skills/sebastiendegodez/copilot-instructions/replacing-text.svg)](https://agentmods.dev/skills/sebastiendegodez/copilot-instructions/replacing-text)
Your own site
<a href="https://agentmods.dev/skills/sebastiendegodez/copilot-instructions/replacing-text"><img src="https://agentmods.dev/badge/skills/sebastiendegodez/copilot-instructions/replacing-text.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 724 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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.00028 $0.00724
Opus 5 $0.00014 $0.00362
Sonnet 5 $0.00006 $0.00145
Haiku 4.5 $0.00003 $0.00072

Measured 6d ago against content hash f3c753f06199, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

replacing-text 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 6d 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.

plugins/minimal-context-tools/skills/replacing-text/SKILL.md · 90 lines

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.

sd: Fast Find & Replace

Always invoke replacing-text skill for find & replace operations - do not execute bash commands directly.

Use sd for intuitive text replacement that's 2-12x faster than sed.

When to Use sd vs ripgrep

Use sd when:

  • Performing replacements on known patterns
  • Batch text transformations across files
  • Need JavaScript-style regex syntax
  • Direct file modifications without search first

Use ripgrep when:

  • Finding unknown patterns or locations
  • Need search results without immediate changes
  • Complex file filtering and type matching
  • Want to preview before modifying

Common workflow: searching-text skill → replacing-text skill (search first, then replace)

Default Strategy

Invoke replacing-text skill for fast find & replace operations. Use when performing replacements on known patterns, batch text transformations across files, or need JavaScript-style regex syntax.

Common workflow: searching-text skill → replacing-text skill (search first, then replace) or finding-files skill → replacing-text skill for batch operations.

Key Options

  • -F for string-literal mode (no regex)
  • $1, $2 or ${var} for capture groups
  • --preview to preview changes
  • -- before patterns starting with -
  • $$ for literal $ in replacement

Core Principle

Replace text with familiar JavaScript/Python regex syntax - no sed escape hell.

Detailed Reference

For comprehensive find & replace patterns, regex syntax examples, and workflow tips, load sd guide when needing:

  • Advanced regex patterns with capture groups
  • Pipeline operations and batch processing
  • Escape sequence handling
  • Common text transformation recipes
  • Integration with other command-line tools

The guide includes:

  • String-literal vs regex mode usage
  • Capture group patterns and replacements
  • Pipeline operations and batch processing
  • Advanced regex patterns and edge cases
  • Integration with other command-line tools

Skill Combinations

Read the full file on GitHub · 90 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago First seen · 90 lines · 28 tokens per session scan A f3c753f06199

Subscribe to this mod's changes

replacing-text is a skill published in the GitHub repository SebastienDegodez/copilot-instructions (192 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 28 tokens to every session and 724 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories

parallel-worktrees

Parallel git worktrees for concurrent Claude Code sessions. Use when working on multiple features or writer/reviewer workflows.

TheBeardedBearSAS/claude-craft · 26 tokens

context-management

UTILITY SKILL — Two-mode context-window management. RUNTIME: artifact compression (full/summarized/minimal) used by orchestrator and codegen agents. AUDIT: post-mortem analysis of Copilot debug logs (token profiling, redundancy + hand-off gap detection) used by 11-Context Optimizer. WHEN: "context optimization"…

jonathan-vella/apex-accelerator · 101 tokens

notification-routing

Route agent notifications to specific channels by type — prevent alert fatigue from single-channel flooding.

bradygaster/squad · 19 tokens

template-authoring

Guides creation and validation of custom dotnet new templates from existing projects. Generates a .template.config/template.json that preserves the source project's conventions. USE FOR: creating a reusable dotnet new template from an existing project, bootstrapping .template.config/template.json with correct…

managedcode/dotnet-skills · 157 tokens

planning-with-files

Use when user explicitly requests planning with files, or asks for persistent tracking of a complex task.

NikiforovAll/github-copilot-rules · 23 tokens

csharp-scripts

Run file-based C# apps with the .NET CLI when the user explicitly wants C#/.NET code without creating a project. Use for C# language/API experiments, one-file C# apps, small multi-file C# apps composed with #:include/#:exclude, or C# file-based apps linked with #:ref. Do not use for language-agnostic throwaway…

managedcode/dotnet-skills · 104 tokens