Generated banner for Datalad
Generated logo for Datalad

Datalad

K-DenseCommunityCreated by Dylan PulverDistributed by K-Dense

  • Skill
  • Tool integration
  • Science and research
  • MIT
  • Low risk

From the author

Retrieves, versions, and publishes scientific datasets with DataLad and git-annex, and captures computational provenance with datalad run, rerun, and containers-run. Use when cloning or fetching data from OpenNeuro, DANDI, datasets.datalad.org, or any DataLad dataset; when a file in a dataset reads as a broken symlink or a small pointer instead of real data; when an analysis needs a machine-readable record of how each output was produced so it can be re-executed; or when publishing a dataset to siblings such as a GitHub repository plus a storage remote. Also use to decide between DataLad and plain Git for a data-carrying repository.
— the description by Dylan Pulver

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

DataLad provides a data management layer over Git and git-annex, designed to handle large scientific datasets and ensure computational reproducibility. It tracks dataset structure and history with Git, while managing large file content via git-annex. By recording commands, inputs, and outputs through datalad run, it creates machine-readable provenance records that allow for exact re-execution of analyses. It supports modular project structures using subdatasets and facilitates publishing to multiple storage remotes, ensuring that data and its associated provenance remain linked and accessible.

What it does

  • Retrieves and versions large scientific datasets using git-annex for content management.
  • Captures computational provenance by recording commands and their dependencies in commits.
  • Enables re-execution of analysis steps using datalad rerun to ensure reproducibility.
  • Manages nested project structures through independent subdatasets.
  • Integrates with container technologies to track software environments alongside data.
  • Publishes datasets to multiple siblings including Git hosting and storage remotes.

When to use it

  • When working with datasets too large for standard Git repositories.
  • When you need to ensure an analysis is fully re-executable with a machine-readable record.
  • When consuming public scientific datasets from repositories like OpenNeuro or DANDI.
  • When managing complex projects that require nesting multiple independent datasets.
  • When you need to track which copies of data exist across different storage locations.

Advantages

  • Enables computational reproducibility by linking code, data, and execution records.
  • Handles large files efficiently without bloating the primary Git history.
  • Supports modularity by allowing subdatasets to maintain their own independent history.
  • Provides a clear path for publishing data and code to multiple locations simultaneously.
  • Allows selective retrieval of data to save local disk space.

Usage examples

“datalad clone https://github.com/OpenNeuroDatasets/ds000001.git”
Creates a local clone of the dataset, fetching the Git history and structure while leaving large annexed files as pointers.
“datalad get sub-01/anat/sub-01_T1w.nii.gz”
Downloads the actual content for the specified file, replacing the pointer with the real data.
“datalad run -m 'process data' --input raw.nii.gz --output processed.nii.gz 'fslmaths raw.nii.gz -bin processed.nii.gz'”
Executes the command, records the input and output dependencies, and commits the result with a provenance record.
“datalad rerun”
Reads the provenance record from the most recent commit and re-executes the command to reproduce the output.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/k-dense-ai/datalad/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip datalad.zip -d .agents/skills

Documentation by Dylan Pulver

DataLad

Overview

DataLad is a data management layer over Git and git-annex. Git tracks the dataset structure, small text files, and the history. git-annex tracks the content of large files, storing each file as a key and keeping the bytes somewhere that is not necessarily the local repository.

A normal clone retrieves Git history and the top-level file listing while leaving annexed bytes unfetched. Installed subdatasets have their own histories; a clone does not automatically populate them. Clone cost depends on Git history and file count, not just the data volume. Retrieve annexed bytes selectively with datalad get.

The second thing DataLad adds is provenance. datalad run executes a command and commits the result together with a machine-readable record of the command, its inputs, and its outputs. datalad rerun reads that record back and re-executes it. This turns "how was this figure produced" from an archaeology problem into a command.

When to use DataLad instead of plain Git

