file-uploads

file-uploads is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 93 tokens per session (1,525 once invoked), scanned A, original, Apache-2.0.

A method for safely accepting and serving files such as images, documents, CSV files, and attachments. It treats uploaded files as untrusted data and checks their size and real content before storing them.

In plain words
What is it for?
Use it for upload and download endpoints, avatars, document attachments, CSV or spreadsheet imports, object storage, file limits, content checks, and safe response headers.
Why use it?
It reduces risks from oversized, malicious, wrongly labelled, or executable files. It also avoids trusting client-provided names and keeps stored files out of places where they could run as web content.

Skill for Claude CodeCodex

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

Good fit Use it for upload and download endpoints, avatars, document attachments, CSV or spreadsheet imports, object storage, file limits, content checks, and safe response headers.

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

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 file-uploads

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/file-uploads"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/file-uploads.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,525 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.00093 $0.01525
Opus 5.5 $0.00037 $0.00610
Sonnet 5.5 $0.00019 $0.00305
Haiku 4.5 $0.00009 $0.00153

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

Security

Grade A, and why

file-uploads 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 16d 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.

runner/skills/file-uploads/SKILL.md · 98 lines

How it starts

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

Handle file uploads and downloads safely

An upload is untrusted input that is large, binary, and often stored for years. Limit it before you read it, verify what it really is, write it under a name you chose, atomically, in a place that cannot execute, and serve it back with headers that stop the browser guessing. Source: OWASP File Upload Cheat Sheet; OWASP ASVS 5 V5 (file handling).

Steps

  1. Use the repo's storage and upload path. Object storage with presigned URLs, a local store behind an abstraction, or existing multipart middleware. Call search_lore for bucket layout, key naming and size limits. Do not add a second storage mechanism.
  2. Authorise and limit before reading. Check the caller may upload here (the security-authz skill) and that the form is CSRF-protected if cookie-authenticated. Enforce a maximum body size at the edge (proxy and framework), a maximum part count, and a request timeout; reject with 413 without buffering. Stream to storage; never hold a whole file in memory. For presigned uploads, sign the exact key, Content-Type and size limit (a content-length-range POST-policy condition, or a signed Content-Length for PUT), with a short expiry.
  3. Validate content, not labels. Allow-list extensions (after normalising case and rejecting double extensions like x.jpg.php, NUL bytes and :), check the declared Content-Type against the allow-list, then detect the real type from the bytes (magic numbers) and reject any mismatch. None of these alone is sufficient.
  4. Defuse the dangerous formats. Images: cap pixel dimensions before decoding (decompression bombs), then decode and re-encode to strip metadata and payloads. Archives: cap total uncompressed size and entry count, and reject entries whose resolved path escapes the target directory (zip slip). SVG, HTML and XML are active content: refuse them, sanitise them, or serve them only as attachments; parse XML with external entities disabled (XXE). CSV/XLSX imports: cap rows and cell size, treat every cell as untrusted text, and on export prefix cells starting with =, +, -, @, tab or CR with ' (formula injection).
  5. Generate the storage key; never trust the filename. Key = random id (UUID) plus an extension derived from the detected type. Keep the original name only as sanitised display metadata (length-capped, no path separators, no leading dot).
  6. Write atomically and collision-free. Concurrent uploads are normal. Write to a unique temporary key (random suffix, never a timestamp or the user's name), then rename/commit to the final key; object storage PUT is already atomic per key. Insert the metadata row in the same transaction that marks the file available, or use a pending → available status so a half-written file is never served. Replacing a file (a new avatar) writes a new key and swaps the pointer with a conditional update (WHERE version = ?); it never overwrites bytes in place. Orphaned temp objects are swept by a job (the scheduled-jobs skill).
  7. Store where nothing executes. Object storage or a directory outside the web root, no execute permission, no per-directory config overrides; private by default and access-checked on every read.
  8. Serve safely. Presigned GET with a short expiry, or an authenticated route that sets Content-Disposition: attachment for anything not meant to render inline, the stored detected Content-Type, X-Content-Type-Options: nosniff, and ideally a separate cookieless origin with a restrictive CSP (default-src 'none') so a malicious file cannot run in the app's origin.
  9. Scan and quarantine where the repo requires it (malware scan, CDR, moderation) asynchronously through a job (the background-jobs skill); the file stays unavailable until cleared.

Read the full file on GitHub · 98 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. 16d ago Changed · +30 lines 850f7782593a
  2. 19d ago First seen · 68 lines · 93 tokens per session scan A ff99f02a511e

Subscribe to this mod's changes

file-uploads is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 93 tokens to every session and 1,525 once invoked, about $0.0004 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-09-28.

Related

Other skills, from other repositories

bulwark-brainstorm

Role-based brainstorming with dual modes: --scoped (sequential Task tool, 5 roles) and --exploratory (Agent Teams peer debate, 4 roles). Use for feasibility assessment and idea validation.

QBall-Inc/the-bulwark · 50 tokens

plan-creation

Create structured implementation plans via a 4-role scrum team (Product Owner, Architect, Eng/Delivery Lead, QA/Critic) with optional Agent Teams peer debate mode.

QBall-Inc/the-bulwark · 38 tokens

anthropic-validator

Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.

QBall-Inc/the-bulwark · 40 tokens

create-subagent

Generates single-purpose Claude Code sub-agents for use via the Task tool. Use when creating dedicated sub-agents, scaffolding agent definitions, or generating agents with diagnostics and permissions setup.

QBall-Inc/the-bulwark · 42 tokens

test-audit

Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.

QBall-Inc/the-bulwark · 0 tokens

code-review

Comprehensive code review with distinct aspect based sections. Use when reviewing code, checking for security issues, finding type safety problems, auditing code quality, or when user asks to review code, PRs or changes. Three-phase workflow runs static tools, LLM judgment, and writes diagnostic log.

QBall-Inc/the-bulwark · 61 tokens