Uploading files

From oaustegard/claude-skills · View interactive version

Uploading files is an AI agent skill from the GitHub repository oaustegard/claude-skills. File-upload bridge for Claude Code on the Web. CCotw has no native file mount; this skill creates a throwaway GitHub branch the user can drop files onto via the github.com web UI, then fetches them locally on the next turn. Use when the user wants to upload, share, or send files into the session, or

How to use this skill

Skill file

Uploading Files

Claude Code on the Web has no file-upload widget and no shared mount. Whenever the user needs to get a file (image, PDF, CSV, doc, archive, anything) into the session, route them through a temporary GitHub branch on the working repo's origin remote.

When to use

Trigger this skill when:

Don't trigger when the file is already in the repo, on a public URL you can fetch, or short enough to paste inline.

Workflow

The script lives at /mnt/skills/user/uploading-files/scripts/upload.py once installed. It must be run from inside the working git repo (it uses origin and cwd).

Step 1 — Create the upload branch

python3 /mnt/skills/user/uploading-files/scripts/upload.py init

This creates upload-<short-session-id> on origin (from the default branch) and prints a GitHub upload URL. Show that URL to the user on its own line, with no surrounding markdown — no **bold**, no [link](...), no backticks. Some chat renderers concatenate trailing punctuation/markup onto the URL when the user clicks it, breaking the branch name. Bare URL only. Then tell them:

Open that link, drag the file(s) into the page, scroll to the bottom and click Commit changes (the default options are fine). Reply here when done.

Then stop and wait for the user. Do not pretend they've uploaded.

Step 2 — Fetch files

After the user confirms the upload:

python3 /mnt/skills/user/uploading-files/scripts/upload.py fetch

This downloads everything on the branch (vs default) into ./.uploads/ (filenames are flattened to basenames) and ensures .uploads/ is in .gitignore. Treat the files in .uploads/ like any other local input.

If the script reports "No files on branch yet", the user probably forgot to click commit. Ask them to refresh the upload page and verify they committed, then re-run fetch.

Step 3 — Cleanup

When the uploaded files are no longer needed — typically after the work is done and anything worth keeping has been moved into the repo proper, and before opening a PR — delete the remote branch:

python3 /mnt/skills/user/uploading-files/scripts/upload.py cleanup

Local files in ./.uploads/ are kept (they're gitignored). If the user might want them again, leave them; otherwise rm -rf .uploads after cleanup.

Optional — status

python3 /mnt/skills/user/uploading-files/scripts/upload.py status

Prints the repo, branch name, whether the branch exists on origin, and the upload URL. Useful when you've context-switched and want to recover the URL without recreating the branch.

How it works

Constraints

Anti-patterns

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.