Hygiene
Agents read your files, run your commands, and write all of it to disk. Hygiene answers two questions: which credentials ended up in those files, and what did a session actually do. It reads transcripts, tool output, edit snapshots, and agent config files. It never shows a credential value, never edits a transcript, and never redacts one. To stay safe after a finding, you rotate the credential at its provider.
Find credentials agents left behind
Section titled “Find credentials agents left behind”Open HygieneSecrets and click Scan now. Use the Agent control to limit the next scan to one agent, and Scan again to refresh.
Each finding is a row: its kind, its label (and key name when there is one), a
confidence of high or medium, and how many places, sessions, and files hold it.
Click a row to see the places: what kind of text the line is, file:line, and a masked
preview.


Open in History jumps to the chat that holds the finding.
yardmaster hygieneyardmaster hygiene --agent claudeyardmaster hygiene --config-onlyyardmaster hygiene --sessions-onlyyardmaster hygiene --all --json3 credentials in 5 places · 120.4 MB in 212 files · 2.1 sKIND WHAT SURE PLACES SESSIONS FILES FIRST SEENknown token GitHub token high 3 2 2 tool output · ~/.claude/projects/storefront/…URL credentials URL credentials for deploy high 1 1 1 prompt · ~/.codex/sessions/…key with value API_KEY medium 1 1 1 config · ~/code/api/.env
GitHub token tool output ~/.claude/projects/storefront/…:42 export GH_TOKEN=***
Previews mask the credential; nothing here is the value itself.--limit (default 20) caps how many findings list their places, --all lists every
one, --agent takes one agent, and --json prints the report as JSON.
The command exits with code 2 when it finds a high-confidence credential, so a script can fail on it:
yardmaster hygiene --config-only || echo "credentials in agent config"All flags are in the CLI reference.
Tool: check_secrets (read-only). scope is config (the default: the files the
agents load) or session (one stored session, yours by default, or session_id). It
never scans every transcript; that is the CLI’s hygiene.
{ "name": "check_secrets", "arguments": { "scope": "config" } }{ "scope": "config", "credentials_total": 1, "high_confidence": 0, "credentials": [ { "kind": "key with value", "label": "API_KEY", "key": "API_KEY", "confidence": "medium", "fingerprint": "…", "preview": "API_KEY=***", "places": [{ "file": "~/code/api/.mcp.json", "line": 8, "kind": "config" }] } ], "advice": "…"}Ask your agent: “Check my agent config for credentials before I commit it.”
How a finding is shown
Section titled “How a finding is shown”Every finding carries the same fields in the app, the CLI, and MCP:
- Kind: what shape matched (see the table below).
- Label: a short name such as
GitHub token, or the key name for a key with a value. - Key name: the variable or JSON key next to the value, when there is one.
- Fingerprint: a short hash of the value. The same credential in many places gets the same fingerprint, so those places form one finding. It is a grouping aid, not a cryptographic digest.
- Preview: the line around the hit, with the value masked and other secrets redacted.
- Places: file and line, and whether the line is a prompt, a reply, tool output, a kept file, a config file, or something else.
Confidence has two levels:
| Confidence | Meaning |
|---|---|
high |
A well-known credential shape: a token with a provider prefix, a private-key block, a JWT, or URL credentials. |
medium |
A sensitive key name with a value that could be a credential, a Bearer value, or a test key. |
Exit code 2 and the notification of a scheduled scan both follow high only. Placeholders
such as example, your, changeme, or ${VAR} are not reported as key-value findings.
What the scanner recognizes
Section titled “What the scanner recognizes”| Kind | What it matches |
|---|---|
| Known token | Provider prefixes: GitHub, GitLab, Anthropic, OpenAI-style, Slack, AWS, Google, Hugging Face, npm, Stripe (live is high, test is medium), SendGrid. Other recognized prefixes show as API token. |
| Private key | A BEGIN … PRIVATE KEY block. |
| JWT | A JSON Web Token of 40 or more characters. |
| URL credentials | A user and password inside a URL. |
| Bearer token | Bearer followed by 16 or more characters. |
| Key with value | A sensitive key name (such as token, secret, password, api key) with a value that is not a placeholder, written as KEY=value, "key": "value", key: value, or --key value. |
Know what is new
Section titled “Know what is new”After a scan, a finding the app’s scan record had not seen before carries a New mark in HygieneSecrets. The first scan on record is the baseline: nothing in it is new.


