Skip to content
Back to skills

Session Backup

BSecurity

Back up the user's Cowork skills, plugins and Claude docs folder to the user's own Google Drive, after showing exactly what will be uploaded and getting a yes. Use for "back up my session", "/backup-now", or a scheduled task the user created.

  • 15 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 7, 2026
ai-agentspythongoshellbashnodegitapi

Works with

  • api
  • mcp

Security analysis

B88/100
  • criticalReads or references SSH private keys

Pro scans all 2 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add MSApps-Mobile/claude-plugins --skill session-backup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Session Backup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Session Backup
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/msapps-mobile-session-backup/badge)](https://www.skillsdirectory.com/skills/msapps-mobile-session-backup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: daily-cowork-backup
description: Back up the user's Cowork skills, plugins and Claude docs folder to the user's own Google Drive, after showing exactly what will be uploaded and getting a yes. Use for "back up my session", "/backup-now", or a scheduled task the user created.
---

# Cowork backup to your own Google Drive

Zips three folders and uploads them to a Google Apps Script web app **that the user deployed to their own Google account** (see CONNECTORS.md). Nothing else is sent anywhere.

## Rules (always apply)

- **Confirm first.** Before the first upload of a run, list the zip files that will be uploaded (names and sizes) and the destination host, and wait for the user to say yes. In a scheduled task the user created for this purpose, that task is the standing yes for the same three zips; do not add other files.
- **Never delete the user's files.** This skill deletes only the temporary zips and the temp directory it created itself in this run.
- **Never read or upload credentials.** Do not read `~/.cowork-gdrive-config.json`, `.env`, keychains, shell profiles or any token file. The upload URL and API key come only from the plugin options (`upload_url`, `api_key`), exposed to `scripts/upload.py` as environment variables.
- **Never write** to shell profiles, git config, package files or Claude settings, and never create launchd/cron jobs. Scheduling is done by the user in Cowork's Scheduled tasks (Step 0 of `/backup-setup`) and removed there.

## Step 1: Locate sources

```bash
SESSION_MNT=$(ls -d /sessions/*/mnt 2>/dev/null | head -1)   # Cowork VM; empty on a plain Mac
echo "SESSION_MNT=${SESSION_MNT:-<none, using home directory>}"
```

Sources (skip any that do not exist, and say so in the report):

| Zip | Source |
|---|---|
| `skills-backup.zip` | `$SESSION_MNT/.claude/skills/` (or `~/.claude/skills/`) |
| `claude-docs-backup.zip` | `$SESSION_MNT/Claude/` (or `~/Documents/Claude/`) |
| `plugins-backup.zip` | `$SESSION_MNT/.remote-plugins/` (or `~/.claude/plugins/`) |

## Step 2: Build zips in a private temp directory

```bash
WORK=$(mktemp -d "${TMPDIR:-/tmp}/cowork-backup.XXXXXX")
EXCLUDES=(-x '*/node_modules/*' -x '*/.git/*' -x '*/.next/*' -x '*.pyc'
          -x '*.png' -x '*.jpg' -x '*.jpeg' -x '*.gif' -x '*/package-lock.json'
          -x '*/credentials/*' -x '*/.env' -x '*/.env.*' -x '*.pem' -x '*.key'
          -x '*/.netrc' -x '*/id_rsa*' -x '*cowork-gdrive-config.json')
cd "<parent of the source folder>" && zip -r "$WORK/skills-backup.zip" skills/ "${EXCLUDES[@]}"
```

Repeat for the docs folder and the plugins folder with their zip names. The exclusions keep credential-like files and the backup config out of every zip. If `claude-docs-backup.zip` is over 30 MB, split it into `claude-docs-gcalmcp.zip` (the `gcal-mcp/` subfolder) and `claude-docs-rest.zip` (everything else), using the same exclusions.

## Step 3: Confirm, then upload

Show `ls -lh "$WORK"/*.zip` and the destination host (`script.google.com`), get the yes, then run:

```bash
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/upload.py" "$WORK"/*.zip
```

`upload.py` refuses any host other than `script.google.com` / `script.googleusercontent.com`, uploads only `.zip` files into the `Cowork-Backups` Drive folder with `replaceExisting: true`, and prints each JSON result. In the Cowork VM, where the proxy blocks `script.google.com`, run the same command on the Mac side through Desktop Commander. If an upload fails with 413, split that zip and retry.

## Step 4: Clean up (only what this run created)

```bash
rm -f "$WORK"/*.zip && rmdir "$WORK"
```

## Step 5: Report

List each uploaded file with its Drive link from the JSON response, and note any source that was skipped.

## Notes

- Each run is idempotent: `replaceExisting: true` overwrites the previous backup.
- Excluded on purpose: `node_modules`, `.git`, build caches, images, lock files, and anything credential-like (see the list above).

Files in this skill

  • SKILL.md8.6 KB
  • references/backup-workflow.md2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.