Debug with Claude, without pasting your secrets
The fastest way to get help with an error is to paste the stack trace and the log lines around it. Those lines are also where tokens, connection strings and user data sit. This page shows one real looking error, what Scrub for AI replaces, and what stays so Claude can still find the bug.
The example
1 What you were about to paste
TypeError: Cannot read properties of undefined (reading 'total')
at checkout (/srv/app/orders.js:88:17)
2026-11-18 09:12:44 user=lotte.devries@example.com ip=203.0.113.42 POST /api/checkout 500
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI0MiJ9.x2HsQkZt0p9w
DATABASE_URL=postgres://shop:S3cretPassw0rd@db-eu1.internal:5432/shop
STRIPE_KEY=sk_live_51HxExampleKey0000000000000000
2 What the AI chat receives
TypeError: Cannot read properties of undefined (reading 'total')
at checkout (/srv/app/orders.js:88:17)
2026-11-18 09:12:44 user=[EMAIL_1] ip=[IP_1] POST /api/checkout 500
Authorization: Bearer [SECRET_1]
DATABASE_URL=postgres://[CRED_1]@db-eu1.internal:5432/shop
STRIPE_KEY=[SECRET_2]
3 The answer, with your values back
The request from lotte.devries@example.com fails because the cart is empty when checkout() reads cart.total on line 88. Guard it:
if (!cart || !cart.items.length) return res.status(400).json({ error: 'empty cart' });
The database connection itself is fine. Do rotate sk_live_51HxExampleKey0000000000000000 if this log was ever shared outside the team.
What stays, and why that matters
A scrubber that removes too much makes the error impossible to debug. In the example the file name, the line number, the HTTP method, the status code and the database host all stay. Only the password inside the connection string is replaced, so Claude can still see that the database is reachable and that the bug is in orders.js.
What is replaced: the bearer token, the password in DATABASE_URL, the Stripe key (found by its shape), the user's email address and the IP address. Each gets a numbered placeholder, so if the same token appears in twenty log lines, it is [SECRET_1] in all twenty.
How you do this in Claude
- Select the log or stack trace and choose Scrub selection and copy, or paste it into the popup. Pro also scrubs whole log files and exports.
- Paste into Claude at claude.ai. With Pro, Paste Guard scrubs the moment you paste there, so you cannot forget it on a busy day.
- Restore the answer if it refers to values you need back, with Restore placeholders in selection and copy.
Add what is specific to your stack
Internal host names, customer IDs and project code names have no general shape. Add them as own terms, or as a pattern such as cust_[0-9]{8} => CUSTOMER, and they are replaced like everything else.
Where Scrub for AI does not help
- Tools that read your files directly. Scrub for AI works on text in the browser. An AI tool in your editor or terminal that reads the repository by itself is outside its reach; keep secrets out of the repository instead.
- Secrets without a shape or a telling word. A random string without
password=,token:or a known prefix in front of it can pass. Read the scrubbed text. - Earlier leaks. A key that was pasted somewhere before is exposed. Scrubbing prevents the next leak; it does not undo the last one. See what to do after pasting a key into an AI chat.
Questions and answers
Which keys and tokens are recognised?
Keys with a known shape from AWS, GitHub, GitLab, Stripe, OpenAI, Anthropic, Google, Slack, SendGrid, npm and Twilio, JSON Web Tokens, bearer tokens, private key blocks, passwords inside URLs and values after words such as password, secret, token or api_key.
Does Claude get worse answers with placeholders?
Not for debugging. The model needs the structure of the error, not the value of your token. If it does need to know what a value looks like, describe it: "a 40 character hex string".
Can I try this without installing anything?
Yes. The log scrubber runs the same engine on a web page, and nothing you paste is uploaded.
This is a practical guide, not legal advice.