← Back to list

claude-agent-ruby
by ya-luotao
Unofficial Ruby SDK for Claude Agent
⭐ 17🍴 0📅 Jan 23, 2026
SKILL.md
name: claude-agent-ruby description: Implement or modify Ruby code that uses the claude-agent-sdk gem, including query() one-shot calls, Client-based interactive sessions, streaming input, option configuration, tools/permissions, hooks, SDK MCP servers, structured output, budgets, sandboxing, session resumption, Rails integration, and error handling.
Claude Agent Ruby SDK
Overview
Use this skill to build or refactor Ruby integrations with Claude Code via claude-agent-sdk, favoring the gem's README and types for exact APIs.
Decision Guide
- Choose
ClaudeAgentSDK.queryfor one-shot or unidirectional streaming. - Choose
ClaudeAgentSDK::Clientfor bidirectional sessions, hooks, or permission callbacks; wrap inAsync do ... end.wait. - Choose SDK MCP servers (
create_tool,create_sdk_mcp_server) for in-process tools; choose external MCP configs for subprocess/HTTP servers.
Implementation Checklist
- Confirm prerequisites (Ruby 3.2+, Node.js, Claude Code CLI).
- Build
ClaudeAgentSDK::ClaudeAgentOptionsand pass it toqueryorClient.new. - Handle messages by type (
AssistantMessage,ResultMessage, etc.) and content blocks (TextBlock,ToolUseBlock, etc.). - Use
output_formatand readStructuredOutputtool-use blocks for JSON schema responses. - Define hooks and permission callbacks as Ruby procs/lambdas; do not combine
can_use_toolwithpermission_prompt_tool_name. - For SDK MCP tools, include
mcp__<server>__<tool>inallowed_tools. - Use
toolsorToolsPresetfor base tool selection; useappend_allowed_toolswhen extending defaults. - Configure sandboxing via
SandboxSettingsandSandboxNetworkConfigwhen requested. - Use
resume,session_id, andfork_sessionfor session handling; enable file checkpointing only when explicitly needed.
Where To Look For Exact Details
- Locate the gem path with
bundle show claude-agent-sdkorruby -e 'puts Gem::Specification.find_by_name(\"claude-agent-sdk\").full_gem_path'. - Read
<gem_path>/README.mdfor canonical usage and option examples. - Inspect
<gem_path>/lib/claude_agent_sdk/types.rbfor the full options and type list. - Inspect
<gem_path>/lib/claude_agent_sdk/errors.rbfor error classes and handling. - Use
references/usage-map.mdfor a README section map and minimal skeletons.
Resources
references/
Use references/usage-map.md to map tasks to README sections and gem paths.
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon