Today I maintain more than 150 skills, a few subagents and a rules file for every project. I did not start that way. I started by pasting the same text into the chat every time, then I overdid it and created a skill for everything, and I learned the expensive way that each piece has the right moment to be born.
This post is not about what each thing is. It is about when to create each one.
One Line Each
- AGENTS.md or CLAUDE.md: the project rules file, read in every conversation.
- Skill: a folder with a
SKILL.mdthat teaches a procedure. Only the name and description stay loaded all the time; the rest comes in when the topic shows up (Anthropic). - Subagent: a separate agent, with its own context and limited tools, that does the work and hands back only the summary (Claude Code, subagents).
- MCP: the protocol that connects the agent to outside systems, like a database, an APIContract that defines how one program asks another for data or actions: which endpoints to call, what to send and what comes back. On the web, usually HTTP with JSON. or a tool (MCP).
- Hook: a command that always runs at a certain moment, like before a file is edited, without depending on the model to remember (Claude Code, hooks).

Skills vs Agents: When to Create Each One
The Claude Code documentation itself has a similar table, and it is one of the most useful things I have read on the subject (Extend Claude Code). The core idea: do not create ahead of time, create when the signal shows up.
Let's take it piece by piece.
The Agent Broke the Same Rule Twice: AGENTS.md
If the agent used npm for the second time in a project that runs on pnpm, or hardcoded text in a component when the project requires everything to go through the translation file, that rule belongs in the project file.
The catch: this file is read in every conversation. Every line always costs something. Anthropic recommends keeping it under 200 lines and treating changes to it like code, with review. A rule that is a fact ("the project uses pnpm") stays there. A rule that is a procedure ("how to publish a release") does not.
AGENTS.md has become an open standard, read by Codex, Cursor, Copilot, Gemini CLI and many others (agents.md). If you use more than one agent, it pays to keep your rules there. I compared how Codex, Claude Code and Cursor read that file in the article on AI coding agents in a front-end team.
You Pasted the Same Step-by-step for the Third Time: Skill
This is the clearest signal. If you keep pasting the same review checklist, the same deploy script or the same writing pattern, that is a skill waiting to be born.
A practical test I use: if a section of AGENTS.md turned into a step-by-step, it is already a skill. Pull it out and save context in every conversation that does not need it.
What makes a skill work:
- The description is everything. It decides whether the skill gets used at all. A vague description never fires. State the concrete trigger: "use when writing a database migration", not "helps with databases".
- One skill, one job. A skill that tries to solve everything becomes a manual nobody reads.
- A script instead of an explanation, whenever possible. A script runs without taking up context.
You Copy Data from a System the Agent Cannot See: MCP
If you open the database console, copy a result and paste it into the chat, or go to a library's documentation and paste a snippet, the agent needs a connection, not an instruction. That is where MCP comes in.
The difference from a skill, in one sentence from the documentation itself: MCP connects the agent to external services; a skill teaches what it knows, including how to use those services well. Often the two go together. I use an MCP that fetches up-to-date library documentation and a skill that says when it is worth checking it.
A Side Task Floods the Conversation: Subagent
Running a test suite and reading the whole log, sweeping a hundred files looking for a pattern, researching ten pages on the web. All of that fills the main conversation with output you will never read again.
Something Must Happen Every Time: Hook
This is the one most people get wrong. Writing "never edit the .env file" in AGENTS.md or in a skill is a request, not a guarantee. The documentation says it in those exact words.
If the rule can never fail, it has to be deterministic. A hook that runs before every edit and blocks the forbidden file is a guarantee. The line I keep in mind: instructions are there to guide, hooks are there to protect.
The Cost Nobody Mentions: Context
Each piece has a different price in the agent's context:
| Piece | When it takes up context |
|---|---|
| AGENTS.md | In every conversation, in full |
| Skill | Only name and description, until it is used |
| MCP | Tool names; the details come on demand |
| Subagent | Nothing in the main conversation, only the summary that comes back |
| Hook | Nothing, unless it returns some output |

And here is a real number. In Codex, the initial skills index has a cap: 2% of the model's context windowMaximum amount of text, measured in tokens, that a language model can take into account at once, counting both input and output., or 8 thousand characters when that window is unknown (OpenAI, Codex skills). Go past it and it truncates descriptions or leaves skills out.
With more than 150 skills, I hit that cap. The fix was splitting them into profiles: one for UI, one for backend, one for review, a minimal one for short tasks. Each profile loads only the skills for that kind of work. The review profile has two. In one of those measurements, I found out that a single test review skill took up 12% of the whole index, with its description alone. It left the UI profile and moved to the quality one, where it makes sense.
Be Careful with Third-party Skills
And this has already become a real problem. In February 2026, Snyk audited 3,984 public skills and found 76 confirmed malicious ones, most of them using prompt injectionAttack where malicious text in an email, website or document carries instructions the model follows as if they came from the user, hijacking its behavior.; 13.4% had some critical issue (Snyk). OWASP already has its own list of skill risks, with malicious skills at the top (OWASP).
My rule: I read every skill before installing it, and the ones that matter live in my own repository, under version control.
The same care applies to MCP servers installed with npm or pip: look the package up on Snyk or OSV.dev first, and check that the name really is the official project.
A Roadmap to Get Started
- Start with one short AGENTS.md file: how to run, how to test, the three rules that matter most.
- Take note when you paste the same instruction for the third time. That becomes your first skill.
- If you keep copying data from somewhere, look for a ready-made MCP for it before writing your own.
- Use subagents for research and sweeps, not for the main task.
- For what cannot fail, a hook.
- Once a month, review: a skill that never fired goes away or gets a better description.
This way of organizing things fits well with writing the spec before letting the agent code, which I explained in what is spec-driven development (SDD). And if you are torn between building the agent in a visual tool or in code, I wrote about n8n vs AI agents in code.
It is the kind of structure I set up in AI agents for companies and in AI automation.
Frequently Asked Questions
When to create a skill vs an agent?
Create a skill when you keep repeating the same procedure. Create a subagent when a side task pollutes the conversation or needs limited tools. A fixed project rule goes into AGENTS.md, an external connection is MCP and a guarantee is a hook.
What is the difference between a skill and MCP?
MCP gives access to an outside system. A skill teaches a procedure, including how to use that access. One does not replace the other.
Do skills work outside Claude Code?
Yes. Agent Skills became an open standard in December 2025, and Codex, Cursor, Copilot and others read the same format.
How many skills is too many?
When they start not being found, or the agent loads the wrong one. In Codex, there is a character cap for the index. If you went past it, split them into profiles by kind of work.
References
- Anthropic. Equipping agents for the real world with Agent Skills, Oct. 2025.
- Claude Code. Extend Claude Code, skills, subagents and hooks.
- Claude Blog. Steering Claude Code: skills, hooks, rules, subagents and more, Jun. 2026.
- OpenAI. Codex skills.
- AGENTS.md, Agent Skills and Model Context Protocol.
- Snyk. ToxicSkills: malicious AI agent skills, Feb. 2026.
- OWASP. Agentic Skills Top 10.
- André Baltieri. Agents ou Skills: qual escolher? (in Portuguese), Apr. 2026.
- Pedro Assis, Distrito. Agent Skills: o que são e como funcionam (in Portuguese), Mar. 2026.
- Henrique Custódia, Code Dimension. Skills com agentes de IA (in Portuguese), Jul. 2026.