Transfer code between files with line-based precision. An agent skill from mhattingpete/claude-skills-marketplace.

Apache-2.0Auto-check passed

Install Code Transfer

skills CLI
$ npx skills add mhattingpete/claude-skills-marketplace --skill code-transfer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mhattingpete/claude-skills-marketplace code-transfer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mhattingpete/claude-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/code-operations-plugin/skills/code-transfer .claude/skills/code-transfer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-transfer
GitHub stars
680
Token cost
~1k tokens
SKILL.md length
307 words
Files
2 (incl. scripts)
Skills in repo
16
Repo updated
First seen
Licence
Apache-2.0

At a glance

Transfer code between files with line-based precision. An agent skill from mhattingpete/claude-skills-marketplace.

  • Works in 3 steps: Extract Source Code → Insert at Specific Line → Insert Relative to Content
  • Users request copying code from one location to another
  • SKILL.md covers Operation Modes, When to Use, Core Operations and Workflow Examples, plus 2 more sections
  • Runs Python scripts from its folder; calls python3

What it does

Code Transfer is an agent skill from mhattingpete/claude-skills-marketplace. 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.

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/line_insert.py`).

The repository describes itself as: Claude Code Skills for software engineering workflows - Git automation, testing, and code review. The licence is Apache-2.0.

When your agent uses it

  • Users request copying code from one location to another
  • Moving functions
  • Classes between files
  • Extracting code blocks

Example prompts

  • “/code-transfer”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Extract Source Code
  2. Insert at Specific Line
  3. Insert Relative to Content

What it can do on your machine

Read from SKILL.md and the folder at commit b5b34bc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Transfer loads about 1k tokens when it runs. Until then it costs about 61 tokens; SKILL.md has 307 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~61
When it runs · the whole SKILL.md, loaded when a task matches
~1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from mhattingpete/claude-skills-marketplace at commit b5b34bc, republished under its Apache-2.0 licence (© mhattingpete). 307 words, ~1,042 tokens.

Download SKILL.mdSave it as .claude/skills/code-transfer/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
code-transfer
description
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.

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/code-transfer/scripts/line_insert.py <file> <line_number> <code> [--backup]

Examples:

bash
# 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"

When to use:

  • User specifies exact line number
  • Inserting into new/empty files
  • Inserting at beginning/end without context
3. Insert Relative to Content

Use Edit when insertion point is relative to existing code:

Edit(
  file_path="src/utils.py",
  old_string="def existing():\n    pass",
  new_string="def existing():\n    pass\n\ndef new():\n    return True"
)

Workflow Examples

Copy Function Between Files
  1. Find: Grep(pattern="def validate_user", -n=true, -A=20)
  2. Extract: Read(file_path="auth.py", offset=45, limit=15)
  3. Check target: Read(file_path="validators.py")
  4. Insert: Use line_insert.py or Edit based on context
Extract Class to New File
  1. Locate: Grep(pattern="class DatabaseConnection", -n=true, -A=50)
  2. Extract: Read(file_path="original.py", offset=100, limit=50)
  3. Create: Write(file_path="database.py", content="<extracted>")
  4. Update imports: Edit in original file
  5. Remove old class: Edit with replacement
Insert at Specific Line
  1. Validate: Read(file_path="main.py", offset=20, limit=10)
  2. Insert: python3 skills/code-transfer/scripts/line_insert.py main.py 25 "logger.info('...')" --backup
  3. Verify: Read(file_path="main.py", offset=23, limit=5)
Reorganize Into Modules
  1. Analyze: Read(file_path="utils.py")
  2. Identify groups: Grep(pattern="^def |^class ", -n=true)
  3. Extract each category: Write new files
  4. Update original: Re-export or redirect

Best Practices

Planning:

  • Understand dependencies (imports, references)
  • Identify exact start/end of code block
  • Check target file structure
  • Ensure necessary imports included

Preservation:

  • Include docstrings and comments
  • Transfer related functions together
  • Update imports in both files
  • Maintain formatting/indentation

Validation:

  • Verify insertion placement
  • Check syntax
  • Test imports
  • Suggest running tests

Backups:

  • Use --backup for significant changes
  • Critical file operations
  • Large deletions

Integration

  • code-refactor: Refactor after transferring
  • test-fixing: Run tests after reorganizing
  • feature-planning: Plan large reorganizations

© mhattingpete, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in code-operations-plugin/skills/code-transfer of mhattingpete/claude-skills-marketplace.

  • SKILL.md
  • scripts/line_insert.py

Open the folder on GitHubat commit b5b34bc

Compare with similar skills

Code Transfer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Transfer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Transfer this skillmhattingpete/claude-skills-marketplace680—~1kAutomated safety check: PassApache-2.0
Intelligence Transferruvnet/ruflo74k—~877Automated safety check: NotesMIT
Mixed Precisionaiming-lab/AutoResearchClaw15k—~275Automated safety check: PassMIT
Performing DNS Enumeration And Zone Transfermukul975/Anthropic-Cybersecurity-Skills34k—~2.7kAutomated safety check: PassApache-2.0
MoviePilot Failed Transfer Retryjxxghp/MoviePilot12k—~584Automated safety check: PassGPL-3.0
Visual Edit Precisionwshobson/agents40k—~547Automated safety check: PassMIT

Similar skills

  • Publish or fetch learned patterns across projects via IPFS (Pinata) -- the cross-project pattern transfer that hookstransfer enables

    74k GitHub stars~877 tokensUpdated today
    Auto-check: notes
  • Mixed Precision

    aiming-lab/AutoResearchClaw

    Use FP16/BF16 mixed precision to accelerate training and reduce memory.

    15k GitHub stars~275 tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Performing DNS Enumeration And Zone Transfer

    mukul975/Anthropic-Cybersecurity-Skills

    Enumerates DNS records, attempts zone transfers, brute-forces subdomains, and maps DNS infrastructure during authorized reconnaissance to identify attack surface, misconfigurations, and information…

    34k GitHub stars~2.7k tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Retries failed MoviePilot video and music transfer records one verified group at a time, keeping retry evidence and re-identifying only legacy records that were actually deleted.

    12k GitHub stars~584 tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Visual Edit Precision

    wshobson/agents

    A skill your agent uses when making UI/frontend changes guided by visual context, when the user selects elements visually, draws annotations, or provides screenshots alongside change requests.

    40k GitHub stars~547 tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed
  • Precise

    microprediction/precise

    Online (incremental) covariance, correlation, and precision estimation in Python — the streaming complement to sklearn.covariance.

    336 GitHub stars~782 tokensUpdated 2 days ago
    Data & AnalyticsAuto-check passed

More from mhattingpete/claude-skills-marketplace

All 16 skills in this repo
  • Conversation Analyzer

    mhattingpete/claude-skills-marketplace

    Analyzes your Claude Code conversation history to identify patterns, common mistakes, and opportunities for workflow improvement.

    680 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Architecture Diagram Creator

    mhattingpete/claude-skills-marketplace

    Create comprehensive HTML architecture diagrams showing data flows, business objectives, features, technical architecture, and deployment.

    680 GitHub stars~676 tokensUpdated 2 mo ago
    Auto-check passed
  • Dashboard Creator

    mhattingpete/claude-skills-marketplace

    Create HTML dashboards with KPI metric cards, bar/pie/line charts, progress indicators, and data visualizations.

    680 GitHub stars~489 tokensUpdated 2 mo ago
    Auto-check passed
  • Flowchart Creator

    mhattingpete/claude-skills-marketplace

    Create HTML flowcharts and process diagrams with decision trees, color-coded stages, arrows, and swimlanes.

    680 GitHub stars~518 tokensUpdated 2 mo ago
    Auto-check passed
  • Technical Doc Creator

    mhattingpete/claude-skills-marketplace

    Create HTML technical documentation with code blocks, API workflows, system architecture diagrams, and syntax highlighting.

    680 GitHub stars~604 tokensUpdated 2 mo ago
    Auto-check passed
  • Timeline Creator

    mhattingpete/claude-skills-marketplace

    Create HTML timelines and project roadmaps with Gantt charts, milestones, phase groupings, and progress indicators.

    680 GitHub stars~482 tokensUpdated 2 mo ago
    Auto-check passed

Questions about Code Transfer

What does Code Transfer do?

Transfer code between files with line-based precision. An agent skill from mhattingpete/claude-skills-marketplace. Code Transfer is an agent skill from mhattingpete/claude-skills-marketplace. Transfer code between files with line-based precision.

When should I use Code Transfer?

Code Transfer fits situations like: users request copying code from one location to another; moving functions; classes between files; extracting code blocks.

How do I install Code Transfer in Claude Code?

Run `npx skills add mhattingpete/claude-skills-marketplace --skill code-transfer -a claude-code`. Or copy the skill folder (code-operations-plugin/skills/code-transfer in mhattingpete/claude-skills-marketplace) into .claude/skills/code-transfer in your project. Claude Code loads it when a task matches its description.

How do I install Code Transfer in Codex?

Run `npx skills add mhattingpete/claude-skills-marketplace --skill code-transfer -a codex`. Or copy the skill folder (code-operations-plugin/skills/code-transfer in mhattingpete/claude-skills-marketplace) into .agents/skills/code-transfer in your project. Codex loads it when a task matches its description.

Can I use Code Transfer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mhattingpete/claude-skills-marketplace --skill code-transfer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-transfer, .gemini/skills/code-transfer, .github/skills/code-transfer and .opencode/skills/code-transfer in your project.

What does Code Transfer need to run?

Going by SKILL.md and its folder, Code Transfer needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Code Transfer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Code Transfer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Code Transfer use?

Code Transfer is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Transfer use?

About 1k tokens (SKILL.md is roughly 4.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Code Transfer?

Skills that share tags, products or a category with Code Transfer: Intelligence Transfer (ruvnet/ruflo, 74k stars), Mixed Precision (aiming-lab/AutoResearchClaw, 15k stars), Performing DNS Enumeration And Zone Transfer (mukul975/Anthropic-Cybersecurity-Skills, 34k stars) and MoviePilot Failed Transfer Retry (jxxghp/MoviePilot, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Transfer?

mhattingpete (a GitHub user) maintains it in mhattingpete/claude-skills-marketplace, which has 680 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on July 25, 2026.

Source: mhattingpete/claude-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.