Box Cloud Filesystem
Two modes, one goal: treat Box like a local filesystem.
Transparent mode — initialize a workspace, then every Write or Edit inside it auto-syncs to Box via PostToolUse hooks. No box commands needed.
Explicit mode — search, download, share, or organize files using Box CLI commands directly. See references/operations-guide.md for the full command reference.
Contents
Overview
Box CLI (@box/cli) wraps the full Box API as shell commands. This skill adds three layers:
- Hooks (transparent sync) — PostToolUse hooks on Write/Edit auto-upload changed files to Box.
- Operational judgment — file identity via numeric IDs, version uploads over duplicates, narrow sharing defaults, manifest-based conflict detection.
- Sync patterns — pull/work/push workflow with automatic hook-driven uploads and conflict resolution.
Key principle: inspect before acting, report after acting. Folder ID 0 is always root.
Prerequisites
npm install --global @box/cli
box login
box users:get --me # verify auth + enterprise context
Auth methods: OAuth (interactive), JWT (automation), CCG (server-to-server), Developer Token (testing, 60 min).
jq is required for the hook scripts.
Instructions
Follow this workflow for every Box operation:
- Classify the intent — discover, read, upload, update, organize, sync, share, or cleanup
- Orient — run
box users:get --me, identify target folder ID, check the trust zone
- Discover — list or search Box to understand what exists before modifying anything
- Execute — perform the operation (see
references/operations-guide.md for commands)
- Report — return file IDs, folder IDs, action types, and any conflicts
Operation Trust Zones
| Zone |
Operations |
Behavior |
| Read |
search, list, download, metadata |
Execute freely |
| Create |
upload new, create folders |
Verify parent folder ID first |
| Update |
version upload, move, copy |
Use file ID, prefer files:versions:upload |
| Expose |
share links, access levels |
Default collaborators, never open unless explicit |
| Destructive |
delete, bulk reorganize |
Only on explicit request; summarize first |
Safety Rules
- Inspect folder contents before writing to it.
- Use file IDs, not filenames, when updating — names are not unique in Box.
- Prefer
box files:versions:upload FILE_ID for updates. Avoids 409 conflicts, preserves history.
- Never delete unless explicitly requested. No "convenience cleanup."
- Never create
--access open shared links unless user says "public" or "open."
- Summarize bulk operations before executing.
- Report file ID, folder ID, and action type after every write.
- If unexpected files exist in a folder, stop and ask before modifying.
Quick Command Reference
box folders:items FOLDER_ID --json # list folder
box search "query" --type file --json # search
box files:download FILE_ID --destination ./ # download
box files:upload ./file.txt --parent-id FOLDER_ID # upload new
box files:versions:upload FILE_ID ./file.txt # update existing
box files:share FILE_ID --access collaborators # share (narrow)
box folders:download FOLDER_ID --destination ./ # bulk download
Full command reference with examples: references/operations-guide.md
Workspace Sync Pattern
Initialize a workspace, work locally, push changes back. The manifest tracks file IDs.
${CLAUDE_PLUGIN_ROOT}/scripts/box-init-workspace.sh FOLDER_ID /tmp/box-workspace
With hooks active, every Write/Edit auto-syncs. For manual sync, compare local state against the manifest:
- Changed file in manifest →
box files:versions:upload FILE_ID (version update)
- New file not in manifest →
box files:upload --parent-id FOLDER_ID (new upload)
- Deleted locally → do NOT auto-delete from Box; ask user
- Conflict detected → warn user before overwriting
Full sync workflow with conflict detection: references/sync-pattern.md
Output
Every write operation returns:
- File/folder ID
- Parent folder ID
- Action type (created / versioned / moved / copied / shared)
- Access level (if sharing)
- Conflicts or skipped items
Read operations return JSON with id, name, size, modified date.
Error Handling
| Error |
Recovery |
Not Found (404) |
Verify ID with box search or re-list parent folder |
Conflict (409) |
Use files:versions:upload to update, or --name for distinct file |
Forbidden (403) |
Re-run box login or check JWT scopes |
Rate Limited (429) |
CLI retries automatically; batch via --bulk-file-path |
Auth expired |
Run box login; use JWT/CCG for production |
box: command not found |
npm install --global @box/cli |
| Name collision |
Use file ID, never filename, to identify targets |
| Local/remote divergence |
Re-download, diff, ask user which to keep |
Always report what failed and what succeeded. Never silently skip. Full error table: references/operations-guide.md
Examples
Back up docs to Box:
box folders:create 0 "my-project-docs" --json
box files:upload docs/README.md --parent-id FOLDER_ID
box folders:share FOLDER_ID --access collaborators
Pull, analyze, push back:
box search "Q1 sales" --type file --json
box files:download FILE_ID --destination /tmp/box-workspace/
# analyze locally, then push result
box files:upload /tmp/box-workspace/summary.md --parent-id PARENT_ID
Workspace sync (with hooks):
${CLAUDE_PLUGIN_ROOT}/scripts/box-init-workspace.sh FOLDER_ID /tmp/box-workspace
# edit files normally — hooks auto-sync to Box
More detailed examples: references/sync-pattern.md
Resources
1---
2name: box-cloud-filesystem
3description: |
4 Cloud filesystem operations via Box CLI. Use when the user mentions
5 Box, cloud files, cloud storage, uploading to the cloud, sharing files,
6 document management, or syncing project files offsite. Trigger with
7 "upload to box", "save to cloud", "pull from box", "search my box files",
8 "share this file", "box sync", "cloud backup", or "box filesystem".
9allowed-tools: Read, Write, Edit, Bash(box:*), Bash(npm:*), Bash(npx:*), Glob, Grep
10version: 1.0.0
11author: Jeremy Longshore <jeremy@intentsolutions.io>
12license: MIT
13compatible-with: claude-code, codex, openclaw
14tags: [box, cloud-storage, filesystem, sync, collaboration, document-management]
15metadata:
16 source: https://skillmd.com/skills/micsapp/box-cloud-filesystem
17---
18
19# Box Cloud Filesystem
20
21Two modes, one goal: treat Box like a local filesystem.
22
23**Transparent mode** — initialize a workspace, then every Write or Edit inside it auto-syncs to Box via PostToolUse hooks. No `box` commands needed.
24
25**Explicit mode** — search, download, share, or organize files using Box CLI commands directly. See `references/operations-guide.md` for the full command reference.
26
27## Contents
28
29- [Overview](#overview)
30- [Prerequisites](#prerequisites)
31- [Instructions](#instructions)
32- [Workspace Sync Pattern](#workspace-sync-pattern)
33- [Output](#output)
34- [Error Handling](#error-handling)
35- [Examples](#examples)
36- [Resources](#resources)
37
38## Overview
39
40Box CLI (`@box/cli`) wraps the full Box API as shell commands. This skill adds three layers:
41
42- **Hooks (transparent sync)** — PostToolUse hooks on Write/Edit auto-upload changed files to Box.
43- **Operational judgment** — file identity via numeric IDs, version uploads over duplicates, narrow sharing defaults, manifest-based conflict detection.
44- **Sync patterns** — pull/work/push workflow with automatic hook-driven uploads and conflict resolution.
45
46Key principle: **inspect before acting, report after acting.** Folder ID `0` is always root.
47
48## Prerequisites
49
50```bash
51npm install --global @box/cli
52box login
53box users:get --me # verify auth + enterprise context
54```
55
56Auth methods: OAuth (interactive), JWT (automation), CCG (server-to-server), Developer Token (testing, 60 min).
57
58`jq` is required for the hook scripts.
59
60## Instructions
61
62Follow this workflow for every Box operation:
63
641. **Classify the intent** — discover, read, upload, update, organize, sync, share, or cleanup
652. **Orient** — run `box users:get --me`, identify target folder ID, check the trust zone
663. **Discover** — list or search Box to understand what exists before modifying anything
674. **Execute** — perform the operation (see `references/operations-guide.md` for commands)
685. **Report** — return file IDs, folder IDs, action types, and any conflicts
69
70### Operation Trust Zones
71
72| Zone | Operations | Behavior |
73|------|-----------|----------|
74| **Read** | search, list, download, metadata | Execute freely |
75| **Create** | upload new, create folders | Verify parent folder ID first |
76| **Update** | version upload, move, copy | Use file ID, prefer `files:versions:upload` |
77| **Expose** | share links, access levels | Default `collaborators`, never `open` unless explicit |
78| **Destructive** | delete, bulk reorganize | Only on explicit request; summarize first |
79
80### Safety Rules
81
821. Inspect folder contents before writing to it.
832. Use file IDs, not filenames, when updating — names are not unique in Box.
843. Prefer `box files:versions:upload FILE_ID` for updates. Avoids 409 conflicts, preserves history.
854. Never delete unless explicitly requested. No "convenience cleanup."
865. Never create `--access open` shared links unless user says "public" or "open."
876. Summarize bulk operations before executing.
887. Report file ID, folder ID, and action type after every write.
898. If unexpected files exist in a folder, stop and ask before modifying.
90
91### Quick Command Reference
92
93```bash
94box folders:items FOLDER_ID --json # list folder
95box search "query" --type file --json # search
96box files:download FILE_ID --destination ./ # download
97box files:upload ./file.txt --parent-id FOLDER_ID # upload new
98box files:versions:upload FILE_ID ./file.txt # update existing
99box files:share FILE_ID --access collaborators # share (narrow)
100box folders:download FOLDER_ID --destination ./ # bulk download
101```
102
103Full command reference with examples: `references/operations-guide.md`
104
105## Workspace Sync Pattern
106
107Initialize a workspace, work locally, push changes back. The manifest tracks file IDs.
108
109```bash
110${CLAUDE_PLUGIN_ROOT}/scripts/box-init-workspace.sh FOLDER_ID /tmp/box-workspace
111```
112
113With hooks active, every Write/Edit auto-syncs. For manual sync, compare local state against the manifest:
114
115- Changed file in manifest → `box files:versions:upload FILE_ID` (version update)
116- New file not in manifest → `box files:upload --parent-id FOLDER_ID` (new upload)
117- Deleted locally → do NOT auto-delete from Box; ask user
118- Conflict detected → warn user before overwriting
119
120Full sync workflow with conflict detection: `references/sync-pattern.md`
121
122## Output
123
124Every write operation returns:
125
126- File/folder ID
127- Parent folder ID
128- Action type (created / versioned / moved / copied / shared)
129- Access level (if sharing)
130- Conflicts or skipped items
131
132Read operations return JSON with id, name, size, modified date.
133
134## Error Handling
135
136| Error | Recovery |
137|-------|----------|
138| `Not Found` (404) | Verify ID with `box search` or re-list parent folder |
139| `Conflict` (409) | Use `files:versions:upload` to update, or `--name` for distinct file |
140| `Forbidden` (403) | Re-run `box login` or check JWT scopes |
141| `Rate Limited` (429) | CLI retries automatically; batch via `--bulk-file-path` |
142| `Auth expired` | Run `box login`; use JWT/CCG for production |
143| `box: command not found` | `npm install --global @box/cli` |
144| Name collision | Use file ID, never filename, to identify targets |
145| Local/remote divergence | Re-download, diff, ask user which to keep |
146
147Always report what failed and what succeeded. Never silently skip. Full error table: `references/operations-guide.md`
148
149## Examples
150
151**Back up docs to Box:**
152```bash
153box folders:create 0 "my-project-docs" --json
154box files:upload docs/README.md --parent-id FOLDER_ID
155box folders:share FOLDER_ID --access collaborators
156```
157
158**Pull, analyze, push back:**
159```bash
160box search "Q1 sales" --type file --json
161box files:download FILE_ID --destination /tmp/box-workspace/
162# analyze locally, then push result
163box files:upload /tmp/box-workspace/summary.md --parent-id PARENT_ID
164```
165
166**Workspace sync (with hooks):**
167```bash
168${CLAUDE_PLUGIN_ROOT}/scripts/box-init-workspace.sh FOLDER_ID /tmp/box-workspace
169# edit files normally — hooks auto-sync to Box
170```
171
172More detailed examples: `references/sync-pattern.md`
173
174## Resources
175
176- Box CLI: https://github.com/box/boxcli
177- Box Developer Docs: https://developer.box.com/
178- Box API Reference: https://developer.box.com/reference/
179- Box pricing: https://www.box.com/ (free tier available for individual users)