How to Install and Use Agent Skills with Claude Code

Learn how to extend Claude Code with agent skills. Install, create, and manage skills from ClawHub to supercharge your AI coding agent.

·8 min read

What Are Agent Skills?

Agent skills are reusable capability modules that give your AI agents specialized abilities. Think of them as plugins for your AI — each skill teaches your agent to do something new.

With skills, Claude Code can: - Analyze logs for errors and patterns - Check weather and forecasts - Generate images with AI - Analyze security of your deployments - Post to social media and manage content - Access specialized APIs and tools

How Skills Work

┌─────────────────┐     Skills Directory      ┌─────────────────┐
│                 │    ┌───────────────┐       │                 │
│  Claude Code    │◄──►│ skill-a/      │       │  OpenClaw       │
│  (via OpenClaw) │    │ skill-b/      │       │  Gateway        │
│                 │    │ skill-c/      │       │                 │
└─────────────────┘    └───────────────┘       └─────────────────┘

Skills are defined as markdown files with structured metadata. When an agent needs a capability, OpenClaw loads the relevant skill instructions.

Installing Skills from ClawHub

ClawHub is the official marketplace for agent skills.

Using the CLI

# Install via clawhub CLI
npx clawhub install weather
npx clawhub install healthcheck
npx clawhub install log-analyzer

# Search for skills npx clawhub search "security" npx clawhub search "coding"

# List installed skills npx clawhub list

# Update all skills npx clawhub update

Manual Installation

# Clone a skill repository
git clone https://github.com/openclaw/skills/weather.git ~/.openclaw/skills/weather/

# Skills are auto-discovered from the skills directory # Each skill has a SKILL.md that defines its behavior

Using Skills with Claude Code

Once installed, skills are available whenever you run Claude Code through OpenClaw:

# Claude Code automatically uses installed skills
# The "log-analyzer" skill activates when you say:
claude "Analyze the logs in /var/log/myapp/ for errors"

# The "weather" skill activates when you ask: claude "What's the weather in Tokyo?"

# The "healthcheck" skill runs security audits: claude "Run a security check on this server"

How Skills Activate

Skills work through contextual activation — they're triggered when your request matches their description:

# In a skill's SKILL.md
name: log-analyzer
description: "Analyze log files for errors, patterns, and issues"

When you ask Claude Code to "analyze logs," OpenClaw recognizes the intent and loads the log-analyzer skill into the agent's context.

Real-World Skill Workflows

Workflow 1: Development + Security

# Set up a recurring security check
# The healthcheck skill audits your server weekly
# It checks: SSH config, firewall, open ports, updates

openclaw cron add \ --schedule "0 9 1" \ --task "Run a full security audit on this server. Check for common vulnerabilities and outdated packages."

Workflow 2: Content + Weather

# Daily content generation with context
claude "Check the weather for tomorrow in Shanghai, 
then draft a social media post about how the weather 
affects coding productivity today."

Workflow 3: Multi-Skill Automation

# Combine skills for complex workflows
claude "1. Check the server health (healthcheck skill)
2. Analyze today's application logs (log-analyzer skill)
3. If any critical errors found, create a summary report
4. Check the weather for tomorrow (weather skill)
5. Compile everything into a daily ops report"

Creating Your Own Skills

You can create custom skills for your specific needs. A skill is just a directory with a SKILL.md file:

mkdir -p ~/.openclaw/skills/my-custom-skill

Create SKILL.md:

---
name: my-custom-skill
description: "Analyze PostgreSQL query performance and suggest indexes"
---

# PostgreSQL Query Analyzer

When to activate

When user asks about database performance, slow queries, or indexing

Instructions

1. Connect to the database using the connection string 2. Run EXPLAIN ANALYZE on identified slow queries 3. Check for missing indexes using pg_stat_user_indexes 4. Suggest index optimizations based on query patterns 5. Generate CREATE INDEX statements

Example prompts

- "Why is this query slow?" - "Which indexes should I add?" - "Analyze the database performance"

That's it. Your skill is now available to Claude Code.

Publishing Skills to ClawHub

Share your skills with the community:

# Login to ClawHub
npx clawhub login

# Publish your skill npx clawhub publish ~/.openclaw/skills/my-custom-skill

# Update a published skill npx clawhub update my-custom-skill

| Skill | Description | Use Case | |-------|-------------|----------| | healthcheck | Security audit and hardening | Server security checks | | log-analyzer | Log pattern matching and analysis | Debugging production issues | | weather | Current weather and forecasts | Planning, content generation | | feynman | Richard Feynman's thinking framework | Complex problem analysis | | elonmusk | First-principles thinking | Cost analysis, innovation | | naval | Wealth and leverage framework | Business strategy | | tmux | Remote terminal control | Managing servers | | clawhub | Skill marketplace management | Skill lifecycle |

Best Practices

1. Keep Skills Focused

Each skill should do one thing well. A skill that "analyzes logs AND checks weather" is too broad.

2. Use Clear Activation Triggers

---
# Good: clear activation
name: log-analyzer
description: "Analyze log files for error patterns and anomalies"
---

3. Include Examples

Example prompts that activate this skill

- "Check the error logs for today" - "Find patterns in the application logs" - "Analyze server logs for security issues"

4. Version Your Skills

---
name: my-skill
version: 1.2.0
---

Troubleshooting

Skill Not Loading

# Check if skill is installed
ls ~/.openclaw/skills/

# Verify SKILL.md format cat ~/.openclaw/skills/my-skill/SKILL.md

# Check OpenClaw logs for errors openclaw logs --level debug

Skill Fails to Execute

# Test the skill's core functionality directly
# Most skills require specific tools or APIs
# Check the skill's requirements section in SKILL.md

Summary

Agent skills transform Claude Code from a general-purpose AI into a specialized assistant for your exact needs. Combined with OpenClaw's skill management, you can build a custom toolset that handles everything from security audits to weather forecasts.

Start small. Install 2-3 skills that solve your immediate problems. Then expand as you discover new needs.

---

New to Claude Code? Install it first. Using OpenClaw? Learn how to set up Claude Code with OpenClaw.

Ad Unit Placeholder

Related Articles