python-large-file-patch-{{AGENT_NAME_LOWER}}

python-large-file-patch-{{AGENT_NAME_LOWER}} is a skill for Claude Code, Codex from humanerd-drew/opencode-drewgent. It costs 89 tokens per session (1,380 once invoked), scanned A, original, MIT.

A procedure for editing very large Python files when the same agent code exists in both a runtime copy and a source copy. It explains how to find the live file, patch it, and keep both copies synchronized.

In plain words
What is it for?
Patching large Python files such as conversation runners, signal processors, and gateway code while keeping development and runtime copies aligned.
Why use it?
Changing only the source or only the runtime copy can make the fix appear to have no effect. The procedure prevents those two versions from drifting apart.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Patching large Python files such as conversation runners, signal processors, and gateway code while keeping development and runtime copies aligned.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/humanerd-drew/opencode-drewgent/python-large-file-patch-drewgent
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add humanerd-drew/opencode-drewgent --skill python-large-file-patch-drewgent
Clone the repo
git clone --depth 1 https://github.com/humanerd-drew/opencode-drewgent

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for python-large-file-patch-{{AGENT_NAME_LOWER}}

README.md
[![agentmods](https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/python-large-file-patch-drewgent.svg)](https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/python-large-file-patch-drewgent)
Your own site
<a href="https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/python-large-file-patch-drewgent"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/python-large-file-patch-drewgent.svg" alt="Measured on agentmods" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,380 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00089 $0.01380
Opus 5 $0.00044 $0.00690
Sonnet 5 $0.00018 $0.00276
Haiku 4.5 $0.00009 $0.00138

Measured 4d ago against content hash d4e518cd7fad, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

python-large-file-patch-{{AGENT_NAME_LOWER}} scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/software-development/python-large-file-patch-drewgent/SKILL.md · 119 lines

How it starts

The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: Patching Large Python Files in {{AGENT_NAME}}

When to Use

When you need to edit a specific function or code block inside a large Python file (500+ lines) in the {{AGENT_NAME}} codebase (signal_processor.py, run_agent.py, gateway/run.py, etc.), and direct patch fails due to text pattern mismatch.

The Problem

patch relies on exact string matching. Large files with complex docstrings (especially with newlines and special characters) often don't match what you expect from reading partial snippets. You get "old_string not found" even when the function exists.

CRITICAL: Dual-File Layout (Runtime vs Source)

{{AGENT_NAME}} has two copies of the agent code:

Copy Path Purpose
Runtime ~/.{{AGENT_NAME_LOWER}}/agent/ What Python actually imports at runtime
Source ~/.{{AGENT_NAME_LOWER}}/source/{{AGENT_NAME_LOWER}}-agent/agent/ Git-tracked development copy

When you patched a file in the source/ copy but nothing changed, it's because Python loaded from ~/.{{AGENT_NAME_LOWER}}/agent/ instead. The two copies can and do diverge.

Patching Protocol

  1. Identify which copy is live before editing:

    python3 -c "import module_name; print(module_name.__file__)"
    
  2. Patch the runtime copy first (~/.{{AGENT_NAME_LOWER}}/agent/...) — that's where the effect is immediate.

  3. Sync the source copy after the fix to keep them aligned:

    cp ~/.{{AGENT_NAME_LOWER}}/agent/patched_file.py ~/.{{AGENT_NAME_LOWER}}/source/{{AGENT_NAME_LOWER}}-agent/agent/patched_file.py
    
  4. Verify with an import and test call before declaring done.

Solution: Python Patch Script with Diagnostic Output

When patch fails, use execute_code to:

  1. First read the file and locate the exact text with in operator
  2. Print diagnostics so you know exactly what to match
  3. Apply with content.replace(old, new, 1) — the 1 limit prevents accidental multi-match
  4. Write back and verify

Read the full file on GitHub · 119 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 119 lines · 89 tokens per session scan A d4e518cd7fad

Subscribe to this mod's changes

python-large-file-patch-{{AGENT_NAME_LOWER}} is a skill published in the GitHub repository humanerd-drew/opencode-drewgent (2 stars, last pushed 1mo ago), licensed MIT. It adds 89 tokens to every session and 1,380 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

python-code-quality

Code quality checks, linting, formatting, and type checking commands for the Agent Framework Python codebase. Use this when running checks, fixing lint errors, or troubleshooting CI failures.

microsoft/agent-framework · 40 tokens

plugin-architecture-patterns

Design, implement, or diagnose Xberg plugin traits, typed registries, priority collisions, lifecycle, native extractors, and Alef-generated Python plugin bridges. Load for plugin-system work, not ordinary extractor parsing.

xberg-io/xberg · 49 tokens

test-corpus

The testdocuments submodule is a bucket-fetched fixture corpus that is not committed. This skill covers readtestfixture, missing fixtures, valid A/B controls, and submodule push order. Load before running Rust tests on a fresh clone, setting up an A/B control, adding a fixture-backed test, or diagnosing…

xberg-io/xberg · 72 tokens

idapython

IDA Pro Python scripting for reverse engineering. Use when writing IDAPython scripts, analyzing binaries, working with IDA's API for disassembly, decompilation (Hex-Rays), type systems, cross-references, functions, segments, or any IDA database manipulation. Covers ida modules (50+), idautils iterators, and common…

mrexodia/ida-pro-mcp · 77 tokens

stack-trace-python-probe

Internal helper for meta-stack-trace-investigator. Use when a Python traceback needs Python-specific root-cause checks, pytest reproducer guidance, and defensive patch targets.

opensquilla/opensquilla · 40 tokens

python-debug-execution-911f17

Debug Python script execution failures by capturing full tracebacks and verifying working directory.

HKUDS/OpenSpace · 23 tokens