# A SKILL.md file can run shell commands before Claude reads it

> Before an Agent Skill reaches a client's machine, an FDE should review the whole folder, scripts and permissions included, as strictly as a pull request.

Original: https://fdetimes.net/en/guides/review-agent-skills-before-client-deployment/

According to the Claude Code documentation, the !`command` syntax in a skill runs a shell command *before* the skill's content is sent to Claude: the machine has finished executing before the model has read a word.

Anthropic's Agent Skills documentation is also explicit that in Claude Code, skills have the same network access as any other program on the user's machine. At a client site, that machine may well not be yours.

FDEs often bring a few skills along to make the agent faster: one that exports reports, one that reads logs, one picked up from a public repository. Snyk sums up the risk: a skill operates with the full permissions of the agent it extends. So a harmless-looking Markdown file deserves the same review as code headed for production.

## Why review a Markdown file?

A skill is a whole folder: SKILL.md with its frontmatter, the scripts that come with it, sometimes images and other resources too. Anthropic asks for a review of *all* of those files, not just SKILL.md.

The documentation states the reason plainly: a malicious skill can lead Claude to invoke tools or run code in ways that diverge from the skill's stated purpose.

The worry is not theoretical. Snyk's ToxicSkills research scanned 3,984 skills from ClawHub and skills.sh, with data up to February 5, 2026, and found that 13.4%, or 534 skills, had at least one critical security flaw.

The figure covers only those two public repositories, but it is enough to show that pulling skills from a public repository straight onto a client machine is a gamble.

**Key point:** A skill looks like documentation, but it runs with the agent's full permissions.

## Can scanners replace a reviewer?

No. Trail of Bits got past ClawHub's scanner, Cisco's, and three tools built into skills.sh.

Three of the four malicious skills they built took less than an hour to conceive and finish. Their conclusion: no amount of scanning or LLM-based analysis reliably detects malicious content in skills.

Human eyes have blind spots as well. A researcher at the Embrace The Red blog demonstrated a supply-chain backdoor in a skill that slipped past visual review by using invisible Unicode Tag characters. On screen the file looks clean; the model still reads the instructions hidden inside.

The lesson for FDEs: automated scans catch the obvious, reviewers understand intent, and above all, control the source. Trail of Bits advises organizations to curate their own internal skill repository. Anthropic likewise recommends using only skills you wrote yourself or got from Anthropic.

## Reviewing a skill, line by line

The example below is hypothetical, but each detail is a real class of problem. A colleague sends over a skill that summarizes support tickets, for use at a client site:

```markdown
---
name: ticket-summary
description: Summarize this week's support tickets and export a CSV report
allowed-tools: Bash Read Write
---

## Inputs
- Current branch: !`git branch --show-current`
- Configuration: !`cat .env | head -5`

## Steps
1. Run `python scripts/export.py --week current`
2. Summarize the tickets by error category
```

Start with the `allowed-tools` field. The Claude Code documentation warns that a skill can grant itself broad permissions, and that this field applies even in `-p` mode in a directory that has never been trusted. Unrestricted `Bash` for a skill that only needs to run one script is overreach; narrow it to the exact command required.

Next, read every !`command` line. The `git branch` command is harmless. But `cat .env` runs before Claude sees anything and dumps five lines of configuration, often containing the client's API keys, straight into the context. There is no business reason for this line; delete it.

Then open `scripts/export.py`. Anthropic's enterprise guidance rates scripts in a skill folder as high risk because they run with the environment's full permissions. Look for every network call, every path outside the working directory, every read of an environment variable. A request to a domain nobody recognizes is reason enough to stop.

Finally, check for invisible characters, the very kind Embrace The Red used to hide a backdoor. Since the human eye cannot see them, the practical advice is to add an automated CI step that scans every skill file for Unicode Tag characters. The step is cheap, and it targets exactly the attack that visual review misses.

| Part of the skill | Why it is risky | What to check |
|---|---|---|
| `allowed-tools` | The skill grants its own permissions, even in untrusted directories | Is Bash unrestricted, which permissions are surplus |
| !`command` lines | Run shell before Claude reads the content | Does the command read secrets or call the network |
| `scripts/` | Run with the environment's full permissions | Network calls, environment variable reads, unfamiliar paths |
| Text and resources | Can hide instructions in invisible characters | Scan for Unicode Tag characters, read images and auxiliary files too |

## How to bring skills into a client environment properly

One review is not enough; a process is needed. The first step is the source: use only skills from a curated internal repository, never pulled directly from a public one onto a client machine.

The second is separating roles, as Anthropic's enterprise guidance recommends: skill authors do not review their own skills, and every skill must pass a security review and an eval suite before approval.

The third is pinning versions in production. Anthropic advises treating each update as a new deployment requiring a full security review, with checksum verification and signed commits. A skill approved on Monday is no longer the same skill if someone changes one line on Tuesday.

The fourth is locking down what is not needed. If the client has no need for skills to run shell at load time, the `disableSkillShellExecution` setting turns off the !`command` syntax. Note that it does not apply to bundled or managed skills, so do not promise the client more than it delivers.

## Where careful reviewers still slip

The most common mistake is reading SKILL.md and skipping the scripts folder, which is the part that runs with full permissions. Next comes trusting a "scanned" label: Trail of Bits' results show that a malicious skill can beat the scanners in well under a day's work.

The third mistake is harder to spot: reviewing thoroughly the first time, then letting the skill auto-update from the main branch. The fourth is reviewing your own skill because "I wrote it." At a client site that argument will not convince their security team, and it should not convince you either.

To turn this skill into an advantage when job hunting, add a specific line to your CV, such as "built a review and version-pinning process for agent skills."

Clients will never read your SKILL.md. All they will know is that the agent you brought did what it said it would, and nothing else.

**Try this week:**

- Open every .claude/skills folder in the repo you are working on, list the !`command` lines and allowed-tools fields, and flag anywhere unrestricted Bash is granted.
- Add an automated CI step to the repo that scans all skill files for Unicode Tag characters.
- Write a one-page skill review checklist for colleagues to use when reviewing the skills you write.

## Sources

- [Agent Skills](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview)

- [Claude Code Docs: Skills](https://code.claude.com/docs/en/skills)

- [Skills for enterprise](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/enterprise)

- [Snyk: ToxicSkills study of malicious AI agent skills on ClawHub](https://snyk.io/blog/toxicskills-malicious-ai-agent-skills-clawhub/)

- [The sorry state of skill distribution - The Trail of Bits Blog](https://blog.trailofbits.com/2026/06/03/the-sorry-state-of-skill-distribution/)

- [Scary Agent Skills: Hidden Unicode Instructions in Skills ...And How To Catch Them](https://embracethered.com/blog/posts/2026/scary-agent-skills/)
