Repren banner
jlevy jlevy

Repren

Code Quality community

Description

Power rename/refactor tool (now with Claude Code skill support!)

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

repren

![But call me repren for short](https://github.com/jlevy/repren/blob/master/images/awkward-150.jpg)


[!TIP] ✨✨ **NEW:** [v2.0.0](https://github.com/jlevy/repren/releases/tag/2.0.0) is out, refreshed for agent use! It’s self-documenting and has a self-installable skill.

Just tell Claude Code: *install repren as a skill, try uvx repren@latest --help*


Rename Anything

`repren` is a powerful CLI string replacement and file renaming tool for use by agents or humans for almost any search-and-replace or renaming task.

It is small, self-contained, self-documenting, and works on Python 3.10-3.14 with zero dependencies. Essentially, it is a general-purpose, brute-force text file refactoring tool.

For example, repren could rename occurrences of certain names in a set of source files, while simultaneously renaming the files and directories according to the same pattern and handling all case variations.

It’s more powerful than classic options like `perl -pie`, `rpl`, or `sed`:

  • **Replacements:** It allows rewriting file contents according to one or more literal or regular expression patterns.

  • **Renames:** It can also apply the patterns to rename or move files according to replacements on their full paths, creating directories as needed.

  • **Regexes:** It supports fully expressive regular expressions substitutions, including matching groups for back substitutions (like `\1`, `\2`, etc.).

  • **Simultaneous renames:** It performs simultaneous renamings: you can make as many replacements as you want and you can rename “foo” as “bar”, and “bar” as “foo” at once, without requiring a temporary intermediate rename.

  • **Good hygiene:** It is careful: it has a nondestructive “dry run” mode and prints clear stats on its changes. It leaves backups. File operations are done atomically, so interruptions never leave a previously existing file truncated or partly edited.

  • **Case preserving options:** It supports “magic” case-p