code-transfer
Transfer code between files with line-based precision.
Skill by mhattingpete
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mhattingpete-code-transfer
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/code-transfer
What's inside
- Skill 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.
- License
- Apache-2.0
- Instructions
- 135 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (2)
- SKILL.md
- line_insert.py · scripts/
SKILL.md (first lines)
# 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 placementFrom mhattingpete/claude-skills-marketplace, Apache-2.0.
More from mhattingpete/claude-skills-marketplace
- 0.640score
dashboard-creator
mhattingpete
Create HTML dashboards with KPI metric cards, bar/pie/line charts, progress indicators, and data visualizations.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
flowchart-creator
mhattingpete
Create HTML flowcharts and process diagrams with decision trees, color-coded stages, arrows, and swimlanes.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
technical-doc-creator
mhattingpete
Create HTML technical documentation with code blocks, API workflows, system architecture diagrams, and syntax highlighting.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
timeline-creator
mhattingpete
Create HTML timelines and project roadmaps with Gantt charts, milestones, phase groupings, and progress indicators.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
architecture-diagram-creator
mhattingpete
Create comprehensive HTML architecture diagrams showing data flows, business objectives, features, technical architecture, and deployment.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
feature-planning
mhattingpete
Break down feature requests into detailed, implementable plans with clear tasks.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
git-pushing
mhattingpete
Stage, commit, and push git changes with conventional commit messages.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
conversation-analyzer
mhattingpete
Analyzes your Claude Code conversation history to identify patterns, common mistakes, and opportunities for workflow improvement.
SkillDFreshness: D★ 688Claude Code +9 - 0.637score
ensemble-solving
mhattingpete
Generate multiple diverse solutions in parallel and select the best.
SkillDFreshness: D★ 688Claude Code +9 - 0.634score
project-bootstrapper
mhattingpete
Sets up new projects or improves existing projects with development best practices, tooling, documentation, and workflow automation.
SkillDFreshness: D★ 688Claude Code +9 - 0.634score
code-execution
mhattingpete
Execute Python code locally with marketplace API access for 90%+ token savings on bulk operations.
SkillDFreshness: D★ 688Claude Code +9 - 0.634score
code-refactor
mhattingpete
Perform bulk code refactoring operations like renaming variables/functions across files, replacing patterns, and updating API calls.
SkillDFreshness: D★ 688Claude Code +9
Signals
- Stars
- 688
- Forks
- 98
- Open issues
- 4
- Last commit (this folder)
- Nov 10, 2025 (11 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from mhattingpete
- 0.640score
dashboard-creator
mhattingpete
Create HTML dashboards with KPI metric cards, bar/pie/line charts, progress indicators, and data visualizations.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
architecture-diagram-creator
mhattingpete
Create comprehensive HTML architecture diagrams showing data flows, business objectives, features, technical architecture, and deployment.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
git-pushing
mhattingpete
Stage, commit, and push git changes with conventional commit messages.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
conversation-analyzer
mhattingpete
Analyzes your Claude Code conversation history to identify patterns, common mistakes, and opportunities for workflow improvement.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
feature-planning
mhattingpete
Break down feature requests into detailed, implementable plans with clear tasks.
SkillDFreshness: D★ 688Claude Code +9 - 0.640score
flowchart-creator
mhattingpete
Create HTML flowcharts and process diagrams with decision trees, color-coded stages, arrows, and swimlanes.
SkillDFreshness: D★ 688Claude Code +9
Cite this page
code-transfer skill. Agent Mart. https://agentmart.dev/skills/mhattingpete-code-transfer (last updated 2026-10-24)