What
An artifact is a page or file Claude can publish and share. The artifact publish tool can now change the local file and publish it in one call. It takes an edits parameter, a list of old_str/new_str pairs, where each pair replaces one piece of text with another.
editsare applied in order to the file atfile_path. Either all of them apply or none do, and the file is saved to disk before it is published.- If an edit fails, no edits are applied and nothing is published. The reason is reported, for example "edits[N] old_str does not occur in the file".
editsworks only on text files, and non-text files are refused.editsis rejected on a publish that also usesaction,type_url,files,root,pr_review, a live doc or a chain, becauseeditschanges only the file atfile_path. The tool tells Claude it is also making N edits to the local file on disk.- A publish with edits gets a write-permission check and can fail with
write_denied. - Results gain two optional fields.
editsAppliedis a positive count.editsNotWrittengives the reason edits did not reach disk:write_failed,not_writable,changed_during_publishorhard_linked. - When the live page has changed, the warning Claude gets is reworded for edits. It tells Claude to merge the live page into its file and then resend the same publish with edits.
- The Artifact input schema now includes
publish_editsnext toassetsandcopy_from.
The feature is switched on by the environment variable CLAUDE_CODE_ARTIFACT_PUBLISH_EDITS, or failing that by a remote config value publishEdits set to true. The fallback is false. A new flag, tengu_toasty_hammock, was added in the same change. Nothing has been read about that flag.
Two other artifact changes came with it. When Claude reads an artifact type's files, it is shown a limited number of them with an "about ... characters" size, and the rest are listed under "Not read:". Responses can also carry an optional owned field.
Why
Claude can make a small change to a page without first reading the file, then editing it, then publishing it as separate steps. When an edit does not make it to disk, the result now says why.