Skip to content

ClaudeAttachment

Base classes

Name Children Inherits
BaseModel
pydantic.main
!!! abstract "Usage Documentation"

⋔ Inheritance diagram

graph TD
  2217110144["models.ClaudeAttachment"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  3879467795 --> 2217110144
  2751680898 --> 3879467795

🛈 DocStrings

Bases: BaseModel

Attachment payload, discriminated by type.

Claude Code has dozens of attachment types (hook_success, file, edited_text_file, deferred_tools_delta, date, task_status, ...) and adds new ones often, so the payload is kept as-is: the type is typed, everything else is available as extra fields (model_extra) and written back unchanged.

Source code in src/clawd_code_sdk/storage/models.py
class ClaudeAttachment(BaseModel):
    """Attachment payload, discriminated by ``type``.

    Claude Code has dozens of attachment types (``hook_success``, ``file``,
    ``edited_text_file``, ``deferred_tools_delta``, ``date``, ``task_status``, ...) and adds
    new ones often, so the payload is kept as-is: the type is typed, everything else is
    available as extra fields (``model_extra``) and written back unchanged.
    """

    model_config = ConfigDict(extra="allow")

    type: str

:fa-brands-github: Show source on GitHub