Applied Intelligence
Module 11: Skills, Hooks, and Automation

Built-in Skills and Slash Commands

The command layer

Before custom skills became widespread, both Claude Code and Codex shipped with built-in commands that handle common workflows. These commands remain useful even with full skill systems in place. Some have been reimplemented as skills internally, while others remain hardcoded for performance or security reasons.

Understanding the built-in command vocabulary helps in two ways. First, built-in commands handle frequent operations more reliably than custom alternatives. Second, knowing what the platform provides prevents reinventing functionality that already exists.

Claude Code slash commands

Claude Code organizes built-in functionality into slash commands invoked by typing / followed by the command name. The commands fall into several categories.

Session management

CommandPurpose
/clearRemove all conversation history, keeping project context
/compact [instructions]Compress history while preserving specified information
/rewindRestore to a previous checkpoint in conversation or code
/resume [session]Continue a previous session by ID or name
/rename <name>Give the current session a memorable name
/export [filename]Save conversation to a file or clipboard

The /compact command accepts optional focus instructions. When context grows large, /compact preserve: authentication flow, API decisions tells the compaction algorithm what matters most. Without guidance, the algorithm makes its own choices about what to summarize away.

Information and status

CommandPurpose
/helpDisplay command reference and usage information
/statusShow version, model, account, and connectivity details
/contextVisualize current token usage as a colored grid
/costDisplay token usage statistics for the session
/usageShow plan limits and rate limit status (subscription only)
/statsDisplay daily usage, session history, and model preferences
/tasksList and manage background tasks
/todosShow current TODO items being tracked

The /context command is particularly useful during long sessions. It renders a visual breakdown of how context window capacity is being consumed: project files, conversation history, tool results, and agent overhead. When context approaches capacity, this visualization helps identify what to compact or clear.

Configuration and setup

CommandPurpose
/configOpen the settings interface
/initCreate a starter CLAUDE.md file from codebase analysis
/memoryView and edit loaded memory files
/permissionsView or modify tool permissions
/hooksConfigure automation hooks through interactive menu
/modelSwitch the active model
/themeChange the color theme
/statuslineConfigure the status line UI display
/mcpManage MCP server connections and OAuth

The /init command deserves special mention. Running it in a new project generates a starter CLAUDE.md by examining package files, configuration, directory structure, and code patterns. The generated file provides a reasonable starting point that teams then customize.

Advanced features

CommandPurpose
/planEnter plan mode for structured task breakdown
/doctorCheck installation health and diagnose issues
/teleportResume a remote session from claude.ai (subscribers only)

Quick prefixes

Beyond full commands, Claude Code supports shorthand prefixes:

PrefixEffect
!Execute the following as a bash command directly
@Attach a file path with autocomplete
#Add a quick memory note (e.g., # Use 2-space indentation)

These prefixes reduce friction for common operations without invoking the full command system.

Codex interactive commands

Codex provides a parallel command vocabulary with some overlap and some unique functionality.

Session commands

CommandPurpose
/newStart a new conversation in the same CLI session
/forkFork current conversation into a new thread
/resumeResume a saved conversation from session list
/exit or /quitTerminate the session

Information commands

CommandPurpose
/statusDisplay configuration and token usage
/diffShow Git diff including untracked files
/mcpList configured MCP tools
/feedbackSend logs to maintainers

Configuration commands

CommandPurpose
/approvalsSet what Codex can do without asking (Auto, Read-only, Full Access)
/modelChoose active model and reasoning effort
/initGenerate an AGENTS.md scaffold
/mentionAttach a file to the conversation
/reviewAsk Codex to review your working tree with configurable presets
/compactSummarize visible conversation to free tokens
/logoutSign out of Codex

The /approvals command controls Codex's autonomy level mid-session. Switching between Auto, Read-only, and Full Access adjusts what actions require explicit confirmation.

Skill invocation

Codex uses the $ prefix for skills rather than /:

