file-to-base64

file-to-base64 is a skill for Claude Code, Codex from WavingCatApps/freeagent-mcp-vercel. It costs 49 tokens per session (1,473 once invoked), scanned A, original, MIT.

A skill for converting files such as PDFs and images into Base64 text with their MIME type, which identifies the file format for an API. It is intended for file attachments.

In plain words
What is it for?
Use it to prepare PDF, image, and other common file attachments for APIs such as FreeAgent, while checking their format and size.
Why use it?
Some APIs require files to be encoded as text before upload and need the correct format label. This removes that preparation work.

Skill for Claude CodeCodex

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

Good fit Use it to prepare PDF, image, and other common file attachments for APIs such as FreeAgent, while checking their format and size.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wavingcatapps/freeagent-mcp-vercel/file-to-base64
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 WavingCatApps/freeagent-mcp-vercel --skill file-to-base64
Clone the repo
git clone --depth 1 https://github.com/WavingCatApps/freeagent-mcp-vercel

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-to-base64

README.md
[![agentmods](https://agentmods.dev/badge/skills/wavingcatapps/freeagent-mcp-vercel/file-to-base64/github.svg)](https://agentmods.dev/skills/wavingcatapps/freeagent-mcp-vercel/file-to-base64)
Your own site
<a href="https://agentmods.dev/skills/wavingcatapps/freeagent-mcp-vercel/file-to-base64"><img src="https://agentmods.dev/badge/skills/wavingcatapps/freeagent-mcp-vercel/file-to-base64/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-to-base64

Your own site · 80×15
<a href="https://agentmods.dev/skills/wavingcatapps/freeagent-mcp-vercel/file-to-base64"><img src="https://agentmods.dev/badge/skills/wavingcatapps/freeagent-mcp-vercel/file-to-base64.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,473 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.00049 $0.01473
Opus 5 $0.00024 $0.00737
Sonnet 5 $0.00010 $0.00295
Haiku 4.5 $0.00005 $0.00147

Measured 11d ago against content hash 3c8801f62b85, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

file-to-base64 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 11d 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.

skills/file-to-base64/SKILL.md · 212 lines

How it starts

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

File to Base64 Converter

This skill converts files to Base64-encoded strings and detects their MIME types, which is essential for attaching files to FreeAgent expenses, timeslips, and other API operations that require file uploads.

When to Use This Skill

Use this skill when:

  • Preparing attachments for FreeAgent API calls (expenses, timeslips)
  • Converting PDFs or images to Base64 format
  • Detecting MIME types for file uploads
  • Validating file formats and sizes for API requirements

Supported File Formats

FreeAgent Supported Formats

  • PDF (.pdf) - application/pdf
  • PNG (.png) - image/png
  • JPEG (.jpg, .jpeg) - image/jpeg
  • GIF (.gif) - image/gif

Additional Common Formats (for reference)

  • Text files (.txt) - text/plain
  • Word documents (.doc, .docx)
  • Excel files (.xls, .xlsx)

File Size Limits

  • FreeAgent API: Maximum 5MB per file

How to Use

1. Convert a Single File

# Read the file and convert to Base64
base64 /path/to/file.pdf

# Get MIME type from extension
# For .pdf -> application/pdf
# For .png -> image/png
# For .jpg/.jpeg -> image/jpeg
# For .gif -> image/gif

2. Check File Size

# Check file size in bytes
stat -f%z /path/to/file.pdf  # macOS
stat -c%s /path/to/file.pdf  # Linux

# Convert to MB for comparison
# 5MB = 5242880 bytes

3. Validate File Before Conversion

# Check if file exists and is readable
test -r /path/to/file.pdf && echo "File is readable" || echo "Cannot read file"

# Get file extension
basename /path/to/file.pdf | sed 's/.*\.//'

Example Workflow

Prepare an Attachment for FreeAgent Expense

# 1. Validate file exists
FILE_PATH="/path/to/receipt.pdf"
test -f "$FILE_PATH" || exit 1

# 2. Check file size (must be < 5MB = 5242880 bytes)
FILE_SIZE=$(stat -f%z "$FILE_PATH")
if [ $FILE_SIZE -gt 5242880 ]; then
  echo "Error: File size exceeds 5MB limit"
  exit 1
fi

# 3. Get filename
FILE_NAME=$(basename "$FILE_PATH")

# 4. Determine MIME type from extension
EXT="${FILE_PATH##*.}"
case "$EXT" in
  pdf) MIME_TYPE="application/pdf" ;;
  png) MIME_TYPE="image/png" ;;
  jpg|jpeg) MIME_TYPE="image/jpeg" ;;
  gif) MIME_TYPE="image/gif" ;;
  *) echo "Unsupported format"; exit 1 ;;
esac

# 5. Convert to Base64
BASE64_DATA=$(base64 "$FILE_PATH")

# 6. Output in format ready for API
echo "Attachment prepared:"
echo "- file_name: $FILE_NAME"
echo "- content_type: $MIME_TYPE"
echo "- data: [Base64 string - ${#BASE64_DATA} characters]"

Read the full file on GitHub · 212 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. 11d ago First seen · 212 lines · 49 tokens per session scan A 3c8801f62b85

Subscribe to this mod's changes

file-to-base64 is a skill published in the GitHub repository WavingCatApps/freeagent-mcp-vercel (10 stars, last pushed 4d ago), licensed MIT. It adds 49 tokens to every session and 1,473 once invoked, about $0.0002 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-08-31.

Related

Other skills, from other repositories