Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .claude/commands/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Draft the release body from the new CHANGELOG section. Prior releases use this s
### What's changed
- #NN <title> — @author

**Full Changelog**: https://github.com/ya-luotao/claude-agent-sdk-ruby/compare/v<prev>...vX.Y.Z
**Full Changelog**: https://github.com/rubycatco/claude-agent-sdk-ruby/compare/v<prev>...vX.Y.Z

---

Expand All @@ -143,15 +143,15 @@ gem install claude-agent-sdk -v X.Y.Z
Generate the "What's changed" list from merged PRs since the last tag:

```
gh pr list --repo ya-luotao/claude-agent-sdk-ruby \
gh pr list --repo rubycatco/claude-agent-sdk-ruby \
--state merged --search "merged:>=<last-tag-date>" \
--json number,title,author
```

Create the release. Default: publish immediately (this is what fires `publish.yml`). If the user passed `--draft`, append `--draft` so they can eyeball the notes in GitHub UI and click "Publish release" manually:

```
gh release create vX.Y.Z --repo ya-luotao/claude-agent-sdk-ruby \
gh release create vX.Y.Z --repo rubycatco/claude-agent-sdk-ruby \
--title "vX.Y.Z" --notes-file <tmpfile>
# add --draft if --draft was passed
```
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ body:
- type: markdown
attributes:
value: |
Thanks for the report. For a security vulnerability, **don't open an issue**; see [SECURITY.md](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/SECURITY.md).
Thanks for the report. For a security vulnerability, **don't open an issue**; see [SECURITY.md](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/SECURITY.md).
If the Claude Code CLI itself misbehaves in the same way when you run `claude` directly, report it to [anthropics/claude-code](https://github.com/anthropics/claude-code/issues) instead.
- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
blank_issues_enabled: true
contact_links:
- name: Report a security vulnerability
url: https://github.com/ya-luotao/claude-agent-sdk-ruby/security/advisories/new
url: https://github.com/rubycatco/claude-agent-sdk-ruby/security/advisories/new
about: Please report vulnerabilities in this gem privately, not as a public issue. See SECURITY.md.
- name: Claude Code CLI bugs
url: https://github.com/anthropics/claude-code/issues
Expand Down
143 changes: 72 additions & 71 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Thanks for helping out. This is a community-maintained Ruby SDK for the Claude C
You need Ruby 3.2 or newer.

```bash
git clone https://github.com/ya-luotao/claude-agent-sdk-ruby.git
git clone https://github.com/rubycatco/claude-agent-sdk-ruby.git
cd claude-agent-sdk-ruby
bundle install
bundle exec rake # unit suite + RuboCop, the same checks as CI's main leg
Expand Down
74 changes: 37 additions & 37 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Please report vulnerabilities privately. Don't open a public issue or PR.

Use [GitHub's private vulnerability reporting](https://github.com/ya-luotao/claude-agent-sdk-ruby/security/advisories/new) for this repository (Security tab → "Report a vulnerability"). If that form is unavailable, email the maintainer at the address in the gemspec (`luotao@hey.com`).
Use [GitHub's private vulnerability reporting](https://github.com/rubycatco/claude-agent-sdk-ruby/security/advisories/new) for this repository (Security tab → "Report a vulnerability"). If that form is unavailable, email the maintainer at the address in the gemspec (`luotao@hey.com`).

Please include the affected gem version, a description of the issue and its impact, and a proof of concept or steps to reproduce if you have them. Follow-up happens on the private advisory thread. Fixes ship in a patch release, and the advisory is published once that release is out.

Expand Down
2 changes: 1 addition & 1 deletion UPGRADING-1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ No breaking changes within 1.x to the public API: everything documented in
YARD docs that is not tagged `@api private`. `@api private` objects (`Query`,
`MessageParser`, `FiberBoundary`, the `Sessions*` modules, ...) stay callable
but can change in any release. See
[CONTRIBUTING.md](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/CONTRIBUTING.md#what-is-public-api).
[CONTRIBUTING.md](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/CONTRIBUTING.md#what-is-public-api).

A removal is first deprecated in a minor release with a one-time warning that
names the replacement, and happens in the next major.
Expand Down
6 changes: 3 additions & 3 deletions claude-agent-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Gem::Specification.new do |spec|
'integration (Railtie, install generator, CLI-vendoring rake task, executor-aware callback ' \
'wrapper), a pinned CLI installer, OpenTelemetry tracing, and session transcript mirroring. ' \
'Not affiliated with or officially maintained by Anthropic.'
spec.homepage = 'https://github.com/ya-luotao/claude-agent-sdk-ruby'
spec.homepage = 'https://github.com/rubycatco/claude-agent-sdk-ruby'
spec.license = 'MIT'
spec.required_ruby_version = '>= 3.2.0'

spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['source_code_uri'] = 'https://github.com/ya-luotao/claude-agent-sdk-ruby'
spec.metadata['changelog_uri'] = 'https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/CHANGELOG.md'
spec.metadata['source_code_uri'] = 'https://github.com/rubycatco/claude-agent-sdk-ruby'
spec.metadata['changelog_uri'] = 'https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/CHANGELOG.md'
spec.metadata['documentation_uri'] = 'https://rubydoc.info/gems/claude-agent-sdk'
spec.metadata['allowed_push_host'] = 'https://rubygems.org'

Expand Down
2 changes: 1 addition & 1 deletion docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Resuming from a `session_store` is not available over a custom transport, throug

### Reference: running `claude` inside an E2B sandbox

[`examples/e2b_transport_example.rb`](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/e2b_transport_example.rb) is a working transport that runs the Claude Code CLI inside an [E2B](https://e2b.dev) Firecracker microVM instead of on your host. The wire protocol stays identical — only the I/O layer changes:
[`examples/e2b_transport_example.rb`](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/e2b_transport_example.rb) is a working transport that runs the Claude Code CLI inside an [E2B](https://e2b.dev) Firecracker microVM instead of on your host. The wire protocol stays identical — only the I/O layer changes:

```
ClaudeAgentSDK::Client (host)
Expand Down
12 changes: 6 additions & 6 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ end

In the `output_format` Hash, `type` may be a String or a Symbol (`type: :json_schema`), and the keys Symbols or Strings.

See [examples/structured_output_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/structured_output_example.rb).
See [examples/structured_output_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/structured_output_example.rb).

## Thinking Configuration

Expand Down Expand Up @@ -117,7 +117,7 @@ ClaudeAgentSDK.query(prompt: "Explain recursion", options: options) do |message|
end
```

See [examples/budget_control_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/budget_control_example.rb).
See [examples/budget_control_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/budget_control_example.rb).

## Fallback Model

Expand All @@ -128,7 +128,7 @@ options = ClaudeAgentSDK::ClaudeAgentOptions.new(
)
```

See [examples/fallback_model_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/fallback_model_example.rb).
See [examples/fallback_model_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/fallback_model_example.rb).

## Advisor Model

Expand Down Expand Up @@ -162,7 +162,7 @@ Notes:
- `CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1` (settable via `options.env`) disables
the advisor tool entirely; a configured `advisor_model` is then ignored.

See [examples/advisor_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/advisor_example.rb) and the
See [examples/advisor_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/advisor_example.rb) and the
[advisor documentation](https://code.claude.com/docs/en/advisor).

## Beta Features
Expand Down Expand Up @@ -260,7 +260,7 @@ sandbox = ClaudeAgentSDK::SandboxSettings.new(enabled: true, fail_if_unavailable

Without it, the sign is the CLI's warning on stderr ("Sandbox disabled: ... Commands will run WITHOUT sandboxing. Network and filesystem restrictions will NOT be enforced."), and stderr reaches your code only through the `stderr` (or `debug_stderr`) option. This is the CLI's own description of its behavior: the fallback has not been reproduced in this SDK's testing, where the sandbox was always available.

See [examples/sandbox_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/sandbox_example.rb).
See [examples/sandbox_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/sandbox_example.rb).

When the `sandbox:` option enabled the sandbox and the CLI reports `Sandbox disabled: …` on its stderr, the SDK repeats that line as a Ruby warning prefixed `[claude-agent-sdk]`, once per session, whether or not you set `stderr:`.

Expand Down Expand Up @@ -293,7 +293,7 @@ options = ClaudeAgentSDK::ClaudeAgentOptions.new(

**What still works:** skills (via `/skill-name`), explicit `--add-dir` CLAUDE.md, `--settings`, `--mcp-config`, `--agents`, `--plugin-dir`, API key from `ANTHROPIC_API_KEY` env var.

See [examples/bare_mode_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/bare_mode_example.rb).
See [examples/bare_mode_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/bare_mode_example.rb).

## Verbatim Prompts

Expand Down
4 changes: 2 additions & 2 deletions docs/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ClaudeAgentSDK.query(prompt: "Hello") do |message|
end
```

See [examples/error_handling_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/error_handling_example.rb).
See [examples/error_handling_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/error_handling_example.rb).

## Exception Handling

Expand Down Expand Up @@ -196,4 +196,4 @@ end
| `CLIJSONDecodeError` | JSON parsing issues — including stdout ending mid-frame (a truncated final message; `line` holds the partial frame) |
| `MessageParseError` | Message parsing issues |

See [lib/claude_agent_sdk/errors.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/lib/claude_agent_sdk/errors.rb) for all error types.
See [lib/claude_agent_sdk/errors.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/lib/claude_agent_sdk/errors.rb) for all error types.
6 changes: 3 additions & 3 deletions docs/hooks-and-permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ All hook input objects include common fields like `session_id`, `transcript_path

`tool_input` (and the `input` a [permission callback](#permission-callbacks) receives) is the CLI's Hash passed through unchanged, so its keys are Symbols spelled as on the wire: `tool_input[:command]`, `input[:file_path]`. See [Hash keys](types.md#hash-keys).

All 27 hook events have typed input classes. See [`ClaudeAgentSDK::HOOK_EVENTS`](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/lib/claude_agent_sdk/types/hooks.rb) and [examples/lifecycle_hooks_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/lifecycle_hooks_example.rb).
All 27 hook events have typed input classes. See [`ClaudeAgentSDK::HOOK_EVENTS`](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/lib/claude_agent_sdk/types/hooks.rb) and [examples/lifecycle_hooks_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/lifecycle_hooks_example.rb).

`background_tasks` and `session_crons` are optional arrays of raw CLI hashes.
`nil` means the CLI did not provide a snapshot; `[]` means it provided an empty
Expand Down Expand Up @@ -76,7 +76,7 @@ Async do
end.wait
```

See [examples/hooks_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/hooks_example.rb), [examples/advanced_hooks_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/advanced_hooks_example.rb), and [examples/lifecycle_hooks_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/lifecycle_hooks_example.rb).
See [examples/hooks_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/hooks_example.rb), [examples/advanced_hooks_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/advanced_hooks_example.rb), and [examples/lifecycle_hooks_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/lifecycle_hooks_example.rb).

### Hook output

Expand Down Expand Up @@ -148,7 +148,7 @@ Async do
end.wait
```

See [examples/permission_callback_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/permission_callback_example.rb).
See [examples/permission_callback_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/permission_callback_example.rb).

### Permission request cancellation

Expand Down
2 changes: 1 addition & 1 deletion docs/mcp-servers.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,4 @@ are covered here too. For
naming the exception class, and then the exception propagates as Ruby normally
would.

See [examples/mcp_calculator.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/mcp_calculator.rb) and [examples/mcp_resources_prompts_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/mcp_resources_prompts_example.rb) for complete examples.
See [examples/mcp_calculator.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/mcp_calculator.rb) and [examples/mcp_resources_prompts_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/mcp_resources_prompts_example.rb) for complete examples.
2 changes: 1 addition & 1 deletion docs/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@ end
options = ClaudeAgentSDK::ClaudeAgentOptions.new(observers: [MyObserver.new])
```

See [examples/otel_langfuse_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/otel_langfuse_example.rb) for a complete multi-tool example.
See [examples/otel_langfuse_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/otel_langfuse_example.rb) for a complete multi-tool example.
10 changes: 5 additions & 5 deletions docs/rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ end

Preconditions, spelled out: `:inline` is only correct when the process satisfies the same requirements as solid_queue's fiber workers — `isolation_level = :fiber`, Rails 7.2+ for AR, and no thread-keyed libraries used inside callbacks without a fiber-aware wrapper. The SDK warns once if it detects `:inline` under `isolation_level == :thread`. Everything else (Puma request threads, threaded Sidekiq/solid_queue workers) should stay on the default `callback_scheduling: :thread`.

Note that `SessionStore` adapter calls (`#append` / `#load`) stay on threads by default even in `:inline` mode — their timeouts are hard bounds (`Thread#join`) so a wedged store adapter can never stall the reactor. The exception is an adapter that declares itself fiber-native via an optional `callback_scheduling` method returning `:inline` (see "Fiber-native adapters" in [docs/sessions.md](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/docs/sessions.md)); its calls then run on the reactor under a cooperative timeout. In both cases a configured `callback_wrapper` composes around the adapter call inside the bound.
Note that `SessionStore` adapter calls (`#append` / `#load`) stay on threads by default even in `:inline` mode — their timeouts are hard bounds (`Thread#join`) so a wedged store adapter can never stall the reactor. The exception is an adapter that declares itself fiber-native via an optional `callback_scheduling` method returning `:inline` (see "Fiber-native adapters" in [docs/sessions.md](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/docs/sessions.md)); its calls then run on the reactor under a cooperative timeout. In both cases a configured `callback_wrapper` composes around the adapter call inside the bound.

## ActionCable Streaming

Expand Down Expand Up @@ -541,7 +541,7 @@ end
Then every `ClaudeAgentSDK.query` and `Client` session automatically gets traced — no per-call wiring needed. The lambda factory ensures each request gets its own observer with isolated span state, safe for concurrent Puma/Sidekiq workers.

See:
- [examples/rails_actioncable_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/rails_actioncable_example.rb)
- [examples/rails_background_job_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/rails_background_job_example.rb)
- [examples/session_resumption_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/session_resumption_example.rb)
- [examples/http_mcp_server_example.rb](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/http_mcp_server_example.rb)
- [examples/rails_actioncable_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/rails_actioncable_example.rb)
- [examples/rails_background_job_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/rails_background_job_example.rb)
- [examples/session_resumption_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/session_resumption_example.rb)
- [examples/http_mcp_server_example.rb](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/http_mcp_server_example.rb)
2 changes: 1 addition & 1 deletion docs/sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ end
`InMemorySessionStore#append` is a working reference.

Copy-in reference adapters for **S3, Redis, and Postgres** live in
[`examples/session_stores/`](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/session_stores/README.md), each with a
[`examples/session_stores/`](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/session_stores/README.md), each with a
production checklist.

#### Fiber-native adapters
Expand Down
2 changes: 1 addition & 1 deletion docs/subagents.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ See [hook fields and permission cancellation](hooks-and-permissions.md).

## Minimal example

[`examples/subagent_status_example.rb`](https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/examples/subagent_status_example.rb)
[`examples/subagent_status_example.rb`](https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/examples/subagent_status_example.rb)
defines a tool-free reviewer, registers lifecycle hooks, reads metadata, and
prints task events and forwarded child text without building a status model:

Expand Down
2 changes: 1 addition & 1 deletion docs/types.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Types Reference

See [lib/claude_agent_sdk/types/](https://github.com/ya-luotao/claude-agent-sdk-ruby/tree/main/lib/claude_agent_sdk/types) for complete type definitions (one file per area; `types.rb` loads them all).
See [lib/claude_agent_sdk/types/](https://github.com/rubycatco/claude-agent-sdk-ruby/tree/main/lib/claude_agent_sdk/types) for complete type definitions (one file per area; `types.rb` loads them all).

## Hash keys

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def show_next_steps
2. Provide credentials to the CLI, e.g. ANTHROPIC_API_KEY in the environment.
3. Review config/initializers/claude_agent_sdk.rb.

Rails guide: https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/docs/rails.md
Rails guide: https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/docs/rails.md
MSG
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Claude Agent SDK defaults, merged into every ClaudeAgentSDK.query and
# ClaudeAgentSDK::Client session; per-call ClaudeAgentOptions override them.
# Guide: https://github.com/ya-luotao/claude-agent-sdk-ruby/blob/main/docs/rails.md
# Guide: https://github.com/rubycatco/claude-agent-sdk-ruby/blob/main/docs/rails.md

# Uncomment together with `observers:` below (needs the opentelemetry-sdk gem).
# require 'claude_agent_sdk/instrumentation'
Expand Down
4 changes: 2 additions & 2 deletions plugins/claude-agent-ruby/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"name": "ya-luotao",
"email": "ya.luotao@gmail.com"
},
"homepage": "https://github.com/ya-luotao/claude-agent-sdk-ruby",
"repository": "https://github.com/ya-luotao/claude-agent-sdk-ruby",
"homepage": "https://github.com/rubycatco/claude-agent-sdk-ruby",
"repository": "https://github.com/rubycatco/claude-agent-sdk-ruby",
"license": "MIT",
"keywords": [
"ruby",
Expand Down
Loading