A Claude OAuth refresh token is not an API key. It is issued when someone signs a coding tool or another app into their Claude account, and its job is to obtain new short-lived access tokens without asking the person to log in again. That makes it more dangerous than the access token it renews: whoever holds it can keep generating fresh access, acting as the signed-in user, until the underlying session is ended. The exposure is about identity (conversations, projects and settings tied to the login) as well as usage. Revoke the session first, then investigate.
Check your GitHub account for leaked secrets — free
- Provider
- Anthropic
- Severity
- Critical
- Impact
- Source code and build access
- Checked live by LeakWatch
- Yes
What a Claude OAuth Refresh Token looks like
A Claude refresh token starts with sk-ant-ort, then a version number, a dash, and a long body of letters, digits, hyphens and underscores:
sk-ant-ort01-XXXXXXXX…XXXX Claude OAuth refresh token (masked, 80 to 150 characters after the version)
The prefix is case-sensitive. ort stands for OAuth refresh token. Its sibling sk-ant-oat is the OAuth access token, which expires sooner, and sk-ant-api is an Anthropic API key tied to a workspace rather than to a person. A short string that only starts with sk-ant-ort01- is not a token. Refresh tokens are usually not placed in an environment variable on purpose; they appear inside a tool’s credential file, for example as a refreshToken field in a JSON document next to the access token. If you find one, look for the access token and any API key in the same file.
How Claude OAuth Refresh Tokens get leaked
- Copied credential files. A tool’s local credential or configuration file copied into a project folder, a dotfiles repository or a support archive, with both tokens inside.
- Backups and container images. A home directory baked into a Docker image or committed as a backup, along with the tool’s stored session.
- CI configuration. A pipeline that restores a credential file from a secret, then prints or uploads it in a debug step or as a build artifact.
- Pasted JSON. A configuration block shared in an issue, a chat or a forum thread to explain a login problem.
- Screenshots and recordings. A terminal or editor capture that shows the credential file open.
What to do in the first hour
- End the session. Sign out of the tool on every machine where the token may have been used, then sign in again only on devices you trust. If the file lives in a CI system, delete the secret there and stop the jobs that use it. Do this before cleaning up anything else.
- Review your Claude account. In the account settings (see the link below), look for connected apps, sessions and recent activity you do not recognize, and remove them. Change the account password and turn on two-factor authentication if it is not already active.
- Rotate the login. Sign in again through the tool’s own flow, which issues a new pair of tokens. Store them only in the tool’s local credential store, or in a secret manager. Never put them in a file that Git tracks.
- Check usage. Look at usage and cost views for the period since the exposure. Spikes, models you never use and activity at unusual hours are the signs to look for.
- Look for neighbours. If the same file held an access token, an API key or an admin key, rotate them as well. Each credential has its own revocation path, and the Claude OAuth access token and Anthropic API key guides explain them.
- Clean up the repository. Remove the value from current files and check the commit history for it. Old commits keep the value even after the file changes, so ending the session is the real fix. See I accidentally pushed an API key to GitHub.
Not sure what else leaked from the same repository? Run a free scan.
Revoke it at Anthropic
Claude OAuth tokens are not listed in the Claude Console, so you cannot delete one there the way you delete an API key. Revocation means ending the session that the token belongs to: sign out of the tool, and use the sessions and connected apps shown in your Claude account settings to remove entries that match the leak. Do not assume a sign-out has ended every session until the list confirms it. A person has not confirmed the exact menu wording for this guide, and the interface can change, so look for the section where signed-in apps and sessions are listed, and follow Anthropic’s documentation at docs.claude.com.
How LeakWatch detects it
The rule is called Claude OAuth Refresh Token. It looks for the literal, case-sensitive prefix sk-ant-ort, then one or more digits, a dash, and 80 to 150 characters made of letters, digits, hyphens and underscores, with word boundaries on both sides. Because the token identifies itself, no variable name is needed, though the text sk-ant- must be present. An access token (sk-ant-oat), an uppercase variant, or a tail shorter than 80 characters is not reported by this rule. The severity is critical, with the impact class for identity and code access, because a refresh token regenerates access indefinitely.
LeakWatch can check whether a detected key is still active with a read-only request to Anthropic. It never reads your data or spends your credits.
This type is checked live. LeakWatch sends one read-only request to the model-listing endpoint of the Anthropic API, passing the detected value in the x-api-key header. It never sends a prompt and never reads conversations. A successful answer, or an answer saying the credential is authenticated but not allowed to list models, counts as live, and only a rejection counts as invalid. Be aware that this endpoint is built for API keys: an OAuth refresh token may be refused there even though it can still obtain access tokens elsewhere. An “invalid” result is therefore not proof that the token is harmless, and you should end the session either way.
FAQ
Is a refresh token worse than an access token?
Generally yes. An access token expires on its own, while a refresh token can be used to obtain new ones until the session is ended. That is why this rule is rated critical and why ending the session matters more than waiting for expiry.
Can I revoke it from the Claude Console like an API key?
No. The Console manages API keys for workspaces. A refresh token belongs to a person’s login, so you end it by signing out and removing the session or connected app in the account settings.
The repository was private. Do I still need to act?
Yes. Collaborators, forks, CI logs and backups can all read the file. If you are unsure who had access, or the repository was ever public, end the session and rotate the login.