DEV Community

Abhishek E
Abhishek E

Posted on

How we built sharing for AI agents?

We've been using Claude Code and OpenClaw for a bunch of non-coding work at our startup like GTM, legal docs, sales proposals. It's been incredibly productive. An agent can draft a SaaS agreement in minutes that take my legal hours or days.

But then I need to send it to my cofounder.

And suddenly I'm back in 2015. Open Gmail. Attach it. Type "hey can you review this." Wait for her to respond. She makes edits and sends back v2. Now I have two copies and I have to manage them and not get confused.

The whole point of using AI was to save time. But the time I saved generating the doc, I burned sharing it.

What we actually wanted was dead simple. An agent writes a file. The file persists. Another agent or human can read it. That's it.

What we built

We built an abstraction over S3 that makes it feel like a local filesystem. We're calling it pidrive.

   curl -sSL https://pidrive.ressl.ai/install.sh | bash                                                                                                                                                            
   pidrive register --email agent@company.com --server https://pidrive.ressl.ai                                                                                                                                    
   pidrive mount                                                                                                                                                                                                   
Enter fullscreen mode Exit fullscreen mode

After that, /drive/my/ is your agent's private storage. Standard unix commands:

   echo "SaaS Agreement v1 - Draft" > /drive/my/saas-agreement.txt                                                                                                                                                 
   ls /drive/my/                                                                                                                                                                                                   
   cat /drive/my/saas-agreement.txt                                                                                                                                                                                
   grep -r "indemnification" /drive/my/                                                                                                                                                                            
Enter fullscreen mode Exit fullscreen mode

Under the hood, every read and write goes through WebDAV over HTTPS to our server, then to S3. The agent doesn't know or care. It's just writing to a folder.

The sharing part

This is what actually made it worth building as a separate tool instead of just using rclone or whatever.

   pidrive share saas-agreement.txt --to someone@company.ai                                                                                                                                                           
Enter fullscreen mode Exit fullscreen mode

That's it. My teammate gets an email. She mounts her drive, and the file shows up:

   ls /drive/shared/abhishek@ressl.ai/                                                                                                                                                                             
   saas-agreement.txt                                                                                                                                                                                              
Enter fullscreen mode Exit fullscreen mode

She's reading my actual file, not a copy. If I update the agreement, she sees the update. If I revoke access, the file disappears from her drive instantly. No duplicate versions floating around.

For quick sharing with anyone — even people not on pidrive — there's link sharing:

   pidrive share saas-agreement.txt --link                                                                                                                                                                         
   → https://pidrive.ressl.ai/s/x7k2m9                                                                                                                                                                             
Enter fullscreen mode Exit fullscreen mode

How the SaaS agreement actually went

Here's what the workflow looked like end to end:

  1. I asked Claude Code to draft a SaaS agreement based on our terms
  2. It wrote the file to /drive/my/contracts/saas-v1.txt
  3. I ran pidrive share contracts/saas-v1.txt --to someone@company.ai
  4. My teammate got an email, mounted her drive, read the file
  5. She messaged Claude "change x to y"
  6. Claude updated the clause — same file, same path
  7. No re-sending, no v2 attachment, no confusion about which version is current

To install the skill for any coding agent -

npx skills add abhishek203/pi-drive -g 
Enter fullscreen mode Exit fullscreen mode

Thats it!

Github repo - https://github.com/abhishek203/pi-drive

Top comments (0)