Claude: The Hidden Power of claude.md and Skills

Rishav Sinha
Published on · 5 min read

The Confusion
When I first started playing with Claude and other large language models, my mental model was simple: one giant text box for instructions, and then your prompt. If I wanted it to do something complex, I'd just cram more instructions into that initial system prompt. Need it to access the web? Describe how to do it. Need it to summarize a document? Give it examples. It felt clunky, and the results were often inconsistent, especially as the complexity grew.
Then I stumbled upon mentions of files like claude.md and a mysterious skills directory when exploring more advanced Claude usage. My immediate thought was, "What are these? Why aren't I just using the API directly?" It wasn't immediately obvious how these external files were supposed to integrate or why they were better than just a really long prompt. I wasted a bunch of time trying to duct-tape complex behaviors into single prompts, getting frustrated when Claude either hallucinated or just missed the point entirely. It felt like there was a secret handshake I wasn't privy to.
The Plain-English Explanation
Imagine Claude as a very intelligent chef. When you give them an order, they need to know their general culinary philosophy and have access to specific recipes.
-
The
claude.mdfile is like the chef's foundational cookbook. It doesn't contain specific recipes for a single dish, but rather the core principles of their cooking style. "I am a helpful and friendly chef," it might say. "My goal is to create delicious meals, always considering dietary restrictions." This file defines Claude's overarching persona, its general goals, and any fundamental instructions that always apply. It's the persistent "system prompt" that dictates Claude's core identity and behavior. It's always loaded and guides every interaction. -
The
skillsdirectory is like the chef's collection of specialized recipe cards. Each file inside this directory (ee.g.,make_pasta.py,bake_cake.md,calculate_portions.js) is a specific capability or "skill" that the chef can pull out when needed. If a customer asks for pasta, the chef knows to look for their "make pasta" recipe card. These skills are optional and Claude decides when to use them based on the conversation context. They can be simple markdown files with predefined responses, or complex Python scripts that interact with external APIs (like a weather API or a calculator). They empower Claude to do things beyond just talking.
In short, claude.md sets the stage and persona, while the files in skills provide specific tools or knowledge that Claude can dynamically choose to employ.
The Smallest Working Example
Let's set up a super simple Claude project that uses both a claude.md and a couple of .md based skills. This will show you how these files are structured and what they contain.
First, create a project directory, and inside it, create a skills sub-directory:
# Project Directory Structure
.
├── claude.md # Defines Claude's core persona and instructions
└── skills/ # Directory to hold all specialized skills
├── tell_joke.md # A skill to tell a random joke
└── give_fact.md # A skill to provide an interesting fact
Now, let's put some content into these files.
# claude.md
# This file sets Claude's overall persona and capabilities.
You are a friendly and engaging assistant named HelperBot.
Your primary goal is to provide information, tell jokes, and share interesting facts.
You can use your 'tell_joke' and 'give_fact' skills when appropriate.
Always be polite and helpful.
# skills/tell_joke.md
# This skill tells a family-friendly joke.
# Skill: Tell Joke
## Parameters
None
## Example Usage
User: Tell me a joke!
Claude: Why did the computer go to the doctor?
Because it had a virus!
# skills/give_fact.md
# This skill provides a random interesting fact.
# Skill: Give Fact
## Parameters
None
## Example Usage
User: Can you give me an interesting fact?
Claude: Did you know that a group of owls is called a parliament?
When you interact with Claude with this setup (e.g., via the Anthropic console or API, providing the claude.md and skills directory), Claude will first understand its identity as "HelperBot" from claude.md. If you then say, "Tell me a joke," Claude will infer that you want to use its tell_joke skill and respond with the content defined in tell_joke.md. Similarly for "give me an interesting fact." This separation makes Claude's behavior modular and much easier to manage than one giant prompt.
What to Build Next
Now that you've seen how claude.md and the skills directory work, here's a concrete next step:
- Create your own Claude project: Start a new directory. Define a specific persona in your
claude.md– maybe a "Code Debugger Bot" or a "Recipe Assistant." Give it clear instructions on its purpose and tone. - Add a simple text-based skill: Create a
skills/hello_world.mdfile. This skill could simply greet the user in a specific way or provide a static piece of information relevant to your bot's persona (e.g., for a "Code Debugger Bot," askills/common_errors.mdthat lists common Python syntax errors). - Explore Python skills: Once comfortable with text-based skills, try creating a basic Python skill (
.pyfile) that performs a simple calculation or fetches data from a free API (like a dummy JSON API). This is where the real power of extending Claude's capabilities comes into play. You can look into the official Anthropic documentation for how to define inputs and outputs for Python-based tools.
Understanding these file types is fundamental to building more capable, structured, and predictable AI assistants with Claude. It’s a game-changer for moving beyond basic prompts to truly engineered AI behaviors.