File Download

File Download is a skill for Claude Code, Codex from agent0ai/space-agent. It costs 22 tokens per session (914 once invoked), scanned A, original, MIT.

A browser-download procedure for files stored in an app, generated while the app runs, or hosted at an external URL. It builds authenticated URLs so the server can enforce access permissions.

In plain words
What is it for?
Use it to add download buttons for app files, generated content, or external files.
Why use it?
It gives users a way to save files while preserving the app's login and file-access checks.

Skill for Claude CodeCodex

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

Good fit Use it to add download buttons for app files, generated content, or external files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agent0ai/space-agent/file-download
About the project

Space Agent is a browser-based agent workspace that can build pages, tools, widgets, and workflows directly into the running interface. It is for users who want an extensible personal or collaborative assistant whose capabilities can grow through modular pieces and text-based skills. Catalogue add-ons extend the agent's skills and workflows.

agent0ai/space-agent · 1,393 stars · on GitHub

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 agent0ai/space-agent --skill file-download
Clone the repo
git clone --depth 1 https://github.com/agent0ai/space-agent

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 Download

README.md
[![agentmods](https://agentmods.dev/badge/skills/agent0ai/space-agent/file-download.svg)](https://agentmods.dev/skills/agent0ai/space-agent/file-download)
Your own site
<a href="https://agentmods.dev/skills/agent0ai/space-agent/file-download"><img src="https://agentmods.dev/badge/skills/agent0ai/space-agent/file-download.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 914 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 pass 7 Sept 2026
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.00022 $0.00914
Opus 5 $0.00011 $0.00457
Sonnet 5 $0.00004 $0.00183
Haiku 4.5 $0.00002 $0.00091

Measured 8d ago against content hash 83fafc60276a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

File Download 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 8d 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.

If the external URL is public and CORS allows direct access from the browser, you can skip the proxy and fetch it directly with `fetch(externalUrl)` and the same Blob pattern above.
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

app/L0/_all/mod/_core/admin/ext/skills/file-download/SKILL.md · 112 lines

How it starts

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

Use this skill when the user asks how to let the browser download a file — whether it lives in the app filesystem, is generated at runtime, or comes from an external URL.

Downloading App Filesystem Files

The server serves authenticated files directly at their layer paths. Use a URL built from location.href so the request carries the session cookie and the server enforces read permissions.

From the authenticated user's home folder (~/)

/~/... maps to L2/<username>/... for the currently logged-in user.

const u = new URL(location.href);
u.pathname = '/~/BTC_ETH_ratio_chart.pdf';
const a = document.createElement('a');
a.href = u.toString();
a.download = 'BTC_ETH_ratio_chart.pdf';
a.click();

From a specific layer path (/L0/, /L1/, /L2/)

Use the full layer path directly. The server checks that the authenticated user has read access before serving.

function downloadAppFile(layerPath, filename) {
  // layerPath example: 'L0/_all/mod/_core/reports/template.pdf'
  const u = new URL(location.href);
  u.pathname = `/${layerPath}`;
  const a = document.createElement('a');
  a.href = u.toString();
  a.download = filename;
  a.click();
}

// Examples:
downloadAppFile('L0/_all/mod/_core/reports/template.pdf', 'template.pdf');
downloadAppFile('L2/alice/exports/summary.csv', 'summary.csv');

Read permissions follow the same rules as the file APIs:

  • L2/<username>/ — own files only
  • L0/<group>/ and L1/<group>/ — group members only
  • Unauthenticated requests return 401; unauthorized paths return 403

Downloading Runtime-Generated In-Memory Content

For files generated on the fly (CSV exports, JSON dumps, dynamically built text), create a Blob, make an object URL, and revoke it after the click.

function downloadBlob(content, filename, mimeType = 'text/plain') {
  const blob = new Blob([content], { type: mimeType });
  const url = URL.createObjectURL(blob);
  const a = document.createElement('a');
  a.href = url;
  a.download = filename;
  a.click();
  URL.revokeObjectURL(url);
}

// Plain text
downloadBlob('hello world', 'note.txt', 'text/plain');

// CSV
const csv = 'name,value\nalice,42\nbob,17';
downloadBlob(csv, 'data.csv', 'text/csv');

// JSON
const json = JSON.stringify({ status: 'ok', items: [1, 2, 3] }, null, 2);
downloadBlob(json, 'result.json', 'application/json');

// Binary data from a Uint8Array or ArrayBuffer
const bytes = new Uint8Array([0x25, 0x50, 0x44, 0x46]); // %PDF header
downloadBlob(bytes, 'output.pdf', 'application/pdf');

Read the full file on GitHub · 112 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. 8d ago First seen · 112 lines · 22 tokens per session scan A 83fafc60276a

Subscribe to this mod's changes

File Download is a skill published in the GitHub repository agent0ai/space-agent (1,393 stars, last pushed 3mo ago), licensed MIT. It adds 22 tokens to every session and 914 once invoked, about $0.0001 per session on Opus 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-30.

Related

Other skills, from other repositories

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-dev-loop

Verify Next.js runtime behavior after editing app code. Use this skill to confirm a change actually works in a running app — not just that it compiles or type-checks. Combines /next/mcp (Next.js's view) with agent-browser (the browser's view). Requires a running next dev.

vercel/next.js · 68 tokens

playwright-component-testing

Set up component testing with Playwright using a story gallery — scaffold stories and a gallery dev page driven by the built-in mount fixture, no dedicated component-testing runtime. Use when asked to test React or Vue components in isolation with Playwright, or to migrate off @playwright/experimental-ct-react / -vue.

microsoft/playwright · 69 tokens

a11y-debugging

Uses Chrome DevTools MCP for accessibility (a11y) debugging and auditing based on web.dev guidelines. Use when testing semantic HTML, ARIA labels, focus states, keyboard navigation, tap targets, and color contrast.

ChromeDevTools/chrome-devtools-mcp · 50 tokens