attachments

attachments is a skill for Claude Code, Codex from MaximeRivest/attachments. It costs 137 tokens per session (3,437 once invoked), scanned A, original, MIT.

A Python library workflow for turning files, folders, URLs, archives, and repositories into text and media that a language model can read. It supports sources such as PDF, Word, Excel, PowerPoint, CSV, HTML, notebooks, images, and audio.

In plain words
What is it for?
Use it to load attachments for model analysis, including extracting text, images, audio, video, and metadata.
Why use it?
It avoids writing a separate importer for every file type and helps expose document contents in a consistent artifact structure.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it to load attachments for model analysis, including extracting text, images, audio, video, and metadata.

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

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 attachments

README.md
[![agentmods](https://agentmods.dev/badge/skills/maximerivest/attachments/skill/github.svg)](https://agentmods.dev/skills/maximerivest/attachments/skill)
Your own site
<a href="https://agentmods.dev/skills/maximerivest/attachments/skill"><img src="https://agentmods.dev/badge/skills/maximerivest/attachments/skill/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 attachments

Your own site · 80×15
<a href="https://agentmods.dev/skills/maximerivest/attachments/skill"><img src="https://agentmods.dev/badge/skills/maximerivest/attachments/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,437 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.00137 $0.03437
Opus 5.5 $0.00055 $0.01375
Sonnet 5.5 $0.00027 $0.00687
Haiku 4.5 $0.00014 $0.00344

Measured 5d ago against content hash 06d7852dcf82, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

attachments 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 5d 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.

src/attachments/skill/SKILL.md · 258 lines

How it starts

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

Attachments 1.0: any file to text and images for a model

att("report.pdf") reads almost anything and returns Artifacts: a list of plain dicts, one per file, each {text, images, audio, video, meta}. Most of the library is that one call; this page covers what goes wrong around it. All option names: options.md next to this file (generated from the code).

1. Make sure it is 1.0 (check before writing code)

python -c "import attachments as a; print(a.__version__, hasattr(a, 'att'))"
  • False, or no module: install 1.0 (a project pinned below it still has 0.25, the old API):

    uv add "attachments[pdf,image]>=1.0"
    pip install "attachments[pdf,image]>=1.0"
    

    A local checkout: uv add --editable /path/to/attachments.

  • Never write 0.25 code, which models remember: Attachments("f.pdf"), attach(...) | load.x | present.y, ctx.images as base64 strings, [format: ...], adapt.claude(...).

  • Extras: pdf, image, docx, xlsx, pptx, html, all-local; ocr and audio are large; browser (web page screenshots) also needs playwright install chromium. The core has no dependencies and reads text, code, CSV and JSON. A missing extra raises nothing: that file comes back with error code missing-dependency and the exact pip install command. Pictures you ask for that cannot be drawn here (no LibreOffice, Chromium, PyMuPDF or cairosvg) never cost the text: the file is read, and a warning in meta["warnings"] names what is missing.

2. The one call

from attachments import att

a = att("report.pdf[pages: 2-4, images: true]")  # options in [...]
a = att("report.pdf", pages="2-4", images=True)  # the same, as keywords
a = att("docs/")                                 # a folder (recursive); also .zip, .tar
a = att("scans/*.pdf")                           # a wildcard (anywhere: "*/a.md")
a = att("https://example.com/paper.pdf")         # a URL
a = att("github://owner/repo[ref: main]")        # a repository
a = att(["report.pdf", "chart.png"])             # several inputs (str or Path)

Read the full file on GitHub · 258 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago Changed · +10 lines · -4 tokens per session 06d7852dcf82
  2. 8d ago Changed · +1 lines 110a2d653c3f
  3. 9d ago Changed · +5 lines c732a9c07c09
  4. 10d ago Changed · +12 lines e643e83eb0f0
  5. 11d ago First seen · 230 lines · 141 tokens per session scan A a7bf6a67e8b3

Subscribe to this mod's changes

attachments is a skill published in the GitHub repository MaximeRivest/attachments (367 stars, last pushed 6d ago), licensed MIT. It adds 137 tokens to every session and 3,437 once invoked, about $0.0005 per session on Opus 5.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-10-08.

Related

Other skills, from other repositories

doc-reader

Read any common document/data file — PDF, Word (.docx), Excel (.xlsx/.xls), PowerPoint (.pptx), images (OCR), CSV/TSV, plain text, JSON/YAML/TOML, HTML/XML, and most source-code files. Use the readdocument tool.

HKUDS/Vibe-Trading · 65 tokens

surfsense-documents

Make or change a Word document (.docx), a PDF, a PowerPoint deck (.pptx) or an Excel workbook (.xlsx) by writing a Python script that surfsenserenderdocument runs, optionally starting from a source's own Word or PowerPoint file. Load it whenever the user asks for one of these, or for a change to one you made.

MODSetter/SurfSense · 80 tokens

xberg-extracting-tables

Use when extracting tabular data from PDFs, spreadsheets, or images. Covers layout-aware table detection, table model selection, output formats (markdown / JSON cells), and known limits.

xberg-io/xberg · 36 tokens

skill-doc-delivery

Convert markdown to DOCX, PPTX, XLSX, PDF office documents — use when you need exportable deliverables.

nyldn/claude-octopus · 29 tokens

report-generator

A report-generation tool for producing SEO and GEO analysis reports in formats such as Markdown, HTML, PDF, JSON, and Excel. It also supports charts, templates, data processing, and interactive report elements.

foryourhealth111-pixel/Vibe-Skills · 24 tokens

kordoc

A command-line and server tool for reading and creating Korean official documents, including HWP, HWPX, PDF, DOCX, and spreadsheet files. It can convert documents to Markdown and create or update HWPX files.

chrisryugj/kordoc · 253 tokens