Load an Agent Skill from a local directory for use in the current session.
Value
A skill specification for use with claude_new().
Details
Skill structure:
my_skill/
+-- SKILL.md # Required: YAML frontmatter + instructions
+-- templates/ # Optional: template files
+-- scripts/ # Optional: helper scriptsSKILL.md format (agentskills.io spec):
This function reads the skill locally and embeds it in the request.
Use claude_skill_upload() to persist skills on Anthropic's servers.
API Reference: https://platform.claude.com/docs/en/build-with-claude/skills-guide
See also
claude_skill(), claude_skill_upload()
Other claude-skills:
claude_skill(),
claude_skill_list(),
claude_skill_upload()
Examples
if (FALSE) { # \dontrun{
# Create skill directory
skill_dir <- tempfile("skill_")
fs::dir_create(skill_dir)
writeLines(c(
"---",
"name: greeting",
"description: Greet users professionally",
"---",
"",
"Always greet users with 'Welcome to Artalytics!'"
), fs::path(skill_dir, "SKILL.md"))
# Load and use
chat <- claude_new(
skills = list(claude_skill_local(skill_dir)),
tools = list(claude_code_exec()),
beta = c(beta_headers$BETA_SKILLS, beta_headers$BETA_CODE_EXEC_BASH)
)
chat$chat("Please greet me")
} # }