yardmaster hygiene --since-lastThis adds a NEW column and marks new findings against the app’s last recorded full
scan. It only reads that record and never writes it, so it cannot move the app’s
baseline. It exits 2 only for a new high-confidence credential, or for any
high-confidence credential when nothing is on record yet.
Tool: check_secrets with since_last: true. It marks each credential is_new and
returns last_scan (when it ran, the high and medium counts, and the credentials it
found new, as kind, label, confidence, and fingerprint).
{ "name": "check_secrets", "arguments": { "scope": "config", "since_last": true } }Ask your agent: “Is there any new credential since the last Yardmaster scan?”
The scan record keeps the fingerprint, kind, confidence, and label of each credential, and counts. It never keeps a value, a preview, a key name, or a path. Only the app writes it. A scan of one agent’s sessions is not recorded.
Scan on a schedule
Section titled “Scan on a schedule”Open SettingsGeneralHygiene and pick Scheduled secret scan: Off, Every 6 h, Daily, or Weekly. It is off by default. Turn on Notify when a scheduled scan finds new credentials to get a notification.
The notification fires for new high-confidence credentials, never for the first scan, and says a count only, never the credential, a preview, or a path.


yardmaster settings set hygiene_scan dailyyardmaster settings set notify_hygiene falsehygiene_scan takes off, six_hours, daily, or weekly.
Not available over MCP. The server has no setting tools.
The scan runs in the app, with two threads, a few minutes after launch, and no more often than the interval since the last full scan on record.
Review risky actions
Section titled “Review risky actions”The Risks feed lists deletes, root commands, downloads piped into a shell, history rewrites, installs, network calls, secrets files, and work outside the project folder, across every agent and session.
Open HygieneRisks. Narrow it with Window (1 day, 7 days, 30 days), Risk, Agent, and Project. Click a row to open that action in the session’s audit.


yardmaster hygiene risksyardmaster hygiene risks --days 30 --agent claude --limit 02 risky actions in 2 sessions in the last 7 days · 48 sessions read · 0.9 sdeletes recursively 1 · pipes a download into a shell 1WHEN AGENT PROJECT WHY ACTION SESSIONTue 2 Dec 14:05 Claude Code ~/code/storefront deletes recursively rm -rf build 3f9a1c2e#12Mon 1 Dec 09:40 Codex ~/code/api pipes a download into a shell curl … | sh 77b0d1aa#4
`yardmaster audit <session>` shows one session in full.--days sets the window (0 reads every session on disk, default 7), --limit caps rows
(default 50, 0 shows all). Commands are masked.
Tool: audit_session carries risk flags per action (see the next section). There is no
feed tool.
Audit one session
Section titled “Audit one session”The audit lists what one session did: commands run, files written and read, URLs fetched, and the actions worth a look.
Open HygieneAudit, search the session list by title, prompt, or folder, and pick one. You get Worth a look, Commands, Files written, Files read, URLs, and All actions.


yardmaster sessionsyardmaster audit 3f9a1c2e --riskyClaude Code · ~/code/storefront · "Fix the checkout bug" · 14 turnsresume: claude --resume 3f9a1c2e-…
WORTH A LOOK #12 command rm -rf build — deletes recursively--risky prints only the summary and the risky actions. Without it you also get the
commands, files written, files read, URLs, and all actions. --json prints it all as
JSON.
Tool: audit_session (read-only). It defaults to the session that launched the server;
pass session_id for another one, and risky_only: true for flagged actions only.
{ "name": "audit_session", "arguments": { "risky_only": true } }{ "found": true, "agent": "Claude Code", "actions": [ { "index": 12, "kind": "command", "tool": "Bash", "target": "rm -rf build", "risks": ["deletes recursively"] } ], "counts": {}}Ask your agent: “Audit this session and tell me about anything risky.”
What to do with a finding
Section titled “What to do with a finding”- Rotate the credential at its provider. A key that sat in a transcript is exposed to anything that can read that file. Revoking it is the only fix.
- Remove it from the config file or script it came from.
- Optionally move the chat that holds it out of the way (below).
Yardmaster does not edit or redact transcripts. They are vendor files, and purging or redacting one is not implemented.
Move a chat that holds a finding to the Trash
Section titled “Move a chat that holds a finding to the Trash”In HygieneSecrets, expand a finding and click Archive this chat next to a place, or click Archive all N chats with findings at the top. A dry run opens first: it lists the chats and their sizes. Nothing moves until you click the move button in that review.
Despite the “archive” wording on the buttons (it is stale), the chat moves to your system Trash, through the same planner as Reclaim. Places in config files or outside a chat stay as they are; only whole chats move. A live session or one written to in the last 10 minutes is refused.


yardmaster prune --session 3f9a1c2e # dry runyardmaster prune --session 3f9a1c2e --yes # move it to the TrashRestore with yardmaster trash restore.
Not available over MCP. The server has no write tools.