Claude Code writes files into your project: a report, a CSV export, a build. Getting one to another person usually means pasting it into a chat, attaching it to an email, or dropping it in a shared drive. Each works, and each leaves a copy around for longer than you meant. Pasting only works for text, and a long file fills the conversation.

aFile lets Claude Code hand over one file as a link. The file is encrypted on your machine first. The link carries its key after #, and it closes after a day, or after one download if you ask for that.

Set it up once

npm i -g @afile/cli
afile connect
afile add -a claude-code

afile add -a claude-code saves the aFile skill in ~/.claude/skills/afile, where Claude Code finds skills. Add --project to put it in this project instead. The CLI needs Node.js 24 or later.

Ask for it

Share report.pdf with Dana. One download, until tomorrow.

Claude Code saves the file to its encrypted storage, then makes a link to it:

afile save report.pdf
afile share report.pdf --expires 1d --once

Output

Shared report.pdf.
https://api.afile.sh/s/5fcf4cd1-d94a-4764-bbfd-16a15a36bb7c#E9Ct7VFgJvGcFpME05InesyKxst7M_A7aqy0fAHCW_o
Open until 30 Nov 19:19, for 1 download. Anyone with the whole link can download it.
Close it: afile close 5fcf4cd1-d94a-4764-bbfd-16a15a36bb7c

Send Dana the whole link, including what follows #. That part is the key. Browsers don’t send it to the server, so aFile never sees it. Dana opens the link, the page decrypts the file in the browser, and Dana downloads it. There’s no account to make and nothing to install.

If Dana has an agent with aFile, it can skip the page:

afile get '<link>' --out report.pdf

It checks the file against the fingerprint saved with it before it writes anything.

Choose how long it stays open

  • --expires 1h or --expires 7d: open for that long. A day if you don’t say, and 30 days at most.
  • --once: closes after one download.
  • --downloads 5: closes after five.

See and close links

afile links

Output

share · report.pdf · 0 of 1 download · open until 30 Nov 19:19
  5fcf4cd1-d94a-4764-bbfd-16a15a36bb7c

Close one: afile close <link>

A link closes by itself when it expires or runs out of downloads, and afile close closes it at once. Either way, the copy behind it is erased. The file stays in Claude Code’s storage until you delete it, so you can share it again later.

Send it to someone’s agent

If the other person’s agent is on aMessage, Claude Code can send the link there:

url=$(afile share report.pdf --expires 1d --json | jq -r .url)
amessage reply <conversation> "Here is the report: $url" --key "$(uuidgen)"

Questions people ask

Can I share a folder?

A link shares one item. Zip the folder and share the zip. An item can be up to 25 MiB.

Can aFile see the file?

No. When you share, the CLI encrypts a copy on your machine under a key made for that one link, and the key exists only after the #. aFile stores the encrypted bytes, and can’t read the file’s name either.

Does it work with other agents?

Yes. afile add finds the agents on your computer, including Codex, Cursor, Gemini CLI, OpenCode and OpenClaw. Any agent that can run a command can use the CLI.