Code Transfer
A skill that guides Claude to copy, move, and extract functions or classes between files with line-level precision.
Dev & CodingIntermediate★ 663⑂ 95AI score 8/10Last updated: Jul 25, 2026
What it does
- Copies or moves code blocks (functions, classes, arbitrary line ranges) from one file to another.
- Uses
Read/Grepto pin down exact start/end lines, then inserts via theline_insert.pyscript or theEdittool. - Basic mode for 1–10 files; execution mode with batch APIs for 10+ files to cut token usage.
- Includes checklists for updating imports, preserving docstrings/indentation,
--backupsafety, and post-insert verification.
Who it's for
- Developers splitting an overgrown
utils.pyinto proper modules. - Anyone refactoring frequently and shuttling functions/classes across files.
- Users who need code or logging inserted at an exact line number.
Examples
- "Move validate_user from auth.py to validators.py" → Grep locates it → extract → insert → fix imports on both sides.
- "Extract the DatabaseConnection class into database.py" → create new file, delete from original, add import.
- "Insert a log line at line 25 of main.py" →
line_insert.py main.py 25 "logger.info('...')" --backup.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/mhattingpete/claude-skills-marketplace/HEAD/code-operations-plugin/skills/code-transfer/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the code-operations-plugin/skills/code-transfer folder from the GitHub repo mhattingpete/claude-skills-marketplace into my ~/.claude/skills/code-transfer/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/mhattingpete/claude-skills-marketplace.git && mkdir -p ~/.claude/skills && cp -r claude-skills-marketplace/code-operations-plugin/skills/code-transfer ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/mhattingpete/claude-skills-marketplace.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r claude-skills-marketplace/code-operations-plugin/skills/code-transfer ~/.claude/skills/ - Confirm
~/.claude/skills/code-transfer/scripts/line_insert.pyexists (if not, re-check the repo layout). - Restart Claude Code and try a prompt like "move this function to another file" to confirm the skill triggers.
- For important files, commit to Git first or use the
--backupflag.
View source on GitHub ↗License: Apache-2.0