Use DataLad when any of the following holds:

  • Files are too large for Git to handle comfortably, or the total exceeds what every collaborator wants on disk.

  • Data lives in more than one place (a lab server, a cluster scratch, S3, a supercomputer) and you need to know which copies exist.

  • The analysis must be re-executable, and a plain commit message is not enough evidence.

  • You are consuming published datasets from OpenNeuro, DANDI, or datasets.datalad.org, which are distributed as DataLad datasets.

  • The project nests other datasets inside it and you want each one to keep its own independent history.

Use plain Git when the repository is code and text only, everything fits comfortably in Git, and nobody needs partial checkouts. DataLad on top of a small pure-code repository adds indirection without buying anything.

Installation

# git-annex is NOT written in Python but is available from PyPI if you already
# have git itself installed:
uv pip install git-annex
# You can also install it first from the system
# (Debian/Ubuntu: apt install git-annex; macOS: brew install git-annex;
#  conda-forge: conda install -c conda-forge git-annex)
uv pip install "datalad==1.6.5"
uv pip install "datalad-container==1.2.6"   # only for containers-run

datalad wtf --section dependencies   # confirm git-annex version is visible

The PyPI git-annex package supplies platform-specific binaries. The reviewed 10.20260901.post1 wheels cover Linux glibc 2.34+ (x86_64/ARM64), macOS ARM64 14+ and x86_64 15+, and Windows x86_64. Use a system package when no wheel matches. Keep its environment on PATH and verify the executable; the wheel does not supply Git itself. Configure Git author name/email before creating or saving a dataset.

datalad wtf prints the resolved environment and is the first thing to run when behaviour looks impossible. An old or missing git-annex is behind a large share of confusing errors.

DataLad is MIT licensed; git-annex has a separate AGPL license. Consult the upstream license when redistributing either tool.

The failure that bites first: pointers are not data

After datalad clone, annexed files exist as symlinks into .git/annex/objects/ (or as small pointer files where symlinks are unavailable, such as on Windows or a crippled filesystem). Nothing has downloaded the content yet.

Illustrative remote-data example; inspect the selected revision for the exact path and install NiBabel before the Python read. The refresh tested equivalent local pointer/get behavior without downloading imaging data.

datalad clone https://github.com/OpenNeuroDatasets/ds000001.git
cd ds000001
ls sub-01/anat/            # the file is listed
python -c "import nibabel; nibabel.load('sub-01/anat/sub-01_T1w.nii.gz')"   # fails
datalad get sub-01/anat/sub-01_T1w.nii.gz                                   # now it works

The failure mode to recognise: a tool reports the file as empty, truncated, corrupt, "not a gzip file", or a broken symlink, and the file size on disk is a few hundred bytes. These symptoms can indicate an unfetched annex pointer; confirm with annex status before diagnosing corruption. Run datalad get before reading data, and treat "file exists" as insufficient evidence that its content is present.

Before an analysis touches a directory, fetch it explicitly:

datalad get sub-01/                  # everything under a path
datalad get -r .                     # everything, including subdatasets
datalad get -n -r .                  # subdataset structure only, no file content

datalad status --annex availability checks which content is present locally, and git annex whereis <path> reports which repositories hold a given file. whereis reads recorded state and does not contact the remotes, so it tells you what git-annex last learned rather than what is true right now.

See data-access.md for finding datasets, subdataset behaviour, dropping content safely, and repairing a dataset.

Recording provenance with datalad run

datalad run is the reason to reach for DataLad in a methods context. It saves the command alongside its effect, in the same commit:

Illustrative FSL example (requires bet and an existing derivatives/ directory):

datalad run -m "extract brain and mask" \
  --input "sub-01/anat/sub-01_T1w.nii.gz" \
  --output "derivatives/sub-01_brain.nii.gz" \
  --output "derivatives/sub-01_brain_mask.nii.gz" \
  "bet {inputs[0]} {outputs[0]} -m"

