---
name: no-leaky-secrets
description: Use before reading a config, .env, credentials file, token file, private key, container or process state (docker inspect, ps, printenv, crontab, systemctl), before staging files with git add, or before sharing a session, so a secret is used without being printed into the transcript. Also use when a command was blocked as a credential source, when a secret already appeared in output, or when asked to set up the no-leaky hooks.
title: no-leaky-secrets
canonical_url: https://skilld.dev/gh/fajarhide/no-leaky/no-leaky-secrets
last_updated: 2026-11-15T06:00:40.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [scripts/data.py](https://skilld.dev/api/skills-raw/fajarhide/no-leaky/no-leaky-secrets/scripts/data.py), [scripts/detect.py](https://skilld.dev/api/skills-raw/fajarhide/no-leaky/no-leaky-secrets/scripts/detect.py), [scripts/filter.py](https://skilld.dev/api/skills-raw/fajarhide/no-leaky/no-leaky-secrets/scripts/filter.py), [scripts/guard.py](https://skilld.dev/api/skills-raw/fajarhide/no-leaky/no-leaky-secrets/scripts/guard.py), [scripts/install.py](https://skilld.dev/api/skills-raw/fajarhide/no-leaky/no-leaky-secrets/scripts/install.py), [scripts/nl_run.py](https://skilld.dev/api/skills-raw/fajarhide/no-leaky/no-leaky-secrets/scripts/nl_run.py), [scripts/packs.py](https://skilld.dev/api/skills-raw/fajarhide/no-leaky/no-leaky-secrets/scripts/packs.py), [scripts/prompt_guard.py](https://skilld.dev/api/skills-raw/fajarhide/no-leaky/no-leaky-secrets/scripts/prompt_guard.py), [scripts/scan.py](https://skilld.dev/api/skills-raw/fajarhide/no-leaky/no-leaky-secrets/scripts/scan.py), [scripts/vault.py](https://skilld.dev/api/skills-raw/fajarhide/no-leaky/no-leaky-secrets/scripts/vault.py).
>
> If the user asked to install this Skill, run `npx skilld install fajarhide/no-leaky/no-leaky-secrets`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/no-leaky-secrets`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/fajarhide/no-leaky/no-leaky-secrets) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/no-leaky-secrets`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/no-leaky-secrets --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/no-leaky-secrets --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# no-leaky-secrets

Anything a command prints lands in the transcript, and from there in backups, shared sessions and the provider's logs. A secret you only needed to *use* should never be *shown*.

## Use it, do not show it

| You need to | Leaking way | Safe way |
| --- | --- | --- |
| Start an app with its env | `cat .env`, then copy values | `set -a; . ./.env; set +a; npm start`, or `op run -- npm start` |
| Call an API with a token | `echo $TOKEN`, paste it into the command | `curl -H "Authorization: Bearer $(cat ~/.token)" https://...` |
| Check a token works | print it and eyeball it | call the API and read the HTTP status: `curl -s -o /dev/null -w '%{http_code}' ...` |
| Check `.env` has every key | `cat .env`, `grep KEY .env` | `grep -c '^KEY=' .env`, or `cut -d= -f1` on `.env.example` and compare names |
| Compare two secret files | `diff a b` | `cmp a b`, `shasum a b` |
| Debug a container | `docker inspect app` | `docker inspect --format '{{.State.Status}} {{.State.ExitCode}}' app`, `docker logs app` |
| Find a process | `ps aux` | `ps -eo pid,comm`, `pgrep -l name` |
| Read a cron job | `crontab -l` | `crontab -l \| grep -c job-name`, or ask the user to look |
| Pass a file to a remote host | `cat key`, then paste | `cat key \| ssh host 'cat > /path'`, `scp` |
| Put a secret in a JSON body | inline it | `jq -n --rawfile k ~/.token '{key:$k}' \| curl -d @- ...` |
| Share config with the team | `git add .env` | add `.env` to `.gitignore`, commit a `.env.example` with dummy values |

Rules behind the table:

- Load, pipe or redirect. `. file`, `"$(cat file)"` inside the command that needs it, `jq --rawfile`, a pipe into `curl` or `ssh`, `> file`.
- To inspect, count and hash: `wc -l`, `stat`, `shasum`, `cmp`, `grep -c`. Prove it works by its effect.
- Never write your own filter. `sed 's/=.*/=***/'`, `cut -c1-10`, `head`, `grep -v` on a credential source still print it, they only change the shape.
- A "masked" copy, a prefix or a suffix is still a leak. Do not print one.

## Setting up the hooks

`npx skills add` copies this folder but cannot edit Claude Code settings, so the hooks are one step the user approves. When the user asks to set up no-leaky, or a credential read was not blocked and they want it to be:

1. Run `python3 <this skill's folder>/scripts/install.py --dry-run` and show the user every line it would change.
2. If a listed PostToolUse hook only reports status and never rewrites output (an app's own status or notification hook), add `--no-wrap '<part of its command>'`.
3. On a yes, run it again without `--dry-run`. It backs up `settings.json` first. The hooks take effect in the next session.
4. Run `install.py --check` and tell the user the result. If it ever reports a missing hook or interpreter, run the install again.

`install.py --uninstall` takes them out again.

## When Claude Code itself denies a read

"File is in a directory that is denied by your permission settings" or "Permission to use Bash with command cat .env has been denied" comes from the `permissions.deny` rules no-leaky installs as a backup. Treat it like a guard denial: use the value without reading the file, never look for another way in.

## When the guard blocks a command

The denial names the source and the safe way. Take the safe way. Do not retry with another filter or another reader. If you think it is a false alarm, say so in one line and ask the user to run the command themselves in Claude Code's shell mode (they type an exclamation mark, then the command).

## When a secret already appeared

1. Stop and tell the user: which secret (kind or variable name), how it got there (which command or tool), and its fingerprint if the tool gave one.
2. Never repeat the value, not even partly, not in a quote, a summary or a commit.
3. Recommend rotating it where it was issued. The user rotates; you do not touch the value.
4. Suggest `/no-leaky-scan` to see whether it leaked before.

## When the user pastes a secret

The prompt guard holds the message back and says so. Suggest a safer route: put the value in a file or env var and tell you the path or name. They can still send it with a `secret-ok:` prefix.

## Before sharing a session

Run `python3 <skill dir>/scripts/scan.py --session <transcript.jsonl>` and share only when it exits 0.
