Loading

Configuration and multi-file skills

Split a large Claude Code skill across supporting files, to save context window space.

4 minClaude Code
Loading

Configuration and multi-file skills · 4 min

Correction: The video says allowed-tools restricts which tools Claude can use. It doesn't. The words in brackets, at 0:40, 1:20, and 3:35, correct what the video says.

A basic skill works with just a name and description, but here are some other advanced tips that can make your skills really effective in Claude Code. The agentskills.io open standard has many available fields. We already went over the name, which identifies your skill, uses lowercase letters, numbers, and hyphens only, a maximum of 64 characters and should match your directory name, a description, which is also required, which tells Claude when to use the skill. This is a maximum of 1,024 characters and is the most important field. Claude uses this for matching, but we can also add other optional fields. One of them is the allowed tools field, [which pre-approves tools so Claude can use them without asking during the turn that invokes the skill]. The model field, which specifies which Claude model to use for the skill.

Try to be explicit with your instructions. For example, if someone told me my job was to help with docs, I wouldn't know what to do. So we have to assume Claude would think the same way. A good description answers two questions. What does this skill do? And when should Claude use it? Now, if this job description was given to me, I'd feel a little bit more confident that I could get the job done. If your skill isn't triggering, add more keywords that match how you phrase requests.

[Some skills use the same few tools every run, and you don't want to approve each call. The allowed-tools field pre-approves them. Claude can still use other tools, and those follow your normal permission settings. To take a tool away, use a different field, disallowed-tools. If you omit allowed-tools,] Claude uses its normal permission model.

Skills share Claude's context window with your conversation. When Claude wants to use a skill, it will decide to load the contents of that skill into context. However, sometimes you'll need some references, examples, or some utility scripts that are required by the skill. But cramming it all into one 2000 line text file means you take up a lot of space in the context window. And let's be real here, it's just not a lot of fun to maintain that. This is where progressive disclosure comes in. Put your essential instructions in SKILL.md and detailed reference material in separate files that Claude reads only when needed.

The open standard also suggests having a scripts folder for executable code, references for additional documentation, and assets for images, templates, or other data files that would be relevant for that skill. Then, in SKILL.md, link to the supporting files. Here, Claude reads architecture.md only when someone asks about system design. If they're asking where to add a component, let's say, it just never loads. It's like having a table of contents in the context window rather than fitting the whole entire document in there. Keep SKILL.md under 500 lines. If you're exceeding that, then maybe consider, should this be split up into different content?

Scripts in your skill directory can run without loading their contents into context. The script executes and only the output consumes tokens. Tell Claude to run the script, not read it. This is very useful for environment validation, data transformations that need to be consistent, operations that are more reliable as tested code than generated code.

Skills support metadata fields. Name and description, which are required. [Allowed tools pre-approves tools.] And model specifies which Claude model to use. Descriptions need specific actions and trigger phrases to match for reliability. For larger skills, use progressive disclosure. Keep your SKILL.md file under 500 lines and link to the supporting files that load only when needed. Scripts can execute without loading their contents, keeping context efficient.