What each part does, and why skipping it hurts:

  • --input retrieves the content before running, so the command does not fail on a pointer. It also records the dependency, which is what lets rerun fetch the same inputs on a different machine.

  • --output unlocks or removes the target first, so git-annex does not refuse to write over content it is protecting. Without it, a second run of the same command commonly fails with a permission error on an annexed file that looks read-only.

  • {inputs} and {outputs} expand to those values. {pwd}, {dspath}, and {tmpdir} are also available, and {inputs[0]} indexes individual entries.

  • The commit message carries a JSON run record between === Do not change lines below === and ^^^ Do not change lines above ^^^. Do not hand-edit that block; rerun parses it.

datalad run refuses to start when the dataset has unsaved modifications, because an unclean starting state makes the record unreliable. Save or discard first, or pass --explicit to save only declared outputs. This does not capture unsaved input changes; save all dependencies before claiming the run is reproducible. Check a command before committing to it with --dry-run basic or --dry-run command.

A run that changes nothing produces no commit, exactly as datalad save does.

run records the command and dataset state; it does not freeze arbitrary host-installed software or external services. Version an environment lockfile and scripts as declared inputs, or use a tracked container image with containers-run. Record random seeds and relevant runtime settings, then test rerun from a fresh environment before claiming computational reproducibility.

Re-executing
datalad rerun                       # redo the run recorded at HEAD
datalad rerun --report              # show what would be done, change nothing
datalad rerun --script recompute.sh # extract the commands instead of running them
datalad rerun --since <commit> -b check <revision>   # replay a range onto a new branch

--report only inspects the plan; it does not execute or validate the result. A branch (-b) preserves the original commits, but uses the same worktree. See the reference for a --since/--onto replay that starts before the first run, and compare annex keys or content checksums as well as scientific outputs.

Containers

With the datalad-container extension, register an image once and every subsequent run records which image produced the outputs:

Illustrative container workflow using a previously built local SIF image (not executed in this refresh; the runtime and image must be available):

datalad containers-add fsl --url /path/to/fsl.sif \
  --call-fmt 'apptainer exec {img} {cmd}'
datalad containers-run -n fsl -m "brain and mask in container" \
  --input "sub-01/anat/sub-01_T1w.nii.gz" \
  --output "derivatives/sub-01_brain.nii.gz" \
  --output "derivatives/sub-01_brain_mask.nii.gz" \
  "bet {inputs[0]} {outputs[0]} -m"

The image itself is tracked in the dataset, so the software environment travels with the data and the provenance record rather than living in someone's shell history. When only one container is configured, -n may be omitted.

See provenance.md for the STAMPED principles and the YODA project layout, the run record format, --explicit and --assume-ready semantics, and exporting provenance toward W3C PROV.

Saving and inspecting changes

datalad status                 # what changed, including subdataset state
datalad save -m "add QC report" path/to/file
datalad save -m "checkpoint" -r                 # recurse into subdatasets
datalad save -m "small text file" --to-git notes.md

datalad save decides per file whether content goes to Git or to git-annex, following the dataset's .gitattributes. Force a file into Git with --to-git, which is the right call for code and small text files that should stay directly readable. The yoda procedure (datalad create -c yoda) sets this up for code/, README.md, and CHANGELOG.md automatically.

Creating a dataset

datalad create my_dataset               # plain dataset
datalad create -c yoda my_analysis      # analysis layout (code/ tracked in Git,
                                        # README.md and CHANGELOG.md preconfigured)
datalad create -d . inputs/raw          # register a new subdataset under an existing one

-c yoda applies the analysis project layout described in provenance.md. -d . is what registers a new dataset as a subdataset of the parent rather than leaving an unrelated repository inside it.

Publishing

A DataLad dataset is usually published to two places at once: a Git hosting service for the history, and a storage remote for the annexed content.

Illustrative authenticated publication (creates remote resources; requires a GitHub token and S3 credentials). Use myorg/mydataset only for an organization namespace.

datalad create-sibling-github mydataset
git annex initremote store type=S3 bucket=my-bucket protocol=https \
  encryption=none autoenable=true
datalad siblings configure -s github --publish-depends store
datalad push --to github

