If you’re using tools like Claude Code, GitHub Copilot Workspace, or similar, you’ve probably noticed there’s technical jargon that goes beyond simply “chatting with AI”. I’m talking about terms like rules, commands, skills, MCP, and hooks.
These concepts are the architecture that makes AI agents truly useful for software development. They’re not just fancy marketing words — each one serves a specific function in how the agent works.
Let’s break them down one by one in a clear way.
First things first: What is an AI Coding Agent?
An AI coding agent is a system that doesn’t just answer questions, but executes actions in your codebase. It can read files, modify code, run commands, and make decisions based on context.
The key difference from a normal chatbot: an agent has tools and can operate autonomously within certain limits.
Now, let’s dive into the concepts that make these agents work.
Rules: Permanent Instructions
Rules are instructions that you configure once and the agent respects always, in every interaction. Think of them as the agent’s global configuration.
What they’re for
Rules define:
- What the agent should do
- What it should NOT do (limitations)
- How to behave in specific situations
- Preferred output formats
- Security precautions
Real example
Imagine you’re working on a Laravel project and you have a rule that says:
Always use Laravel factories to generate test data, never use hardcoded data or direct SQL inserts.
This means that every time the agent needs to create tests or sample data, it will automatically use factories without you having to remind it.
When to use rules
Use rules when:
- ✅ You have restrictions that apply always
- ✅ You want consistency across all responses
- ✅ You need guard rails to prevent unwanted behavior
- ✅ You have format preferences that must always be respected
Where to configure them
Depending on the tool, rules can be in:
- Configuration files (eg:
CLAUDE.mdfor Claude Code) - Application settings
- Specific project files
Commands: Shortcuts for Recurrent Tasks
Commands are predefined shortcuts that execute a specific task. They’re like macros: a command that triggers a complex sequence of actions.
How they work
When you invoke a command, the agent:
- Expands the command into its full prompt
- Executes the associated task
- Returns the result to you
Real example
If you have a /commit command, the agent could:
- Read git status
- Analyze changes
- Generate a descriptive commit message
- Execute
git commitwith that message
All this with a single command: /commit.
Types of commands
There are two main categories:
1. Built-in commands (come with the tool)
/help- Shows help/clear- Clears context/commit- Creates commits (in some tools)
2. Custom commands (you define them)
/review- Reviews current code/test- Generates tests for what you’re editing/deploy- Runs your deployment pipeline
Advantages of using commands
- Speed: You don’t have to write the same prompt over and over
- Consistency: It’s always done the same way
- Documentation: Commands serve as documentation of your workflow
- Hidden complexity: You can chain many actions in a simple command
When to create commands
Create commands for:
- ✅ Tasks you repeat frequently
- ✅ Multi-step processes that are always done the same way
- ✅ Complex workflows you want to simplify
Skills: Specialized Capabilities
Skills are packages of knowledge and capabilities that an agent can load on demand. Think of them as plugins or extensions: the agent has them available, but only uses them when you need them.
Difference vs commands
- Commands: Execute a specific task
- Skills: Add new capabilities to the agent
A skill can include multiple commands, rules, and specialized logic.
Real example
A “code-review” skill could include:
- Knowledge about clean code patterns
- Rules for what to check first
- Commands for security analysis
- Logic to prioritize critical issues
- Specific report format
Common skills in current tools
- Git management: Commits, branches, PRs
- Testing: Test generation, execution, coverage
- Documentation: Generating docs, updating READMEs
- Security: Vulnerability scanning
- Refactoring: Improving existing code
- Database: Migrations, queries, optimization
Why skills matter
Skills allow:
- Specialization: The agent knows about specific domains
- Composability: Combine skills for complex tasks
- Updates: You can improve skills independently
- Sharing: You can distribute skills to your team
When to use skills
Use skills when:
- ✅ A domain requires specialized knowledge
- ✅ You want to share capabilities across different agents
- ✅ You need to update knowledge without changing the core
MCP: Model Context Protocol
MCP (Model Context Protocol) is an open standard that allows AI agents to connect with external tools and data sources in a standardized way.
The problem it solves
Before MCP, each AI tool had its own format for connecting with things:
- Reading filesystem files
- Querying databases
- Making HTTP calls
- Running commands
It was chaos. Every integration was ad-hoc.
The MCP solution
MCP defines:
- How the agent communicates with a tool
- What information is passed (inputs/outputs)
- How errors are handled
- How available capabilities are discovered
Real example
Imagine an MCP server that exposes database access:
# The MCP server exposes tools
tools:
- name: "query_database"
description: "Executes SQL queries in the database"
input_schema:
type: "object"
properties:
query:
type: "string"
description: "SQL query to execute"
The agent can:
- Discover that this tool exists
- Know how to use it (what inputs it accepts)
- Execute queries safely
- Receive structured results
MCP Servers
An MCP server is a program that exposes functionality through the MCP protocol. It can be:
- Local: Runs on your machine
- Remote: Runs on a server
- Hybrid: Mix of both
Examples of MCP servers:
- Filesystem: Read/write files
- Database: SQL queries
- Git: Repository operations
- API: Calls to external services
- Memory: Persistent storage for the agent
Advantages of MCP
- Open standard: You’re not vendor-locked
- Community: There are hundreds of MCP servers already created
- Security: You control what tools the agent can use
- Composability: Combine multiple MCP servers
- Extensible: Easy to create new servers
Why MCP is important for AI Coding Agents
MCP allows agents to:
- Read your code (filesystem server)
- Understand your git history (git server)
- Query documentation (docs server)
- Run tests (test runner server)
- Connect to APIs (HTTP server)
All this in a standardized and secure way.
Hooks: Event-Based Customization
Hooks are insertion points where you can execute custom logic in response to specific events in the agent’s lifecycle.
How they work
A hook is defined as:
- When to execute (which event)
- What to execute (command or script)
- How to use the result (modify behavior)
Real example
A pre-commit hook could:
- Detect that the agent is about to commit
- Run a linter on changed files
- If there are errors, prevent the commit
- If everything is fine, allow the commit
Types of common hooks
1. Lifecycle hooks
before-work- Before starting a taskafter-work- After completing a taskbefore-edit- Before modifying a fileafter-edit- After modifying a file
2. Event hooks
on-error- When something failson-success- When something succeedson-retry- When something is retried
3. Tool-use hooks
before-command- Before executing a commandafter-command- After executing a commandbefore-tool-use- Before using a toolafter-tool-use- After using a tool
What to use hooks for
Hooks are useful for:
- Validation: Verify that the agent does the right thing
- Logging: Register what the agent does
- Modification: Change behavior based on context
- Integration: Connect with external tools
- Security: Prevent dangerous actions
Audio hook example (my personal configuration)
A practical use of hooks is receiving audio feedback when the agent performs actions. In my Claude Code configuration I have hooks that play sounds:
{
"hooks": {
"Notification": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "afplay /System/Library/Sounds/Funk.aiff"
}
]
}
],
"Stop": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "afplay /System/Library/Sounds/Hero.aiff"
}
]
}
]
}
}
This means:
- Every time there’s a notification, a “Funk” sound plays
- When the agent finishes its work, a “Hero” sound plays
It’s a simple but effective way to know what the agent is doing without constantly looking at the screen.
Security hook example
hooks:
before-tool-use:
- if: tool.name == "bash" && command.contains("rm -rf")
then: block("rm -rf not allowed without explicit confirmation")
This hook prevents the agent from executing dangerous commands without approval.
Hooks vs Rules
| Aspect | Rules | Hooks |
|---|---|---|
| When applied | Always, in every interaction | At specific events |
| Purpose | General behavior | Response to events |
| Flexibility | Static | Dynamic, can evaluate context |
| Example | “Don’t use words in images” | “Before running bash, verify the command” |
How everything works together
The interesting thing isn’t each concept separately, but how they work together.
Example: A complete workflow
Imagine you tell your agent: “Add authentication to this API endpoint”.
This could trigger:
- Hook
before-work: Verifies you have the necessary permissions - Rule: The agent knows it should use JWT, not sessions (global configuration)
- Command
/auth-boilerplate: Expands an authentication code template - Skill
laravel-auth: Applies Laravel-specific knowledge - MCP server
docs: Queries official Laravel documentation - MCP server
git: Verifies you’re not modifying protected files - Hook
after-edit: Runs automatic tests after each modified file - Hook
before-command: Before executingphp artisan migrate, asks for confirmation
All this without you having to specify each step.
Final analogy: The agent as a junior developer
To understand it all together, think of an AI agent as a very capable junior developer:
- Rules = Your team’s guidelines (coding standards, processes)
- Commands = The scripts and shortcuts you use daily
- Skills = The specialized technologies they know (React, Laravel, Docker)
- MCP = The tools they have available (IDE, terminal, APIs)
- Hooks = Code reviews and checkpoints during development
The difference is this “junior”:
- Works 24/7
- Doesn’t get tired
- Executes instantly
- Has access to your entire codebase at once
- Can read documentation faster than any human
Tools that use these concepts
Claude Code
- Rules:
CLAUDE.mdandCLAUDE.local.mdfiles - Commands:
/commit,/help, etc. - Skills: Built-in, with more coming
- MCP: Full support for MCP servers
- Hooks: Configurable for lifecycle events
GitHub Copilot Workspace
- Rules: Per-repository configuration
- Commands: Predefined workflows
- Skills: Integrated with GitHub ecosystem
Cursor
- Rules: Per-project configuration
- Commands: Customizable shortcuts
- MCP: Growing support
Conclusion
Rules, commands, skills, MCP, and hooks are not just technical jargon. They’re the building blocks that make AI agents useful for real software development.
Understanding these concepts allows you to:
- Configure your tools better
- Automate repetitive workflows
- Integrate the agent with your existing stack
- Maintain control over what the agent does
AI won’t replace developers. But developers who understand how to configure and use these agents will be much more productive.
In 2026, understanding how to work with AI agents is increasingly valuable.





