python-heredoc

python-heredoc is a skill for Claude Code, Codex from crypdick/pynchy. It costs 43 tokens per session (306 once invoked), scanned A, original, MIT.

A shell-use guide for running multi-line Python code with a quoted heredoc, a block of text passed directly to a command. It also specifies using Pynchy's uv-based Python command.

In plain words
What is it for?
Running longer Python snippets or snippets with complex quoting from Bash, including code that needs additional dependencies.
Why use it?
It prevents shell quoting problems when Python contains quotes, apostrophes, f-strings, or multiple statements.

Skill for Claude CodeCodex

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

Good fit Running longer Python snippets or snippets with complex quoting from Bash, including code that needs additional dependencies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/crypdick/pynchy/python-heredoc
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 crypdick/pynchy --skill python-heredoc
Clone the repo
git clone --depth 1 https://github.com/crypdick/pynchy

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-heredoc

README.md
[![agentmods](https://agentmods.dev/badge/skills/crypdick/pynchy/python-heredoc/github.svg)](https://agentmods.dev/skills/crypdick/pynchy/python-heredoc)
Your own site
<a href="https://agentmods.dev/skills/crypdick/pynchy/python-heredoc"><img src="https://agentmods.dev/badge/skills/crypdick/pynchy/python-heredoc/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-heredoc

Your own site · 80×15
<a href="https://agentmods.dev/skills/crypdick/pynchy/python-heredoc"><img src="https://agentmods.dev/badge/skills/crypdick/pynchy/python-heredoc.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 306 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 3
    Subtle instructions detected that may alter agent decision-making or introduce hidden biases.
    Fix: Review content for implicit steering or bias. Ensure instructions are explicit and align with the skill's stated purpose.
  • medium Data Exfiltration · line 30
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
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.00043 $0.00306
Opus 5.5 $0.00017 $0.00122
Sonnet 5.5 $0.00009 $0.00061
Haiku 4.5 $0.00004 $0.00031

Measured 1mo ago against content hash 0a9121fdeefc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-heredoc scanned grade A with 1 finding 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 1mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

resp = requests.get("https://api.example.com/data")
data/defaults/skills/python-heredoc/SKILL.md · 41 lines

What it actually says

Python Heredoc Pattern

Run Python via Bash? Never python -c "..." beyond trivial one-liners. Shell quoting break on f-strings, apostrophes, nested quotes, escape sequences.

Use heredoc syntax instead

uv run python << 'PYTHON_CODE'
import json

data = {"name": "it's working", "value": f"{1 + 2}"}
print(json.dumps(data, indent=2))
PYTHON_CODE

Single quotes round 'PYTHON_CODE' block shell var expansion. $variables and backticks stay literal Python.

With dependencies

uv run --with requests python << 'PYTHON_CODE'
import requests

resp = requests.get("https://api.example.com/data")
print(resp.json())
PYTHON_CODE

Rules

  1. Always uv run python (not bare python or python3)
  2. Always quote delimiter: << 'PYTHON_CODE' (not << PYTHON_CODE)
  3. Closing PYTHON_CODE own line, no leading whitespace
  4. Never python -c for code with quotes, f-strings, multiple statements
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. 1mo ago First seen · 41 lines · 43 tokens per session scan A 0a9121fdeefc

Subscribe to this mod's changes

python-heredoc is a skill published in the GitHub repository crypdick/pynchy (10 stars, last pushed 1mo ago), licensed MIT. It adds 43 tokens to every session and 306 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

astropy

Core Python library for astronomy and astrophysics workflows that need Astropy APIs, including units/quantities, coordinates, FITS I/O, tables, time systems, WCS, and cosmology. Use when implementing or debugging astronomical data analysis code with Astropy.

K-Dense-AI/scientific-agent-skills · 56 tokens

matlab

Builds, reviews, migrates, and plans MATLAB or GNU Octave numerical workflows. Use for arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 44 tokens

optimize-for-gpu

GPU-accelerates scientific Python on NVIDIA hardware and verifies that the result is correct and faster. Use for CUDA/GPU optimization; CPU-bound NumPy, SciPy, pandas, scikit-learn, NetworkX, scikit-image, vector-search, image-processing, graph, simulation, or file-I/O workloads; CuPy, cuDF, cuML, cuGraph, cuVS…

K-Dense-AI/scientific-agent-skills · 151 tokens

polars

High-performance DataFrame library for Python ETL, analytics, and pandas migration. It supports expression-based data manipulation with lazy query optimization, parallel execution, streaming out-of-core processing, Arrow interoperability, and optional GPU execution.

K-Dense-AI/scientific-agent-skills · 47 tokens

bioservices

Provides a Python interface to bioinformatics services including UniProt, KEGG, ChEMBL, Reactome, QuickGO, and UniChem. Used for cross-database protein annotation, pathway retrieval, chemical identifier mapping, and integrated biological data workflows with BioServices.

K-Dense-AI/scientific-agent-skills · 56 tokens

cobrapy

Performs constraint-based metabolic modeling with COBRApy, including FBA, pFBA, FVA, gene knockouts, flux sampling, growth media, production envelopes, gap filling, and SBML model validation for systems biology and metabolic engineering.

K-Dense-AI/scientific-agent-skills · 55 tokens