The Git sibling and the storage sibling are created by different tools on purpose. A Git sibling is a Git remote, and datalad create-sibling-* handles the hosting-service ones. An S3 bucket (or WebDAV, or an SSH directory) is a git-annex special remote, not a Git remote, so it is created with git annex initremote. datalad siblings picks the special remote up afterwards and treats it like any other. Using datalad siblings add --url s3://... here is the mistake this section exists to prevent: --url is a Git remote URL, S3 is not, and the push --to github below then fails on the --publish-depends hop.

--publish-depends is what stops the common broken publication: a Git repository whose history references content that was never uploaded, so collaborators clone successfully and then find every datalad get failing. Declaring the dependency makes the storage sibling publish first, every time.

datalad push sends both the Git history and, by default (--data auto-if-wanted), the annexed content selected by a target's wanted settings; without wanted settings it transfers all selected current content. --data anything bypasses preferred-content filtering, but does not recover missing local bytes or archive every historical version.

See publishing.md for RIA stores, special remotes, credential handling, and configuring which sibling holds what.

Freeing disk space

git annex whereis sub-01/                 # inspect recorded locations first
datalad drop sub-01/                      # remove local content, keep the pointer

datalad drop checks required copies and availability by default. --nocheck is deprecated in favor of --reckless availability, which disables those protections. --if-dirty is deprecated and ignored; it is not an availability-check option. --what selects between filecontent (the default), allkeys, datasets, and all.

Failure modes worth knowing

SymptomCauseFix
File reads as empty, truncated, or a broken symlinkContent not retrieved; only the pointer is presentdatalad get <path>
"Permission denied" writing an existing outputgit-annex write-protects annexed contentDeclare it with --output, or datalad unlock <path>
datalad run refuses to startDataset has unsaved changesdatalad save first, or pass --explicit
datalad drop refusesNo verified second copy of the contentPush to a reachable sibling, then retry the safety check
Collaborator clones but every get failsHistory published without the contentPublish the storage sibling, and set --publish-depends
Clone succeeds, subdataset directories are emptySubdatasets are not installed by defaultdatalad get -n -r ., then get the paths you need
Commands behave impossiblygit-annex missing or too olddatalad wtf --section dependencies

