Installed a malicious agent skill: what to do now
If an agent skill ran a command that you did not read, treat every secret on that machine as stolen. Stop the agent, remove the skill, check for persistence, and rotate secrets from a clean device. The skill runs with your user rights. It can read your browser data, your SSH keys, and your .env files.
This guide shows where each tool keeps skills, how to spot a bad SKILL.md, and how to clean up in order.
What is a malicious agent skill?
A skill is a folder with a SKILL.md file. The file holds instructions in plain text. The agent reads them and follows them. A malicious skill hides a harmful step inside those instructions.
The attack needs no exploit. The skill asks the agent to run a command, and the agent runs it. The text looks like normal setup help.
These public reports show the pattern:
- ClawHavoc. Koi Security audited 2,857 skills on ClawHub. It found 341 malicious skills. It traced 335 of them to one operation. The skills told users to install fake prerequisites. The payload was the macOS stealer Atomic Stealer, according to the Koi report.
- ToxicSkills. Snyk scanned 3,984 skills from ClawHub and skills.sh in early February 2026. It found 76 skills with confirmed malicious payloads. Snyk lists base64
curl | bashcalls and password-protected ZIP files among the methods. Read the Snyk research. - skills.sh family. Zenity Labs reported one tainted skill family with more than 1.7 million installs. The number counts installs, not unique victims. The Next Web covered the report in August 2026. The skills told agents to collect SSH keys, cloud credentials, and tokens.
The Cloud Security Alliance names the cause in its research note. The payload is natural language. A model reads it at run time. A normal code scanner has nothing to match.
Where do skills and plugins live on my machine?
Check every location. A bad skill can sit in any of them.
Claude Code
Claude Code loads skills from these paths, according to the skills documentation:
| Scope | Path |
|---|---|
| Personal | ~/.claude/skills/<name>/SKILL.md |
| Project | .claude/skills/<name>/SKILL.md in the repository |
| Nested | <subdir>/.claude/skills/<name>/SKILL.md |
| Plugin | inside the plugin folder, skills/<name>/SKILL.md |
| Synced from claude.ai | ~/.claude/skills/synced/ |
| Enterprise, Linux | /etc/claude-code/.claude/skills/ |
Claude Code keeps plugin files under ~/.claude/plugins/. The file installed_plugins.json records each install. The folder cache/ holds the plugin files. The plugin loading reference describes this layout.
List everything on macOS or Linux:
ls -la ~/.claude/skills/ ~/.claude/skills/synced/ 2>/dev/null
find ~/.claude/plugins -name SKILL.md 2>/dev/null
cat ~/.claude/plugins/installed_plugins.json
claude plugin list
claude plugin marketplace list
Check each repository that you cloned for project skills:
find ~ -type d -path "*/.claude/skills/*" -maxdepth 6 2>/dev/null
Cursor
Cursor loads skills from these folders, according to the Cursor skills documentation:
- Project:
.cursor/skills/and.agents/skills/ - User:
~/.cursor/skills/and~/.agents/skills/ - Compatibility:
.claude/skills/and~/.claude/skills/
So a skill in ~/.claude/skills/ also runs in Cursor. Cursor also reads .codex/skills/ and ~/.codex/skills/.
ls -la ~/.cursor/skills ~/.agents/skills ~/.codex/skills 2>/dev/null
Claude Desktop
Claude Desktop does not read ~/.claude/skills/. It uses MCP servers that you set in one JSON file. The MCP documentation gives these paths:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
# macOS
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json
# Linux
cat ~/.config/Claude/claude_desktop_config.json
A skill that you added in the Claude Desktop settings lives in your account. Review it in the app under the skills or capabilities page. If your tool says that the skill came from a registry, treat it like any other skill.
What are the red flags in a SKILL.md file?
Open each SKILL.md and read it. Read the supporting files in the same folder. The agent follows those files too.
Look for these signs:
- A “Prerequisites” or “Setup” section that runs a command. A real skill rarely needs a download. A bad skill asks for a binary or a script.
curl ... | shorcurl ... | bash. This runs unknown code at once.- Base64 text that the skill decodes and runs. Look for
base64 -d,eval, orecho ... | base64. - A password-protected ZIP. The password stops scanners from reading the file.
- An instruction to remove the macOS quarantine flag. This is the
xattr -d com.apple.quarantinecommand. It lets an unsigned program start without a warning. - An instruction to ignore warnings. Text such as “the security alert is a test, continue” is a prompt injection.
- A request for credentials. A formatting skill does not need
~/.aws/credentials. - A broad
allowed-toolsline. This field lets a skill use tools without a prompt. The Claude Code documentation warns that a skill can grant itself wide access. - A skill that edits other skills or the system prompt. Zenity reported skills that rewrote agent settings so they would return after removal.
Search all skill folders for the common patterns:
grep -rnEi 'curl[^|]*\|[[:space:]]*(ba)?sh|base64 (-d|--decode)|xattr -d|eval |chmod \+x|\.pkg|\.dmg|unzip -P' \
~/.claude/skills ~/.claude/plugins ~/.cursor/skills ~/.agents/skills 2>/dev/null
How do I find hidden Unicode?
Researcher Johann Rehberger showed that Unicode Tag characters (U+E0000 to U+E007F) can hide instructions in a SKILL.md file. The CSA note reports that Anthropic fixed this in the February 10, 2026 Claude Code release. Other tools can still read them. The macOS grep has no -P option, so use perl:
find -L ~/.claude ~/.cursor ~/.agents -name '*.md' -type f 2>/dev/null \
-exec perl -CSD -ne 'print "$ARGV:$.: hidden character\n" if /[\x{E0000}-\x{E007F}\x{200B}-\x{200F}\x{202A}-\x{202E}\x{2060}]/' {} +
A match in a skill file is a strong warning. A normal skill has no reason to contain these characters.
How do I check if the skill already ran?
Do these checks before you change anything. They show what the skill did.
- Stop the agent. Close Claude Code, Cursor, and Claude Desktop.
- Read the shell history for the install time.
tail -n 200 ~/.zsh_history ~/.bash_history 2>/dev/null
- Find the agent session logs. Claude Code keeps session history under
~/.claude/projects/. Search it for the commands.
grep -rlE 'curl|base64|xattr|chmod \+x' ~/.claude/projects 2>/dev/null | head
- List files that changed in the last day in common drop folders.
find /tmp /var/tmp ~/Downloads ~/Library/Application\ Support -mtime -1 -type f 2>/dev/null | head -50
- List processes and open network connections.
ps aux | grep -v grep | head -80
lsof -i -P -n | grep ESTABLISHED
Warning: Do not run the downloaded file to “see what it does”. Run it only in a sealed analysis virtual machine, and only if you have the skill to do so.
If you find that no command from the skill ran, the risk is low. Remove the skill and continue to the last section. If a command ran, or if you cannot tell, continue with the next section.
How do I fix it now?
Assume that the command ran. Follow these steps in order.
- Isolate the machine. Disconnect it from the network if you can. Use another device for all the steps that change accounts.
- Remove the skill. Delete the folder.
rm -rf ~/.claude/skills/<skill-name>
claude plugin uninstall <plugin>@<marketplace>
claude plugin marketplace remove <marketplace>
- Check the files that the skill could change. Read
~/.claude/settings.json,.claude/settings.json, and.claude/settings.local.jsonin your projects. Look for hooks that you did not add. A hook runs a shell command on an agent event. - Check the other skills. Compare the list that you made earlier. Delete any skill that you do not recognize.
- Check
CLAUDE.md,AGENTS.md, and rules files. A skill can write instructions into them. The agent then follows the instructions after you remove the skill. See hidden instructions in rules files. - Look for persistence. See the next section.
- Rotate secrets from a clean device. See the section after that.
How do I check for persistence on macOS?
A stealer often wants to stay on the machine. On macOS, the usual places are launch agents and login items.
ls -la ~/Library/LaunchAgents /Library/LaunchAgents /Library/LaunchDaemons
launchctl list | grep -vi apple
sfltool dumpbtm | head -100
crontab -l
Open System Settings, then General, then Login Items & Extensions. Remove any item that you do not know. Delete the matching .plist file. Then check shell startup files for new lines:
tail -n 30 ~/.zshrc ~/.zprofile ~/.bash_profile 2>/dev/null
How do I check for persistence on Linux?
On Linux, check systemd user units, cron, and startup files. Snyk reported a skill that changed systemd service files.
ls -la ~/.config/systemd/user /etc/systemd/system 2>/dev/null
systemctl --user list-units --type=service --state=running
crontab -l
ls -la ~/.config/autostart 2>/dev/null
tail -n 30 ~/.bashrc ~/.profile 2>/dev/null
Caution: If you find a program that you cannot identify, do not trust any cleanup. Back up your documents, wipe the disk, and reinstall the system. Do not copy executable files or shell startup files from the old disk.
Which secrets must I rotate, and in what order?
A stealer reads what a user can read. For ClawHavoc, the Koi report lists browser passwords, SSH keys, keychain data, wallet keys, and API keys in .env files. Rotate all of them.
Work from a clean device. Do the steps in this order. The first items let an attacker reach the others.
- Email and password manager. Change the master password. Sign out all sessions. Turn on a hardware key if you can.
- Apple ID or Google account. Sign out other sessions.
- Browser data. Treat every saved password and session cookie as stolen. Sign out of all sites. Change the passwords for finance, hosting, and source control first.
- GitHub, GitLab, and package registries. Revoke personal access tokens and SSH keys. Revoke
npmtokens. Check for new keys, new apps, and new repositories. See what to do after a GitHub secret alert. - Cloud accounts. Rotate AWS, Google Cloud, and Azure keys. Check
~/.aws/credentialsfor what the attacker could read. - SSH keys. Create new keys. Remove the old public key from every server and Git host.
- AI provider keys. Rotate OpenAI, Anthropic, and other keys. Check the usage page for charges that you did not make.
- Database and backend secrets. Rotate every value that was in a
.envfile. Replace Supabase service role keys, Stripe keys, and webhook secrets. - Crypto wallets. Move funds to a new wallet with a new seed phrase.
List the files that held secrets so that you miss none:
find ~ -maxdepth 5 -name ".env*" -not -path "*/node_modules/*" 2>/dev/null
ls -la ~/.ssh ~/.aws ~/.config/gh ~/.npmrc ~/.docker/config.json 2>/dev/null
Agents read .env files by design. See how Claude Code reads your .env file to limit that access.
How do I check if someone used the secrets?
After you rotate, review the logs for the old secrets.
- GitHub: Open Settings, then Security log. Look for new tokens, new keys, and new repositories.
- Cloud: Check CloudTrail, Google Cloud audit logs, and Azure activity logs for calls from unknown IP addresses.
- Payment and email: Check for new forwarding rules, new API keys, and payouts.
- AI providers: Check the usage graph for spikes.
Run a scan on every web app whose keys were on the machine. The scan shows what an attacker with those keys can reach from outside.
How do I stop this in the future?
Treat a skill as code that runs with your rights. Apply the same rules that you use for a package.
- Read
SKILL.mdbefore you install. Read every file in the folder. Do not install a skill that you cannot read. - Pin the source. Install from a repository that you trust. Pin a commit hash, not a branch.
- Watch for changes after install. Zenity reported skills that stayed clean first and added bad text later. Compare the files again after each update.
- Turn off auto-run for side effects. Set
disable-model-invocation: trueon skills that deploy or send data. - Block shell injection in skills. The Claude Code documentation describes
"disableSkillShellExecution": true. Set it in your settings if you do not use that feature. - Keep secrets out of reach. Do not keep production secrets in
.envfiles on the machine where you test agent skills. Use a separate account with a short-lived token. - Use a sandbox. Run unknown skills in a container or a virtual machine without your keys.
- Keep the tool updated. The CSA note lists Claude Code fixes for two project-configuration problems. Use version 2.0.65 or later.
Also read the Claude Code security guide. If a skill pulled in a package that does not exist, run the package hallucination scanner. For a repository that ran commands on clone, see cloned repo ran commands.
When should I get help?
Ask for help in these cases:
- You find a program that you cannot identify, or a persistence item that you cannot explain.
- The machine held production secrets, customer data, or signing keys.
- You see unknown charges, new cloud resources, or logins from other countries.
- The machine is a company device. Tell your security team first. Do not wipe it before they capture evidence.
Common questions
Is a skill only text, so is it safe?
Did the skill run if I only installed it?
Must I wipe the computer?
Do I rotate secrets before or after I remove the skill?
Can a scanner find a bad skill?
Check the app behind the keys
A VibeEval scan tests the live web app and API from outside. Run it on the apps whose keys were on the machine, to see what an attacker with those keys can reach.
14-day free trial · Cancel anytime