From bytestash
This skill should be used when the user asks to save a snippet, store code, create a snippet, search snippets, find a snippet, share a snippet, list snippets, delete a snippet, add to ByteStash, or mentions ByteStash or snippet management.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bytestash:bytestashThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
ByteStash is a self-hosted code snippet management service with multi-file support, sharing capabilities, and organization features. This skill provides **read-write** access to manage snippets with full CRUD operations.
ByteStash is a self-hosted code snippet management service with multi-file support, sharing capabilities, and organization features. This skill provides read-write access to manage snippets with full CRUD operations.
Capabilities:
Authentication: JWT via the bytestashauth: bearer <token> header.
Warning: API keys do NOT work for snippet writes on ByteStash ≤ 1.0.0. Its
authenticateTokenmiddleware ignoresreq.apiKeyand still demands a JWT, sox-api-keyreturns401 Authentication requiredon/api/snippets. The wrapper therefore authenticates with a JWT (login or a pre-minted token). API keys only work on the read-only public endpoints (/api/public/snippets). This is fixed on ByteStashmain(theif (req.apiKey) return next()bypass) — once released,x-api-keywill work for writes again.
Required credentials in ~/.lab/.env:
BYTESTASH_URL="https://bytestash.example.com"
BYTESTASH_USERNAME="<your_username>"
BYTESTASH_PASSWORD="<your_password>" # recommended: wrapper logs in each run, never expires
# --- or, instead of username/password: ---
BYTESTASH_TOKEN="<a_jwt>" # pre-minted JWT (expires; login is more durable)
BYTESTASH_API_KEY="<your_api_key>" # optional; only useful for /api/public reads (and future versions)
The wrapper resolves auth in this order: BYTESTASH_TOKEN → BYTESTASH_USERNAME+BYTESTASH_PASSWORD
(via POST /api/auth/login). Override the env file path with BYTESTASH_ENV_FILE.
How to get credentials:
jwt.sign({id,username}, JWT_SECRET)) or copy bytestash_token
from your browser's cookies/localStorage. Note JWTs expire (default 24h).Security:
chmod 600 ~/.lab/.env.env to version controlBYTESTASH_TOKEN is a standing credential — revoke by rotating the
server's JWT_SECRET. Prefer username/password where possible.All commands use the bash script wrapper in scripts/bytestash-api.sh.
cd skills/bytestash
./scripts/bytestash-api.sh list
# Search by title (case-insensitive partial match)
./scripts/bytestash-api.sh search "docker"
# Search by category
./scripts/bytestash-api.sh search --category "bash"
./scripts/bytestash-api.sh get <snippet-id>
# Single fragment (inline code)
./scripts/bytestash-api.sh create \
--title "Docker Compose Example" \
--description "Production-ready compose file" \
--categories "docker,devops" \
--code "version: '3.8'..." \
--language "yaml" \
--filename "docker-compose.yml"
# Multiple fragments (from files)
./scripts/bytestash-api.sh push \
--title "FastAPI Setup" \
--description "Complete FastAPI project structure" \
--categories "python,api" \
--files "app.py,requirements.txt,Dockerfile"
./scripts/bytestash-api.sh update <snippet-id> \
--title "New Title" \
--description "Updated description" \
--categories "new,tags"
# Prompts for confirmation
./scripts/bytestash-api.sh delete <snippet-id>
# Create public share link
./scripts/bytestash-api.sh share <snippet-id>
# Create protected share (requires auth)
./scripts/bytestash-api.sh share <snippet-id> --protected
# Create expiring share (24 hours)
./scripts/bytestash-api.sh share <snippet-id> --expires 86400
# List all shares for a snippet
./scripts/bytestash-api.sh shares <snippet-id>
# Delete share link
./scripts/bytestash-api.sh unshare <share-id>
# View shared snippet
./scripts/bytestash-api.sh view-share <share-id>
When the user asks about ByteStash:
"Save this code as a snippet"
create command with inline codepush command with file paths"Find my Docker snippets"
search --category docker or search "docker"get <id> to show full snippet"Share this snippet publicly"
share <snippet-id> to create public link{BYTESTASH_URL}/s/{share-id}--protected or --expires flags"What snippets do I have?"
list command"Delete this snippet"
delete <snippet-id>"Organize my snippets by category"
listupdate commandByteStash supports snippets with multiple code fragments (files). Each fragment has:
app.py, Dockerfile)python, dockerfile)When to use multi-fragment:
Data Model:
{
"id": 123,
"title": "Snippet Title",
"description": "Detailed description",
"categories": ["tag1", "tag2"],
"fragments": [
{
"id": 456,
"file_name": "example.py",
"code": "print('hello')",
"language": "python",
"position": 0
}
],
"updated_at": "2024-01-01T00:00:00Z",
"share_count": 2
}
Authentication:
bytestashauth: bearer <jwt> header. The wrapper obtains the JWT from
BYTESTASH_TOKEN, or by logging in with BYTESTASH_USERNAME/BYTESTASH_PASSWORD./api/snippets*) are JWT-gated on ByteStash ≤ 1.0.0; the
x-api-key header is rejected there (see the warning at the top of this skill)./api/public/snippets).Share Links:
abc123def456)Destructive Operations:
Output Format:
jq for filtering/formatting (e.g., ./bytestash-api.sh list | jq '.[] | select(.categories[] == "docker")')Limitations:
{data:[...], pagination} — the wrapper unwraps .data for you/api/share*)references/api-endpoints.md for complete API referencereferences/quick-reference.md for command examplesreferences/troubleshooting.md for common failures{BYTESTASH_URL}/api-docs/{BYTESTASH_URL}Run this skill's scripts with the Bash tool. If using the zsh-tool instead, pass pty: true — without it, command output is not returned even though commands execute.
./skills/bytestash/scripts/bytestash-api.sh [args]
npx claudepluginhub jmagar/dendrite --plugin bytestashScans the codebase for `ponytail:` comments and compiles a debt ledger of deliberate shortcuts and deferrals, flagging entries with no upgrade path.