# Invoke a skill in Codex
$skill-creator     # Create new skills from natural language
$skill-installer   # Download skills from curated repository
$create-plan       # Research and create implementation plans

This syntactic difference matters when working across both platforms. Claude Code skills invoke with /skill-name. Codex skills invoke with $skill-name.

Document manipulation capabilities

Both platforms support working with common document formats, though the implementation differs.

PDF handling

Claude Code natively reads PDF files through its Read tool. The process involves rasterizing each page to a high-resolution image while extracting text. For scanned documents, OCR applies automatically.

# In Claude Code, just reference the PDF
"Analyze the quarterly report in reports/Q4-2025.pdf"

No special skill or MCP server required for reading. The agent receives both visual layout and extracted text, enabling analysis of charts, tables, and formatted content.

Limitations for native PDF reading:

  • Maximum request size: 32MB
  • Maximum pages per request: 100
  • Cannot create or modify PDFs natively

For PDF creation and editing, skills or MCP servers provide that functionality.

Excel, Word, and PowerPoint

These formats require skills rather than native support. The official Anthropic skills repository (github.com/anthropics/skills) provides production-ready capabilities:

FormatSkill capabilities
Excel (.xlsx)Create spreadsheets, build formulas, generate charts, data validation
Word (.docx)Create documents, format text, tracked changes, OOXML manipulation
PowerPoint (.pptx)Create presentations, edit slides, HTML-to-PPTX conversion

Installation in Claude Code:

/plugin marketplace add anthropics/skills
/plugin install document-skills@anthropic-agent-skills

Once installed, these skills activate automatically when tasks involve the relevant formats. Request "Create a budget spreadsheet" and the xlsx skill loads. Ask for "a presentation summarizing the architecture" and the pptx skill engages.

Skills for document manipulation follow the progressive disclosure pattern from Page 1. Only metadata loads at startup. Full instructions load when you actually work with documents. This prevents document skills from consuming context when you're doing pure code work.

How commands became skills

Claude Code version 2.1.3 merged the custom commands system into skills. Previously, custom commands lived in .claude/commands/ as single markdown files. That structure still works, but skills in .claude/skills/ provide additional capabilities.

FeatureLegacy commandsSkills
Location.claude/commands/foo.md.claude/skills/foo/SKILL.md
Supporting filesNot supportedCan include scripts, templates, references
Auto-invocationNoConfigurable via frontmatter
Tool restrictionsUse conversation defaultsCan specify allowed-tools

Both create the same /foo invocation. New development favors skills for the additional flexibility. Existing commands continue working without migration.

The merger reflects a pattern in agent tooling: specialized features consolidate into general-purpose systems. Commands were a proto-skill system. As skills matured, maintaining separate implementations made less sense.

MCP-provided commands

MCP servers can expose prompts that appear as commands with the format /mcp__<server>__<prompt>. These are discovered dynamically from connected servers.

For example, a database MCP server might expose /mcp__postgres__query-tables that provides structured database interaction beyond what ad-hoc prompting offers.

The distinction matters for understanding where commands originate:

  • /compact is built into Claude Code
  • /code-review might be a custom skill
  • /mcp__github__create-pr comes from an MCP server

Knowing the source helps troubleshoot when commands don't behave as expected.

Choosing between commands, skills, and direct interaction

Built-in commands handle platform operations: session management, configuration, status. Skills handle domain workflows: code review, commit procedures, deployment verification. Direct interaction handles everything else.

The decision tree:

  1. Is this a platform operation? Use built-in commands.
  2. Is this a repeated workflow? Consider or create a skill.
  3. Is this ad-hoc? Use direct interaction.

Attempting to replicate built-in commands as skills rarely improves outcomes. The built-in /compact has deeper integration with context management than any skill could achieve. Focus skill development on domain-specific workflows where platform primitives don't reach.

The next page covers skill invocation mechanics and configuration options in detail, including the YAML frontmatter fields that control how skills behave when activated.

On this page