Agent skill

code-transfer

Transfer code between files with line-based precision. Use when users request copying code from one location to another, moving functions or classes between files, extracting code blocks, or inserting code at specific line numbers.

mhattingpetegithub.com/mhattingpeteGitHub ↗
claude-codeships scriptsApache-2.0
Install
npx skills add mhattingpete/claude-skills-marketplace --skill code-transfer --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 4 KB
Bundled scripts: yes
Path: code-operations-plugin/skills/code-transfer/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 656
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Code Transfer Transfer code between files with precise line-based control. **Dual-mode operation**: native tools (1-10 files) or execution mode (10+ files, 90% token savings). ## Operation Modes ### Basic Mode (Default) Use Read, Edit, Bash scripts for 1-10 file operations. Works immediately, no setup required. ### Execution Mode (10+ files) ```python from api.filesystem import batch_copy from api.code_analysis import find_functions functions = find_functions('app.py', pattern='handle_.*') operations = [{ 'source_file': 'app.py', 'start_line': f['start_line'], 'end_line': f['end_line'], 'target_file': 'handlers.py', 'target_line': -1 } for f in functions] batch_copy(operations) ``` ## When to Use - "copy this code to [file]" - "move [function/class] to [file]" - "extract this to a new file" - "insert at line [number]" - "reorganize into separate files" ## Core Operations ### 1. Extract Source Code ``` Read(file_path="src/auth.py") # Full file Read(file_path="src/auth.py", offset=10, limit=20) # Line range Grep(pattern="def authenticate", -n=true, -A=10) # Find function ``` ### 2. Insert at Specific Line Use `line_insert.py` script for line-based insertion: ```bash python3 skills/

What's inside
Steps it walks through
  1. Operation Modes
  2. Basic Mode (Default)
  3. Execution Mode (10+ files)
  4. When to Use
  5. Core Operations
  6. 1. Extract Source Code
  7. 2. Insert at Specific Line
  8. 3. Insert Relative to Content
  9. Workflow Examples
  10. Copy Function Between Files
  11. Extract Class to New File
  12. Insert at Specific Line
  13. Reorganize Into Modules
  14. Best Practices
Ships with 1 file
  • scripts/line_insert.py
Commands it runs
python3 skills/code-transfer/scripts/line_insert.py <file> <line_number> <code> [--backup]
Insert function at line 50
python3 skills/code-transfer/scripts/line_insert.py src/utils.py 50 "def helper():\n    pass"
Insert with backup
python3 skills/code-transfer/scripts/line_insert.py src/utils.py 50 "code" --backup
Insert at beginning
python3 skills/code-transfer/scripts/line_insert.py src/new.py 1 "import os"
More from claude-skills-marketplace
All skills →
About this skill
What does the code-transfer skill do?

Transfer code between files with line-based precision. Use when users request copying code from one location to another, moving functions or classes between files, extracting code blocks, or inserting code at specific line numbers.

How do I install it?

Run `npx skills add mhattingpete/claude-skills-marketplace --skill code-transfer --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From mhattingpete/claude-skills-marketplace, a repository with 656 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going