Questions

Can a Claude skill run code?

A skill can carry executable code under scripts/, and the agent may run it when the task calls for it. The skill does not run on its own and has no background process. It is the agent that executes, under whatever permissions your setup gives it.

What scripts are for

Scripts belong in a skill when a step is deterministic and better done by code than by prose: parsing a file format, validating a structure, converting between two representations. Writing it as a script instead of as instructions removes the chance that the agent improvises a slightly different procedure each time.

The permission question is separate

There is an allowed-tools field that takes a space separated list of pre approved tools, but the specification marks it experimental and support varies between agent implementations. Do not treat it as a security boundary. The boundary is whatever your agent asks you to approve at the moment it wants to run something.

Which is why installation deserves a read

Because a skill can ship code that an agent may execute, an unread skill from an unknown author is a real risk rather than a theoretical one. Look at scripts/ before installing, prefer skills whose source you can inspect, and be more careful with a skill than you would be with a configuration file.