Detailed references

  • data-access.md: finding published datasets (registry.datalad.org, OpenNeuro, DANDI, datasets.datalad.org and the /// shortcut), clone and get options, subdataset handling, annex content states, dropping and removing, and fsck repair.

  • provenance.md: the STAMPED principles and the YODA layout, the run record format, run and rerun options in full, containers-run, and the current state of exporting DataLad provenance toward W3C PROV.

  • publishing.md: siblings and their actions, create-sibling-* variants, RIA stores, special remotes, push semantics, and credential handling.

The bids skill covers the Brain Imaging Data Structure that most of the neuroimaging datasets distributed through DataLad are organised in. A typical workflow clones a BIDS dataset with DataLad, validates it with the BIDS tooling, then runs a BIDS-App under datalad containers-run so the derivatives carry provenance.

Validation scope

Reviewed 2026-09-30 against DataLad 1.6.5 and datalad-container 1.2.6 source and current official manuals. Tiny local tests cover clone/get/drop, unlocked saves, subdataset installation, run/rerun, default push selection, and RIA publish/clone/get. Remote hosting, credentials, FSL, and container execution examples are illustrative; no authenticated remote publication or scientific-data downloads were performed.

Primary sources

Acknowledgment

Topic scope for this skill was informed in part by @bcmcpher's MIT-licensed datalad-cli plugin (nineteen per-command slash-command skills). The text here is written independently and grounded in the upstream DataLad documentation; overlap is unavoidable because both cover DataLad, but the structure, style, and specific technical claims are different.

Files

references/data-access.md

Finding, retrieving, and releasing dataset content

Finding published datasets

SourceWhat it holdsHow to reach it
registry.datalad.orgSearch across discovered DataLad and git-annex datasets, indexing URL, dataset ID, branches, tags, and metadataSearch box supports a bare word, a quoted phrase, AND/OR/NOT, and field-specific terms; results give clone URLs
datasets.datalad.orgThe DataLad superdataset, a nested collection of curated public datasetsdatalad clone /// for the superdataset, datalad clone ///<name> for one entry
OpenNeuroDatasetsPublic BIDS neuroimaging datasets from OpenNeuro, one repository per accessiondatalad clone https://github.com/OpenNeuroDatasets/ds00XXXX.git
dandisetsDANDI archive dandisets, mostly neurophysiology in NWBdatalad clone https://github.com/dandisets/000XXX.git

The /// shortcut is a DataLad resource identifier that resolves to the superdataset on datasets.datalad.org. Because that superdataset is itself made of subdatasets, cloning it gives a browsable tree of dataset names with no data in it, which is the intended way to explore before choosing.

Cloning

datalad clone [-h] [-d DATASET] [-D DESCRIPTION] [--reckless
    [auto|ephemeral|shared-...]] [-m MESSAGE] [-c PROC] [--version]
    SOURCE [PATH] ...

SOURCE accepts a URL, a local path, the /// shortcut, or a RIA store URL such as ria+http://store.datalad.org#~hcp-openaccess.

  • -d/--dataset registers the new clone as a subdataset of the given parent, which is the correct way to bring external data into a project rather than copying it in.

  • --reckless auto hard-links content between clones on the same filesystem, and --reckless ephemeral symlinks the annex to the origin's annex. Both trade safety for speed and disk, and both are recorded in local config and inherited by subdatasets. Use them for throwaway clones on a cluster, not for anything you will edit and push. For maintaining multiple concurrent checkouts of the same dataset without re-cloning, see the git worktree workflow with DataLad post.

  • -D/--description labels this particular copy. git-annex reports that label in whereis output, so a meaningful description ("scratch on cluster node") is what makes copy tracking readable later.

Retrieving content

datalad get [-h] [-s LABEL] [-d PATH] [-r] [-R LEVELS] [-n] [-c PROC] [-D
    DESCRIPTION] [--reckless [auto|ephemeral|shared-...]] [-J NJOBS]
    [--data {anything|nothing|auto|auto-if-wanted}] [--version]
    [PATH ...]
  • -r/--recursive descends into subdatasets, and -R/--recursion-limit bounds the depth. -R existing limits recursion to subdatasets already installed.

  • -n/--no-data installs subdatasets without fetching any file content. This is the usual first move on a nested dataset: get the structure, look at it, then fetch selectively.

  • -s/--source names a specific sibling to fetch from when several could serve the file.

  • -J/--jobs parallelises retrieval, and -J auto uses the configured maximum. On a dataset of many small files this is the difference between minutes and hours.

DataLad 1.6.5 also has --data: its auto-if-wanted default honors configured local wanted settings and otherwise retrieves requested content. Use --data anything when the requested inputs must be fetched regardless of that preference. --data nothing and -n skip file content. This controls retrieval, not analysis parallelism.

When resolving where a subdataset lives, DataLad ranks candidate locations by cost, considering the recorded URL, the superdataset's remote URL, and configured URL templates. A subdataset that fails to install from its recorded URL can often still be reached through the superdataset's own hosting.

Annex content states

Every annexed file has two things that can independently exist:

  1. The pointer, tracked in Git. It is a symlink into .git/annex/objects/, or a small plain file containing an annex key on filesystems without symlinks. Deleting it removes the file from the dataset.

  2. The content, the actual bytes. They live in the local annex, on a remote, or both.

PointerContent localWhat you see
presentpresentNormal file, readable
presentabsentListed by ls, unreadable, restorable with datalad get
absentnot applicableGone from the dataset's working tree

Inspect the state rather than guessing:

datalad status --annex availability # local availability plus annex key/size
git annex whereis <path>         # which repositories hold this file, and how many copies
git annex whereis --json <path>  # same, machine-readable, one JSON object per line
git annex list <path>            # compact matrix of files against remotes

git annex whereis reports the last information received from remotes and does not contact them, so a remote that has since lost the file will still be listed. Treat it as a record of belief, not a live check.

Editing annexed files

git-annex write-protects annexed content, so a direct write to an annexed file fails with a permission error even as the owner. That is deliberate: the file's content is content-addressed and shared by hard link with the annex object, so writing in place would corrupt every other reference to it.

datalad unlock <path>            # make it writable
# edit
datalad save -m "revise <path>" <path> # record the revised annex content

The tested default re-locks the saved file. Unlocked/adjusted configurations can behave differently; inspect status instead of assuming a worktree representation.

Inside datalad run, declaring the file with --output performs the unlock automatically, which is why the flag matters beyond documentation.

Releasing content

datalad drop [-h] [--what {filecontent|allkeys|datasets|all}] [--reckless
    {modification|availability|undead|kill}] [-d DATASET] [-r] [-R LEVELS] [-J NJOBS]
    [--nocheck] [--if-dirty IF_DIRTY] [--version] [PATH ...]
  • --what filecontent is the default and drops only file content, leaving pointers and the dataset intact.

  • --what allkeys drops all keys including those not currently in the working tree, --what datasets uninstalls subdatasets, and --what all does both.

  • --reckless availability overrides the check that another copy exists. This is the option that loses data when the check was right.

  • --reckless modification allows dropping despite unsaved modifications, --reckless undead skips checking whether the annex being removed remains recorded as alive elsewhere (and can leave stale availability records), and --reckless kill is a last-resort removal.

  • --nocheck and --if-dirty are deprecated. --nocheck is replaced by --reckless availability; --if-dirty is ignored entirely.

The real check is datalad drop's own refusal to remove content it cannot verify elsewhere; the commands below are a pre-flight look at what whereis already believes:

git annex whereis <path>                                # read the copy list yourself
git annex whereis --json <path> | jq '.whereis | length'  # count known copies
datalad push --to store   # make a second copy where none was, then
datalad drop <path>

whereis prints one N copies line per file, so a pipe into grep -c 'copies' returns the file count, not the copy count — for a single file it always prints 1, whether the content exists in five places or nowhere but the local annex. The JSON form is what you want when a script has to decide.

Use drop to free annexed bytes while retaining the tracked file. rm removes the worktree pointer (it does not leave that pointer behind); git rm also stages its removal. Neither ordinarily removes the annex object, so deleting a pointer is not a substitute for dropping content. Removing a tracked file can be intentional; save that deletion only when it is the intended dataset change.

Repair and verification

fsck belongs to git-annex, not to DataLad, so call it directly:

git annex fsck                       # verify local content against recorded checksums
git annex fsck --fast                # skip checksum verification, check presence only
git annex fsck --from <remote> --fast # presence check without downloading all bytes
git annex fsck --from <remote>        # full check; can retrieve remote content
git annex unused                     # find annex objects no longer referenced
git annex dropunused <number>        # selected entry from the unused report

fsck --from contacts the remote; checksum support and download cost depend on remote type. It is one way to check recorded availability, alongside actual retrieval and the verification performed by a safe drop. Review unused entries before removing them: content absent from the current worktree may still matter to historical results. Check datalad wtf --section dependencies when behavior differs from the manuals.

The registry count changes continuously. Its live frontend and search syntax were reviewed on 2026-09-30; see also the official registry guide. Public dataset locations were checked as Git repository metadata only, without downloading their annexed scientific data. Registry search is case-insensitive substring search; group mixed AND/OR expressions with parentheses as the frontend instructs.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Declares allowed tools, Needs a command-line tool, Needs Python

The author says: Requires Python 3.10+, DataLad 1.6.5, Git, and git-annex 10.x. Tested with git-annex 10.20260901 and datalad-container 1.2.6 on macOS ARM64. Containers additionally require Singularity, Apptainer, or Docker. Remote data access needs network access and may need provider credentials. Local filesystem workflows work offline.

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Dylan Pulver
Publisher
K-Dense (Community)
Distributed by
K-Dense
Source
K-Dense-AI/scientific-agent-skills · skills/datalad · commit a25cf9e
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.md)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Dylan Pulver or K-Dense.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download datalad.zip