ScriptsApr 14, 2026·3 min read

croc — Send Files and Folders Securely Between Any Two Computers

croc is a simple CLI for sending files between computers. Run `croc send file.zip` on one side; croc prints a code; run `croc <code>` on the other side — end-to-end encrypted, NAT-traversing, zero setup.

TL;DR
croc transfers files between any two computers with encryption and zero setup.
§01

What it is

croc is a simple CLI tool for sending files and folders between any two computers. Run croc send file.zip on one side, croc prints a code phrase, and run croc <code> on the other side. The transfer is end-to-end encrypted, traverses NATs and firewalls automatically, and requires zero configuration or account setup.

croc targets developers, sysadmins, and anyone who needs to transfer files between machines without setting up SSH, configuring cloud storage, or using email attachments. It works across operating systems and network configurations.

§02

Why it saves time or tokens

File transfer between computers usually involves SCP (requires SSH setup), cloud storage (requires accounts), or USB drives (requires physical access). croc eliminates all of this with a single command. The relay server handles NAT traversal, so it works even when both machines are behind firewalls. For AI-assisted workflows where generated files need to move between environments, croc provides the simplest transfer method.

§03

How to use

  1. Install croc: brew install croc or curl https://getcroc.schollz.com | bash
  2. Send a file: croc send myfile.zip
  3. On the receiving machine: croc <code-phrase> using the code shown by the sender
§04

Example

# Sender
$ croc send presentation.pdf
Sending 'presentation.pdf' (2.4 MB)
Code is: castle-gamma-piano

On the other computer run:
croc castle-gamma-piano

# Receiver
$ croc castle-gamma-piano
Accept 'presentation.pdf' (2.4 MB)? (y/n) y
Receiving...
presentation.pdf 100% |████████████| (2.4/2.4 MB, 8.2 MB/s)
FeatureDescription
E2E encryptionPAKE-based key exchange
NAT traversalWorks behind firewalls
Cross-platformmacOS, Linux, Windows
ResumeContinue interrupted transfers
FoldersSend entire directories
§05

Related on TokRepo

§06

Common pitfalls

  • The default relay server is public; for sensitive files, self-host your own relay with croc relay
  • Very large transfers (multi-GB) may be slow through the public relay; direct transfers or self-hosted relays improve speed
  • The code phrase expires after a configurable timeout; the receiver must enter it before the sender's session times out

Frequently Asked Questions

Is croc secure?+

Yes. croc uses PAKE (Password Authenticated Key Exchange) to establish an encrypted channel using the code phrase as the shared secret. The relay server cannot read the file contents. End-to-end encryption ensures only the sender and receiver with the correct code can access the data.

Can I self-host the croc relay server?+

Yes. Run croc relay on any server with a public IP. Configure clients to use your relay with the --relay flag. Self-hosting gives you control over the relay infrastructure and avoids sending data through the public relay server.

Does croc work across different operating systems?+

Yes. croc runs on macOS, Linux, Windows, FreeBSD, and Android (via Termux). You can send files from a Mac to a Windows machine or between any combination of supported platforms. The protocol is OS-agnostic.

Can croc transfer folders?+

Yes. Use croc send myfolder/ to send an entire directory. croc compresses the folder, transfers it, and decompresses it on the receiving end. The directory structure is preserved.

How does croc handle interrupted transfers?+

croc supports resumable transfers. If the connection drops during a large file transfer, re-run the same croc command with the same code and it resumes from where it left off rather than starting over.

Citations (3)
  • croc GitHub— croc is a CLI for secure file transfer
  • croc Security— PAKE-based key exchange for end-to-end encryption
  • croc Relay— NAT traversal techniques for peer-to-peer connections

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets