77c2d4bfd3
All three docs now use generic examples only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.7 KiB
2.7 KiB
Claude Shorthand Cheat-Sheet
Core Operators
| Pattern | Meaning | Example |
|---|---|---|
→ |
then (sequential) | ssh server → check status |
+ |
and (parallel) | check proxy + check dns |
X ? Y : Z |
if X then Y else Z | port open ? connect : debug |
!X |
don't / skip | !error handling |
w/ |
with | py script w/ argparse |
@ |
at path/location | new config @ /etc/nginx/ |
re: |
regarding | fix re: pool degraded drive |
= |
set/assign | port=3000, lang=python |
~ |
approximately / like | ~50 lines, ~yesterday |
>> |
output to / save to | results >> /tmp/report.txt |
<- |
from / source | data <- rss API |
Spec Block (complex tasks)
feat: <short description>
- lang: <language>
- deps: <dependencies>
- in: <input/source>
- out: <output/target>
- !: <things to skip>
Examples
Verbose → Compressed
Service setup:
# Before (~80 tokens):
"Please create a new Python service in the automation directory
that connects to the RSS API, fetches today's articles, formats
them for the printer, and runs as a systemd service"
# After (~20 tokens):
feat: daily print @ automation/
- rss API → format → printer
- systemd service
Infra task:
# Before (~50 tokens):
"SSH into the storage server, check if any drives in the pool are
degraded, and if so tell me which ones need replacement"
# After (~12 tokens):
storage-server → pool degraded drives? → list replacements
Multi-step:
# Before (~60 tokens):
"First read the proxy config, then add a new reverse proxy entry for
wiki.example.com pointing to the backend on port 3000, and also
add it to DNS"
# After (~15 tokens):
add wiki.example.com → backend:3000 to proxy + dns
Conditional:
# Before (~45 tokens):
"Check if the LLM service is running on the inference server. If it is,
test the model. If it's not running, start it first then test."
# After (~15 tokens):
inference: llm running ? test model : start → test
Anchors (use known names)
Define short aliases in your CLAUDE.md, then use them everywhere:
| Say | Not |
|---|---|
db-server |
"the PostgreSQL database server at 10.0.1.50" |
pool |
"the ZFS storage pool on the NAS" |
proxy |
"the Caddy/nginx reverse proxy container" |
dns |
"the Pi-hole DNS server" |
workstation |
"this machine, my desktop PC" |
llm |
"the LLM inference service" |
Quick Rules
- Drop articles (a, the, an) — Claude doesn't need them
- Drop politeness (please, could you, I'd like) — zero effect on output
- Use aliases from CLAUDE.md — they're shared vocabulary
- Bullets > paragraphs — less ambiguous, fewer tokens
- Imply obvious steps — "add X to caddy" implies read/edit/save