code-transfer

Transfer code blocks between files with line-based precision.

657|94|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/mhattingpete/claude-skills-marketplace --skill code-transfer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-transfer
Source: https://github.com/mhattingpete/claude-skills-marketplace/tree/main/code-operations-plugin/skills/code-transfer
Command: npx skills add https://github.com/mhattingpete/claude-skills-marketplace --skill code-transfer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Manually moving or inserting code blocks can be error-prone, especially when dealing with specific line numbers or large files. This Skill automates precise code transfers, simplifying refactoring and reorganization.

Core Features & Use Cases

  • Line-based Insertion: Insert code at exact line numbers, even into new or empty files.
  • Code Extraction: Easily move functions, classes, or code blocks to new or existing files.
  • Reorganization: Split large files into multiple modules with automated updates to imports.
  • Use Case: You need to move a validate_user function from auth.py to a new validators.py file. This Skill can extract the function and insert it precisely, then help update imports.

Quick Start

Extract a function using line range

Read(file_path="auth.py", offset=45, limit=15)

Insert code at a specific line number

python3 skills/code-transfer/scripts/line_insert.py src/utils.py 50 "def helper(): pass"

Frequently Asked Questions about code-transfer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I move a function from one file to another with exact line precision?

Code transfer automates moving functions and classes between files by specifying exact line ranges. Read the source file to identify the line numbers, extract the code block, then insert it at a precise line in the target file—all without manual copying or reformatting errors.

Can I insert code at a specific line number in an existing file?

Yes, line-based insertion lets you add code at exact line numbers in new or existing files. The line_insert.py tool handles the insertion, preserving existing content and maintaining proper file structure without disrupting surrounding code.

What's the best way to reorganize and split a large file into multiple modules?

Extract functions or classes by line range, insert them into new module files at precise locations, then batch-operate across multiple files. The Skill discovers functions automatically and handles reorganization across small projects (1–10 files) or larger sets (10+ files) in Execution Mode.

Does code transfer work with large projects or only small codebases?

It supports both: Basic Mode handles projects with 1–10 files, while Execution Mode scales to 10+ files. Batch operations and function discovery enable efficient transfers across larger sets without manual per-file intervention.

Can I automate code reorganization while updating imports across multiple files?

Yes, the Skill extracts code blocks and inserts them into target files, then assists with automated import updates across affected modules. This simplifies refactoring workflows where moving code requires updating dependencies in multiple places.

What happens if I move code to a new file—does it create backups?

The Skill can create backups before transfers, protecting your original code. This safety feature is useful when reorganizing across multiple files or performing batch operations where validation is critical.