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.
npx skills add humanerd-drew/opencode-drewgent --skill python-large-file-patch-drewgentgit clone --depth 1 https://github.com/humanerd-drew/opencode-drewgentWrote 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.
[](https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/python-large-file-patch-drewgent)<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>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.
| Model | Per session | Once 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 |
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.
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
-
Identify which copy is live before editing:
python3 -c "import module_name; print(module_name.__file__)" -
Patch the runtime copy first (
~/.{{AGENT_NAME_LOWER}}/agent/...) — that's where the effect is immediate. -
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 -
Verify with an import and test call before declaring done.
Solution: Python Patch Script with Diagnostic Output
When patch fails, use execute_code to:
- First read the file and locate the exact text with
inoperator - Print diagnostics so you know exactly what to match
- Apply with
content.replace(old, new, 1)— the1limit prevents accidental multi-match - Write back and verify
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.
- 4d ago First seen · 119 lines · 89 tokens per session scan A d4e518cd7fad
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.
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.
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.
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…
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…
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.
python-debug-execution-911f17
Debug Python script execution failures by capturing full tracebacks and verifying working directory.