Your Claude Code agent generates a hero image for your landing page. It renders a product demo video. It writes a research report. Then the session ends — and those files sit in a local directory, invisible to your team, useless to your next session.
Claude Code can create. It can't store — not persistently, not shareably, not across sessions.
Here's how to give your agent cloud storage: a persistent Drive that survives sessions, generates share links, and keeps your agent's output organized.
Quick answer: Run anycap drive upload <file> to store any agent-generated file permanently, then anycap drive share <file-or-id> to generate a public link (--expires 7d or --no-expire). Two commands, not a storage project — and the files are visible across Claude Code, Cursor, and Codex sessions under the same account. This is the CLI behind AnyCap's Drive capability, part of the broader AnyCap for Claude Code stack.
The File Problem
Agents create files. Images. Videos. Reports. Data exports. Screenshots. Each artifact represents agent work — compute spent, tokens burned, time invested. But without persistent storage:
- Files disappear between sessions. Your agent builds a report on Monday. On Tuesday, it starts from scratch.
- No sharing. The JPEG on your filesystem is only useful to you. Your team can't see it. Your client can't review it.
- No asset pipeline. Image A feeds into Video B which embeds in Page C. Without persistent URLs, the pipeline breaks at every handoff.
- Orphaned outputs. Your agent generates 20 image variants. You keep 3. The other 17 clutter your project directory.
Cloud storage fixes all four problems.
Method 1: Manual Upload (The Context-Switch Way)
After your agent finishes, you manually upload the output:
- Find the file in your project directory
- Open a browser
- Navigate to Google Drive / Dropbox / S3 console
- Upload the file
- Generate a share link
- Paste the link into Slack / email / Notion
Your agent works in the terminal. You work in the browser. Every artifact means a context switch. Scale this to 10 artifacts per session, and you're spending more time uploading than your agent spent creating.
Method 2: Cloud Storage via API (The DIY Way)
Configure S3, R2, or GCS and wire it into your agent:
- Create a bucket
- Set up IAM roles and access policies
- Configure CORS (if files need to render in a browser)
- Write a shell script your agent can call
- Handle authentication (access keys, session tokens)
- Deal with region configuration and endpoint URLs
This works for production pipelines. It's overkill for "my agent generated a report and I want to share it."
Method 3: Two Commands, Not a Storage Project (The Agent Way)
Your agent creates a file. Storing it and sharing it are two separate, explicit commands — not one:
# 1. Store the file
anycap drive upload hero-image.jpg
# → {"file_id":"dn_XXXXXXXXXXXX","name":"hero-image.jpg","size":<bytes>,"status":"success"}
# 2. Generate a public share link — a separate command
anycap drive share dn_XXXXXXXXXXXX --expires 7d
# → {"url":"https://drive.anycap.dev/s/XXXXXXXXXXX","expires_at":"...","status":"active"}
upload stores the file and returns a file_id — it does not hand you a public URL. share is the command that turns a stored file into a link, with --expires <duration> (e.g. 7d) or --no-expire for a permanent one. Skip share and the file stays stored but private.
What the runtime actually handles:
- Persistence. Files survive across sessions. Your agent's Tuesday session can reference what it stored on Monday.
- Share links, on demand.
anycap drive shareturns any stored file into a public URL with expiration control — nothing is public until you run it. - Organization.
anycap drive ls,mkdir,mv, andrmmanage folders and files from the CLI. - Any file type. Images, videos, documents, data exports — same two commands regardless of type.
Install:
curl -fsSL https://anycap.ai/install.sh | sh
anycap login
npx -y skills add anycap-ai/anycap -a claude-code -y
Prefer npm, or need the skill in a custom directory? npm install -g @anycap/cli and anycap skill install --target ~/.claude/skills/anycap-cli/ are valid manual alternatives to the two lines above.
→ Install AnyCap free · Full command reference: Drive capability page.
Real Use Case: The Creative Pipeline with Persistent Storage
The fix here isn't just the commands — it's the order. AnyCap's own CLI guidance is explicit: don't round-trip a file through Drive just to hand its URL to the next command. Pass the local file directly; save Drive and share for the final hand-off.
# 1. Generate a hero image
anycap image generate \
--prompt "SaaS dashboard product shot, clean lighting" \
--model seedream-5 \
-o hero.jpg
# 2. Generate a video FROM THE LOCAL FILE — no Drive round-trip
anycap video generate \
--prompt "slow push-in toward the dashboard" \
--model veo-3.1 \
--mode image-to-video \
--param images=./hero.jpg \
-o demo.mp4
# 3. Deploy a page referencing both local files
anycap page deploy index.html --title "Product Launch"
# 4. Only now — store and share the finished deliverable
anycap drive upload demo.mp4
anycap drive share dn_XXXXXXXXXXXX --expires 7d
Why this order matters: --param images=./hero.jpg uploads the file internally when the command runs — image-to-video already handles that for you. Passing a Drive URL instead adds a network round trip and a dependency on the link staying valid, for no benefit. Drive comes in once, at the end, to hand a finished asset to someone outside the pipeline. This is what a capability runtime enables — every capability feeding into every other directly, with Drive reserved for the actual handoff.
When to Use Drive vs When to Keep Files Local
| Use Drive when... | Keep local when... |
|---|---|
| You need to share the file | The file is temporary and disposable |
| The file feeds into another agent step | The file is an intermediate build artifact |
| You want the file available in future sessions | You're iterating rapidly and overwriting frequently |
| The file is a final deliverable | The file is a config or source file in version control |
Rule of thumb: if another person needs to see it, or if another session needs to reference it, put it in Drive.
FAQ
How is Drive different from my project directory?
Your project directory is local. It exists on your machine. Drive is cloud storage — files get persistent URLs that work anywhere. Your team can access them. Your agent's next session can reference them.
Can my agent list previously uploaded files?
Yes. The runtime maintains an upload history. Your agent can reference files by their Drive URL across sessions.
Are there file size limits?
Drive and Page storage are included with every account at no extra cost — there's no separate free-vs-paid storage tier. Current limits: up to 5,000 files per account, 1 GB per file. The pricing page notes these are "early-access preview defaults and may change," so treat them as today's numbers, not a permanent ceiling.
Does this work across Claude Code, Cursor, and Codex?
Yes. anycap drive upload uses the same CLI across all three agents. Files uploaded from Claude Code are accessible to your Cursor session.
The Bottom Line
Your agent creates value — images, videos, reports, data. Without persistent storage, that value disappears when the session ends. Give your agent a Drive, and its output becomes your team's asset. For the full picture of how storage fits into the agent stack, read What Is a Capability Runtime? — the missing layer that bundles storage with search, images, video, and publishing.
→ Give Claude Code cloud storage — one command, persistent files, share links
📖 What to Read Next
- AnyCap for Claude Code — The full capability stack: storage, image, video, web, and page deploy in one CLI.
- How to Add Web Crawling to Claude Code — Research first, store the results.
- How to Generate Video with Claude Code — Generate video and store it permanently.
- What Is a Capability Runtime? — Why one CLI bundles storage with search, image, video, and deploy.
Related Articles
- What Is an AI Agent? The Complete Developer Guide — The fundamentals: what agents are and what tools they need to execute.
- Agentic AI vs Traditional AI: 5 Key Differences — Why the bottleneck isn't the model — it's whether the agent has tools like storage.
- How to Give AI Coding Agents Real-World Capabilities — The full capability stack overview.
Written by the AnyCap team. Your agent creates. We make sure its work survives.