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 3mo 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 3mo 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. 3mo 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 2mo 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

python-heredoc compared with skills from other repositories

python-heredoc next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
python-heredoccrypdick/pynchySkill102mo agoMITA43Claude Code, Codex
optimize-for-gpuK-Dense-AI/scientific-agent-skillsSkill60k5d agoMITA151Claude Code, Codex
astropyK-Dense-AI/scientific-agent-skillsSkill60k5d agoMITA56Claude Code, Codex
matlabK-Dense-AI/scientific-agent-skillsSkill60k5d agoMITA44Claude Code
polarsK-Dense-AI/scientific-agent-skillsSkill60k5d agoMITA47Claude Code
bioservicesK-Dense-AI/scientific-agent-skillsSkill60k5d agoMITA56Claude Code
cobrapyK-Dense-AI/scientific-agent-skillsSkill60k5d agoMITA55Claude Code