Skip to content
All articles

How to Share a Code File Privately

7 min readFormats, Client work

To share a code file privately, turn it into a page that shows the code with line numbers, and put that page behind a list of the people allowed to open it. The reader gets a link that works in any browser, can read the file without installing anything, and can download it if they need it. Anyone not on the list gets a sign-in step they cannot pass.

This post covers why the usual ways of sending code fall short when the code is not meant for everyone, how to publish a script, a config file or a JSON export as a readable private page, and the limits worth knowing before you send the link.

Why sharing a code file privately is harder than it sounds

You asked Claude or ChatGPT for a script that cleans up a client's export, or a config file for their deployment, or a small Python tool that pulls numbers from their system. It works. Now someone else needs to see it: the client's developer who has to review it, a colleague who will run it, a manager who wants to know what it does before it touches production.

The obvious options each break something. Pasting the code into an email or a chat message mangles the indentation, which in Python changes what the code means. Attaching the file means the reader has to download it and open it in an editor, which a manager on a phone will not do. Pasting it into a document loses the line numbers, so "look at line 40" turns into "look at the part after the second loop".

And most of those copies travel. An attachment gets forwarded. A file dropped into a shared folder stays there after the project ends. If the code holds anything you would rather keep inside a small group (how a client's data is shaped, the name of an internal system, a query that reveals a business rule), every copy is one more place it can leak from.

What a secret gist and a paste link do

The developer's answer is a GitHub gist, and it is a good tool for code you are happy to have found. It is worth being clear about what "secret" means there. GitHub's own documentation says plainly that secret gists aren't private: anyone who has the URL can see one, including someone you never sent it to. A secret gist is unlisted, not access-controlled. The same is true of most paste sites with an "unlisted" option.

That is fine for a snippet you would post on a forum. It is a poor fit for a client's script, because the only thing between the code and a stranger is that nobody has passed the link on yet. The same weakness applies to a Drive or Dropbox link set to "anyone with the link", which why a Google Drive link is not access control goes into in more detail.

Publishing the file as a readable page

SnapHost takes a code or text file as it is and makes a page out of it. A .py, .ts, .json, .yaml, .txt or other source file is shown with line numbers, with wrapping available when a line runs long, and a JSON file is pretty-printed so a one-line export becomes something a person can read. You do not convert anything first. SnapHost works out what kind of file it is when you publish.

There are two ways to get it there. Drag the file into the dashboard, or ask ChatGPT or Claude to send it over once your AI is connected. Either way you get one link, and the page at that link is the file.

The reader does not need a GitHub account, an editor or a developer's patience. They open the link, and the code is there with the numbers down the side, so a review comment can point at a line and mean it.

A code page carries its file, and readers can always download it. That matters for the colleague who has to run the script: they read it on the page, then take the exact file rather than copying text out of a browser and hoping the whitespace survived.

Making it private to the people you name

A page on SnapHost is either open to anyone with the link or restricted. On a restricted page, only the people you name can open it, and each one confirms their email before any of the content loads. Someone who is forwarded the link and is not on the list sees a sign-in step, not the code. They can ask you for access, and the request shows up for you to approve or turn down.

You name people by email, like dev@client.com. On Pro you can also name a whole company by its domain, so everyone at client.com gets in without you listing them one by one. Sharing and access control covers each setting.

Check the default before you send. On Free a new page starts out public, so switch it to restricted and add the people. On Pro a new page starts out restricted. On both plans you can change who is on the list at any time without republishing or changing the link, which is what you want when the reviewer changes halfway through a project.

Every open is recorded with the time and, when the reader proved an email, who it was. If you want to know whether the client's developer has actually looked at the script before the call, the access log answers that.

When the file is a React component

One kind of code file gets different treatment. A single .tsx or .jsx file with a default export, the kind Claude hands you as an artifact, is compiled and published as a working page rather than shown as source. That is usually what you want for an interface, since the reader sees the thing running instead of reading about it. How to publish a React component as a web page walks through that route.

If what you want the reader to see is the source itself, publish it as a plain code listing. A .tsx without a default export is shown as code, and so is any other file type that is not a component.

Updating the code without sending a new link

Code changes after review. That is the point of review. When the script is fixed, update the page and it keeps the same link, so the reviewer reloads what they already have instead of hunting for "script_v3_final.py" in their inbox. This works on every plan.

On Pro each update is also kept as a version, and you can roll the page back to an earlier one in one step. The rollback is saved as a new version too, and the link stays the same throughout. If an AI-assisted edit broke something that worked yesterday, you can put yesterday's file back in front of the reviewer while you sort it out.

Limits worth knowing

A few honest edges, so nothing surprises you after you send the link:

  • A text or code page shows the first 2 MB or 100,000 lines of the file, and the page says when it cut something. A long log file may not be shown in full.
  • A file can be up to 50 MB, page and files together.
  • A restricted page asks each reader to confirm their email once. For a reviewer who opens many of your pages that is a small step. For someone who will not sign in to anything, a password on the page is the alternative on Pro, and anyone holding the password can open it without being on the list.
  • A page cannot stop a reader who has access from copying what they see. Access control decides who can open the page, not what they do once it is open. If the code holds a real secret, such as an API key or a password, take it out before you share the file at all.

Check the file for keys and tokens before you publish it, whatever tool you use to share it.

What it costs

On Free you can have up to three pages at a time, each private to up to three people or public, served at sites.snaphost.ai with a small SnapHost mark in the corner. That covers a script reviewed by one client developer and a colleague. Pro is 19 euros a month per member who can publish, and readers cost nothing. It removes the page and reader limits and adds domain entries on the list, passwords, end dates on a link, custom domains and version history. Pricing has the current plans, and what you can publish lists every format and limit.

A short checklist before you send it

  1. Take any keys, tokens or passwords out of the file.
  2. Publish the file as it is: drag it in, or ask your AI to send it.
  3. Set the page to restricted and add the reviewer's email.
  4. Open the link yourself and check that the line numbers and indentation look right.
  5. Send the link. When the code changes, update the same page.

Keep reading