Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
Back to list

Code Transfer

A skill that guides Claude to copy, move, and extract functions or classes between files with line-level precision.

Dev & CodingIntermediate66395AI 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/Grep to pin down exact start/end lines, then inserts via the line_insert.py script or the Edit tool.
  • 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, --backup safety, and post-insert verification.

Who it's for

  • Developers splitting an overgrown utils.py into proper modules.
  • Anyone refactoring frequently and shuttling functions/classes across files.
  • Users who need code or logging inserted at an exact line number.

Examples

  1. "Move validate_user from auth.py to validators.py" → Grep locates it → extract → insert → fix imports on both sides.
  2. "Extract the DatabaseConnection class into database.py" → create new file, delete from original, add import.
  3. "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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download 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.

  1. Open a terminal.
  2. Clone the repo: git clone https://github.com/mhattingpete/claude-skills-marketplace.git
  3. Create the skills folder: mkdir -p ~/.claude/skills
  4. Copy the skill: cp -r claude-skills-marketplace/code-operations-plugin/skills/code-transfer ~/.claude/skills/
  5. Confirm ~/.claude/skills/code-transfer/scripts/line_insert.py exists (if not, re-check the repo layout).
  6. Restart Claude Code and try a prompt like "move this function to another file" to confirm the skill triggers.
  7. For important files, commit to Git first or use the --backup flag.
View source on GitHubLicense: Apache-2.0