/zarr-data-format:zarr-fundamentalsfrom zarr-data-format
Creates, opens, indexes, and organizes chunked N-dimensional Zarr arrays and groups using the zarr-python 3 API. Handles format v2/v3, attributes, fill values, dimension names, sharding, and parallel write issues.
Ships in zarr-data-format. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Creates, opens, indexes and organizes chunked N-dimensional Zarr arrays and groups with the zarr-python 3 API, in Zarr format v3 (the default) or v2.
Core principle: zarr reads, decodes and writes whole chunks. In a sharded array the inner chunk is the read unit and the shard is the stored object, so every write rewrites its whole shard. Match chunks to reads, and give each parallel writer whole chunks (whole shards when sharded).
Docs: https://zarr.readthedocs.io/ | Spec: https://zarr-specs.readthedocs.io/
oindex, vindex, blocksAttributeError or TypeErrorWhen NOT to use:
to_zarr, open_zarr, append_dim, region writes): zarr-xarray-integrationInstall zarr (pip or pixi); numcodecs comes with it. There is no zarr[extra].
import numpy as np
import zarr
z = zarr.create_array("data.zarr", shape=(2000, 2000), chunks=(500, 500), dtype="float32",
fill_value=np.nan, dimension_names=("y", "x"), attributes={"units": "K"})
z[:500, :] = 1.0 # covers 4 whole chunks
z = zarr.open_array("data.zarr", mode="r")
root = zarr.open_group("experiment.zarr", mode="w")
temp = root.create_group("observations").create_array(
"temperature", shape=(365, 180, 360), chunks=(30, 90, 180), dtype="float32")
root.attrs["project"] = "Climate Study"
print(root.tree()) # needs the optional `rich` package
r read-only and r+ read-write (both need an existing node), w- create (fails if anything exists), a open or create, w replace (deletes existing data and attributes). Store classes take read_only=True, not mode.chunks= is the inner chunk, shards= a multiple of it.np.nan for floats when 0 is valid data.zarr.consolidate_metadata(path) lets a group open in one read. Re-run it after adding nodes.z.oindex[rows, cols] takes the outer product, z.vindex[rows, cols] takes point pairs (or a mask shaped like z), and z.blocks[i, j] takes one chunk (one shard when sharded).Format v2 vs v3. zarr-python 3 reads and writes both, with async I/O for both:
| v2 | v3 | |
|---|---|---|
| Metadata | .zarray, .zgroup, .zattrs | One zarr.json per node |
| Default chunk keys | 0.0 | c/0/0 |
| Default compressor (zarr-python 3.1.5) | zarr.create_array: Zstd; Group.create_array / xarray: Blosc lz4 | Zstd |
shards=, dimension_names= | ValueError | Supported |
| Consolidated metadata | .zmetadata | Inside root zarr.json (zarr-python extension, warns) |
Default to v3. Fixed-length U/S and structured dtypes raise UnstableSpecificationWarning in v3: other readers may fail.
Parallel writes: concurrent reads are safe, and so are writers that each cover whole, distinct chunks (shards when sharded), in threads or processes. Two writers in one chunk or shard each rewrite the whole object, so the later one erases the other's values. zarr-python 3 has no synchronizers.
| Mistake | Fix |
|---|---|
FSStore, DirectoryStore, LRUStoreCache: AttributeError | FsspecStore.from_url(...), LocalStore or a path string |
zarr.ProcessSynchronizer: AttributeError; synchronizer= does nothing but warn | Partition writes on chunk or shard boundaries |
create_array(compressor=...), or z.compressor on v3: TypeError | compressors=, z.compressors |
len(z); z.resize(200, 10): TypeError | z.shape[0]; z.resize((200, 10)) |
chunks= larger than shards=: ValueError | shards is a multiple of chunks |
z["field"] on a structured array: TypeError | Read records first: z[0:1000]["field"] |
mode="w" to edit an existing store | mode="r+" or "a" |
| Resource | Load when |
|---|---|
| references/patterns.md | Hierarchies, appending, indexing, sharding, parallel writes |
| references/examples.md | CF-style dataset, multi-instrument store, structured dtypes |
| references/common-issues.md | Format confusion, lost attributes, OOM, lost writes |
python assets/zarr-quickstart.py | Runnable demo in a temporary directory |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (uw-ssec/savvy) — no native marketplace selected
npx claudepluginhub p/uw-ssec-zarr-data-format-plugins-zarr-data-format5 skills in this plugin
/cloud-storage-backendsUse when reading or writing Zarr data on Amazon S3, Google Cloud Storage, Azure Blob or an S3-compatible endpoint such as MinIO, when setting up FsspecStore, ObjectStore (obstore), s3fs, gcsfs, adlfs or Icechunk storage and credentials, or when remote Zarr access fails or is slow, with symptoms like 403 Forbidden, NoCredentialsError, requester-pays buckets, slow store opens, timeouts, high GET-request bills, CORS errors, or an fsspec simplecache or filecache that errors or never hits./compression-codecsUse when choosing or configuring Zarr compression in zarr-python 3 (Blosc, Zstd, Gzip, LZ4, LZMA, BZ2; numcodecs filters such as Delta, Quantize, BitRound, FixedScaleOffset, PackBits; compressors=, filters=, serializer=), when v2-style compressor= or numcodecs code fails on a v3 array, or when a store compresses poorly, decompresses slowly, raises codec errors, or may hold corrupted chunks after Blosc multiprocessing use./data-migrationUse when converting HDF5 (.h5) or NetCDF (.nc) files to Zarr, migrating scientific datasets or a Zarr v2 store to Zarr v3, or building a virtual Zarr store over existing files with VirtualiZarr or kerchunk. Also use when a converted store lost scale_factor, _FillValue or time units, kept the old chunk layout, shows phony_dim names, or fails validation against its source./zarr-xarray-integrationUse when reading or writing Zarr stores with xarray (open_zarr, to_zarr), setting to_zarr encoding, appending with append_dim, writing regions from parallel workers, or aligning Dask chunks with Zarr chunks or shards. Also use when to_zarr raises "would overlap multiple Dask chunks" or "must be an int or a tuple of ints", when appended times or coordinates come back wrong, or when a consolidated store opens stale.Other plugins' skills for the same job