asset-import
Asset Import (Claude Code)
Select one import route first
- Readable local file or chat attachment + Browser pane available (or can be opened): use the Browser-pane local import below. This is the default Claude Code path. Do not call
import_mediaor runupload-media.mjsfirst merely because the attachment has a readable local path. - Browser-pane fallback: use the upload-helper route only when the Browser pane cannot be opened, the target editor page is unavailable, or the page-script/drop attempt actually fails. Do not choose the fallback preemptively.
- Already uploaded in the ChatCut editor: discover and use the existing asset through
browse_assets; do not import a duplicate. - Public
http(s)media URL: usepush_assetordownload_media; do not route it through a local-file helper.
Browser-pane local import (instant import; upload state is verified)
When the editor is already open (or should be opened) in the in-app Browser pane and the source files are local paths on the user's machine, this path lands assets in the project library the moment you drop them: instant preview, timeline placement, and automatic transcription (the extracted transcription audio uploads on its own). Use it for fast local editing.
MECHANISM: the Browser pane hands local files to the visible editor through a tokenized loopback URL and a synthetic OS-file drop. Current deployments may treat the pane as a normal web import, while older deployments could leave the original bytes local-only after transcription audio upload. Do not assume either behavior. After dropping, check browse_assets: if the asset reports uploading/cloud-backed, treat it as a normal web import and wait on track_progress target:"upload" before byte-dependent work; if it reports local-only/deferred original upload, follow the deferred-upload guidance below.
Consequence for sequencing: if the task will end in cloud export/share, pull_asset, or remote frame decode, use browse_assets to confirm whether the pane-dropped asset is cloud-backed. If it remains local-only when byte-dependent work is actually needed, import the same file through the upload-media.mjs helper flow below (it registers a cloud-backed asset). Do not choose the helper from the start solely because later work may need cloud bytes. Fall back to the helper flow entirely when there is no Browser pane, the editor tab is not open, or page scripting fails.
- Ensure the editor tab is open in the Browser pane on the target project. Use the returned
browserHandoff.urlwhen present; it is the authenticated Claude Code in-app-browser URL. Preserve returned query parameters such asdockviewLayout=media, but do not addtheme=codexor invent Codex-only workbench parameters for Claude Code URLs. - Start the tokenized loopback file server bundled with this skill (auto-shuts down after
--ttlseconds; serves only the listed files, only to the editor origin):