Skill: datalad-log
Browse the recorded history of a DataLad dataset: list run commits, inspect what a
specific run recorded, and trace which command produced a given output file.
Steps
Browsing run history
- Verify DataLad context — check for
.datalad/in the current directory:
```bash
ls .datalad/ 2>/dev/null
```
If not in a dataset, stop and inform the user.
- List recorded runs — show the run history with:
```bash
datalad log --oneline
```
Or to show only datalad run commits (excludes saves, checkpoints, manual commits):
```bash
git log --oneline --grep="datalad run"
```
Present the output as a numbered list showing commit SHA and message.
- Inspect a specific run — when the user wants detail on a particular commit:
```bash
datalad rerun --report <sha>
```
This shows the run record (command, inputs, outputs, message) without re-executing.
Report:
- The original command
- Declared inputs (
-i) - Declared outputs (
-o) - Commit message
- Timestamp
Tracing output provenance
When the user asks "what command produced <file>":
- Find commits that touched the file:
```bash
git log --oneline -- <path>
```
- Check each commit for a run record:
```bash
datalad rerun --report <sha>
```
If the commit is a datalad run commit, this shows the full run metadata.
If it is a plain save or checkpoint, report that instead.
- Report the full provenance chain — if the file was produced by a run, show:
- Which commit recorded it
- The command that produced it
- The declared inputs to that command
Identifying checkpoint commits
The auto-checkpoint hook creates commits with messages like:
[datalad] checkpoint 2026-03-12T14:05:22Z: code/analysis.py outputs/result.csv
These are not run records — they are auto-saves. They will appear in git log and
datalad log output. To show only datalad run commits (excludes checkpoints and saves):
git log --oneline --grep="\[datalad run\]"
Note: using --invert-grep with multiple --grep flags uses OR logic and will not
correctly exclude checkpoints — use the single --grep="\[datalad run\]" form instead.
Constraints
- Never re-execute a run when the user only wants to inspect it — always use
datalad rerun --report for inspection, not datalad rerun alone.
- Always distinguish between
datalad runcommits (provenance records) and plain save
commits or checkpoint commits in your report.
- If
datalad logis not available (older DataLad), fall back to
git log --oneline --grep="datalad run" and explain the fallback.
- For file-level differences between two commits, direct the user to
/datalad-diff.