· 6 min read
Screenshots in a README, done the way GitHub's docs team does it
GitHub's own writers skip CLI screenshots and write 40–150-character alt text. How to apply the same rules to your README, and keep secrets out of the repo.
By Cleanss team
A README screenshot is the first thing most people see of your project and the last thing most maintainers think about. GitHub's documentation team has written down how it handles screenshots in its own docs, and the rules transfer directly to a README. This post works through them, adds the one rule the team did not need to write down (nothing secret in the image, because the image is going into a public repo), and shows a capture workflow that produces consistent images.
Every platform's sizes are in one table in the screenshot sizes cheat sheet.
The rules GitHub's writers follow
Two pages set them out: the Creating screenshots guide and the style guide. The parts that matter for a README:
No screenshots of the command line. The team's instruction is to avoid screenshots of command-line interfaces to convey commands and their output, and to provide the commands directly instead. A code block can be copied, searched and read aloud; a PNG of a terminal cannot.
Screenshots have a cost. The guide notes that screenshots privilege sighted users and add length and load time to a page. A screenshot earns its place when it shows something words cannot: a layout, a visual state, where a control lives.
Alt text is 40 to 150 characters and starts "Screenshot of…". That is a specific, checkable rule, and most READMEs fail it; the usual alt text is "screenshot" or nothing.
The technical specs are written down too. The same guide asks for static PNGs (no GIFs), 750 to 1,000 pixels wide for a full-column image, 144 dpi, and 250 KB or less. Interfaces are shown in light theme wherever possible; dark mode only when the software has no light mode. These are rules for GitHub's own docs, not for your README, but they are a sensible default.
Applying them to a README
- Replace terminal screenshots with code blocks. Installation, usage, example output: all text. If the output is long, trim it, but keep it as text.
- Keep one hero image, and make it count. The image almost every README benefits from is the product itself: the UI, the rendered output, the chart. Put it near the top, after the one-line description.
- Write the alt text properly.
is 92 characters of alt text, ends with a period as the style guide asks, and says what the image shows. In GitHub Markdown, the text in the square brackets is the image's alt text (GitHub Docs). - Watch file size. Load time is a cost the GitHub guide names explicitly, and its own limit is 250 KB per screenshot. A full-resolution Retina capture of a large window is a big file; crop to the part that matters and consider whether the image needs to be that large at all.
- Use the same frame for every image. A README with one framed screenshot, one raw capture with a desktop corner showing, and one cropped at an odd ratio reads as unmaintained. One frame, one background, one aspect ratio. Screenhance, a screenshot-tool vendor, makes the same point: raw OS captures look unfinished next to polished docs.
- Do not put code in images anywhere else either. The arguments are collected in code screenshots for X: screen readers cannot process them and the text is unsearchable, per an Ionic forum thread and Jake Worth.
The rule GitHub did not have to write: nothing secret in the image
A README image lives in a public repository, in every clone, for as long as the history exists. On 29 Sept 2026 The Register reported that Glow Security had found more than 13,000 sensitive screenshots of corporate software projects posted to public GitHub repos by AI coding agents, from 343 organisations, containing personal information and credentials. About a third came via gitshot, a screenshot tool for code reviews whose own README warns against uploading credentials, internal dashboards and private data. (Glow sells endpoint security and, as CPO Magazine notes, has not published how it found or counted the images.)
The mechanism is relevant to READMEs: GitHub's image upload for pull requests works only in the browser, so anything scripted that needs to show an image ends up committing it to a repo. A README screenshot is committed by design. The checks before you commit:
- Capture a window, not a screen. A single app window cannot include your other tabs, Slack, or the second monitor.
- Scan for secrets in the image. Secret scanners such as TruffleHog, Gitleaks and GitGuardian are not documented as OCR-scanning images, so a key visible in a PNG will not be caught at push time. Cleanss's sensitive-info scan reads the screenshot on the device and finds emails, card numbers, passwords, API keys and tokens, and IPv4 addresses; it does not look for hostnames, and it is not a substitute for looking, but it catches the obvious.
- Use demo data. Real customer names, real emails and real internal hostnames do not belong in a public hero image.
- Blur or bar anything left. A strong blur that leaves nothing legible, or a solid bar; weak pixelation can be reversed.
- If a key was ever visible, revoke it. Resend's guidance is to assume a key that appeared in a shared screenshot has already been scraped.
The full checklist for agent-assisted workflows is in safe PR screenshots when AI agents do the pushing.
A capture workflow that stays consistent
Cleanss is a screenshot app for Mac and Windows. The steps below are specific to it, with Mac shortcuts (use Ctrl in place of ⌘ on Windows); the shape of the workflow applies to any tool with a window picker and framing.
- Open the Cleanss editor from the menu bar icon (the system tray on Windows), click Window at the top, and pick your app's window from the list. The window is captured on its own at full native resolution.
- The capture opens in the editor.
- Set the canvas to 16:9. Use it for every image in the README.
- Choose a window frame (light, dark, glass or none) and a background. For a README, a single solid colour is a safer bet than a shader, since the image sits on whichever GitHub theme the reader uses. GitHub's docs do not say how a transparent PNG looks on the dark theme, so if you use the transparent background, check the README in both themes. If you want separate light and dark images, GitHub Markdown supports the
<picture>element, and GitHub's blog shows how to switch images onprefers-color-scheme. - Set padding and corner radius once and leave them.
- Run the sensitive-info scan, then press B to blur anything else that should not be public.
- ⌘S saves a PNG at full native resolution. Commit it alongside the README. GitHub does not prescribe a folder;
docs/or animages/folder both work, as long as you reference the file with a relative link, which GitHub recommends for images in your own repository and resolves on whichever branch is being viewed (GitHub Docs). - Reference it with alt text of 40 to 150 characters beginning "Screenshot of…".
If you capture with the macOS shortcut instead and want the window without the system shadow, see Mac screenshot without the window shadow. Window capture in Cleanss gives you the window on its own, without the macOS shadow, and the frame and shadow are then yours to set in the editor. For backgrounds and frames in more depth, see add a background to a screenshot.
FAQ
Should a README have screenshots?
One or two, of the product itself, with proper alt text. Not of the terminal: GitHub's docs team provides commands as text rather than screenshots, and a README should do the same.
How long should alt text for a README screenshot be?
GitHub's style guide says 40 to 150 characters, beginning "Screenshot of…", describing what the image shows rather than repeating the caption.
How do I keep secrets out of README images?
Capture a single window, use demo data, scan the image for keys, emails and card numbers before committing it, blur anything that remains, and treat any key that was ever visible as compromised. Secret scanners that check your commits do not read images.
You can download Cleanss for Mac and Windows to try this workflow.