Repository navigation
v1.0.0
1.0 is a stability commitment. From here on the public API — everything documented in docs/ plus the YARD docs without @api private, now also described by the RBS signatures in sig/ — follows Semantic Versioning: no breaking changes within 1.x. Upgrading from 0.x? Read UPGRADING-1.0.md and run your suite on 0.37 first.
1.0 (#126): three breaking changes, the first two of which 0.37 warns about at the call site. Read UPGRADING-1.0.md before upgrading and run your suite on 0.37 with warnings visible first: an app that runs on 0.37 without SDK warnings is unaffected by those two, except that respond_to? on a camelCase non-attribute (msg.respond_to?(:toH)) silently answered true on 0.37 and answers false now.
Added
ClaudeAgentSDK::SessionStoreError(aClaudeSDKError), raised byquery,askandClient#connectwhen resuming fromsession_store:fails: a store call (#load,#list_sessions,#list_subkeys) raised or exceededload_timeout_mswhile the SDK materialized the transcript. The message names the store call, and#causeholds the adapter's exception (or the timeout). Documented indocs/errors.mdanddocs/sessions.md.- RBS signatures for the public API (#126). The gem now ships
sig/, so Steep and other RBS tools type-check code that uses it (throughrbs collection;sig/manifest.yamldeclares the one stdlib dependency,pathname). The signatures cover the whole public surface (the objects documented indocs/and YARD without@api private):ClaudeAgentSDK.query/.ask/.configure/.offload, the SDK MCP helpers, every session function (includingsession_store:and the deprecated twins),Clientwith its Ruby-style aliases,ClaudeAgentOptions(every option as a typed keyword), the message, content-block, hook, permission and MCP types, the error hierarchy,CLIInstaller,Streaming,Railtie.callback_wrapperand the observers. Duck types are interfaces, so any object with the right methods fits:_Transport,_SessionStore(only#appendand#loadare required), and one interface per user callback (_CanUseTool,_HookCallback,_ToolHandler,_CallbackWrapper, ...). Hashes follow the documented key rule:wire_hash(Hash[Symbol, untyped]) for data from the CLI stream,transcript_hash(Hash[String, untyped]) for transcripts and store data. Internals tagged@api privatehave no signatures. CI validates the signatures (rake rbs:validate) and runs the suite under RBS's runtime type checker (rake rbs:test), so a signature that disagrees with the code fails the build.CONTRIBUTING.mdexplains how to keepsig/in step with API changes.
Changed
- Breaking: unknown keys on user-constructed types raise
ArgumentError..newand#[]=on the value types you build and pass in (option values such asAgentDefinition,SandboxSettings, the thinking and MCP server configs;HookMatcher; hook outputs;PermissionResultAllow/PermissionResultDeny;PermissionUpdate;PermissionRuleValue) raise instead of warning, with a message naming the class, the key and the known keys:ClaudeAgentSDK::HookMatcher: unknown attribute :matchr (known: hooks, matcher, timeout). camelCase and String keys and a type's own discriminator are still accepted;.from_hash,.wrapand every type parsed from CLI output stay lenient. - Breaking:
Type#[],#[]=and camelCase methods reach attributes only. A name that is not an attribute behaves like an undefined one:msg[:to_h]isnil,#[]=ignores it (raises on the strict types above),msg.toHraisesNoMethodErrorandrespond_to?(:toH)isfalse. Methods your own code adds to a subclass, mixin or instance still count as attributes. - Breaking: store-backed resume failures raise
SessionStoreErrorinstead ofRuntimeError. The two SDK-raisedRuntimeErrors (store call failed, store call timed out) becomeSessionStoreError, and aRuntimeErrorraised by the adapter itself, which 0.37 let through unwrapped, is now wrapped too, sorescue ClaudeSDKErrorcatches every resume-materialization failure. Code that rescuedRuntimeErrorthere must rescueSessionStoreError. The failure message now includes the adapter exception's class (... failed during resume materialization: IOError: connection reset). UPGRADING-1.0.mdships in the gem and the YARD docs, linked from the README.- The deprecation warning printed by the ten
*_from_store/*_via_storesession functions, and their YARD and docs, now say they will be removed in 2.0. 0.36 and 0.37 said 1.0, but they stay, deprecated, for all of 1.x (#126). Nothing else about them changes: each still works and still warns once per process.
Upgrading from 0.x
- Upgrade to
~> 0.37.0and run your suite with warnings visible — every call that 1.0 rejects prints a warning pointing at your code. - Fix those, check any
rescue RuntimeErroraround store-backed resume (nowSessionStoreError). gem 'claude-agent-sdk', '~> 1.0'.
Full guide: UPGRADING-1.0.md
What's changed
- #138 1.0: strict attribute keys, attribute-only access, SessionStoreError — @ya-luotao
- #139 RBS signatures for the public API — @ya-luotao
The road here: #126 (0.35 Rails integration → 0.36 API consolidation → 0.37 deprecations → 1.0).
Full Changelog: v0.37.0...v1.0.0
gem install claude-agent-sdk -v 1.0.0