# Datalad Untrack

> >

- **Type:** Skill
- **Install:** `agentstack add skill-neuroanalytics-data-science-harness-datalad-untrack`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [neuroanalytics](https://agentstack.voostack.com/s/neuroanalytics)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [neuroanalytics](https://github.com/neuroanalytics)
- **Source:** https://github.com/neuroanalytics/data-science-harness/tree/main/plugins/datalad-cli/skills/datalad-untrack

## Install

```sh
agentstack add skill-neuroanalytics-data-science-harness-datalad-untrack
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Skill: datalad-untrack

Remove annexed content from local storage or remove a file from the dataset entirely.
These are two distinct operations with very different consequences. Load
`${CLAUDE_PLUGIN_ROOT}/../references/annex-content-states.md` to reason about annex state
before choosing the operation.

## Steps

0. **Check if the user wants to edit (not drop/remove)** — if the user wants to edit an
   annexed file in place, use `datalad unlock` rather than drop or remove. Editing a
   locked annex file without unlocking first corrupts the annex pointer. See the
   **Unlocking** section below for the full workflow.

1. **Verify DataLad context** — check for `.datalad/` in the current directory or any
   parent:
   ```bash
   ls .datalad/ 2>/dev/null || git rev-parse --show-toplevel
   ```
   - **Dataset found**: continue.
   - **No dataset found**: inform the user. For plain git repos, use `git rm` instead.

2. **Identify the target files** — read paths from `$ARGUMENTS` or conversation context.
   If no paths are specified, ask the user to name the files before continuing.

3. **Check annex state for each target** — run:
   ```bash
   git annex whereis 
   datalad status 
   ```
   Report:
   - Whether content is present locally
   - How many remote copies exist (if any)
   - Whether the file is annexed or git-tracked only

4. **Present the two-path choice** — show the user a clear decision:

   > **Option A — Drop content** (`datalad drop`):
   > Frees local disk space. The file pointer stays in the dataset. Content can be
   > restored later with `datalad get` IF a remote copy exists.
   >
   > **Option B — Full remove** (`datalad remove` + `datalad save`):
   > Deletes the file pointer from the dataset history. Irreversible locally.
   > The file will no longer appear in `datalad status` or `git ls-files`.

   Ask the user which they want before proceeding.

5. **Warn about remote availability** (Option A only) — if `git annex whereis` shows
   the only copy is `here` (local), warn:
   > "Warning: no remote copy of this content exists. Dropping will make the content
   > unrecoverable unless you have a backup. Use `--nocheck` only if you accept
   > permanent data loss. Proceed?"
   Wait for explicit confirmation before continuing.

6. **Execute the chosen workflow**:

   **Option A — Drop**:
   ```bash
   datalad drop 
   ```
   Confirm with `datalad status ` that content is now absent (pointer remains).

   **Option B — Full remove**:
   ```bash
   datalad remove 
   datalad save -m "remove "
   ```
   Confirm with `datalad status` that the file no longer appears.

7. **Report outcome** — summarize what was done:
   - For drop: disk space freed, pointer retained, how to restore (`datalad get`)
   - For remove: file removed from history, commit recorded

## Unlocking annexed files for in-place editing (`datalad unlock`)

When the user wants to **edit** an annexed file in place (not drop or remove it):

1. **Explain what unlock does** — annexed files are write-protected symlinks. `datalad
   unlock` replaces the symlink with the actual file content, making it writable. After
   editing, `datalad save` re-annexes the file.

2. **Check annex state** — verify the file has content locally (otherwise unlock will
   fail because there's nothing to materialize):
   ```bash
   git annex whereis 
   ```
   If content is absent, run `datalad get ` first.

3. **Unlock the file**:
   ```bash
   datalad unlock 
   ```
   Or unlock multiple files: `datalad unlock  ` or `datalad unlock .`
   to unlock everything in the current directory.

4. **Inform the user** that the file is now writable. After they finish editing, remind
   them to re-annex with:
   ```bash
   datalad save -m "edit "
   ```
   This re-locks the file and records the change in history.

## Constraints

- Never run `git rm` or bare `rm` on an annexed file — this corrupts annex state.
  Always use `datalad drop` or `datalad remove`.
- Always check `git annex whereis` before dropping to assess data loss risk.
- Always warn explicitly when only one copy of content exists before dropping.
- For full removes, always follow `datalad remove` with `datalad save` — the removal
  is not recorded in history until saved.
- Always present the two-path choice and wait for the user's decision — never infer
  which operation to use without asking.
- For `unlock`: always verify content is present locally before unlocking — a pointer-only
  file cannot be unlocked until `datalad get` retrieves the content.
- After `unlock`, always remind the user to `datalad save` when done — unlocked files
  are not re-annexed until saved.
- Load `${CLAUDE_PLUGIN_ROOT}/../references/annex-content-states.md` when reasoning about
  what content states mean or when the user asks about annex concepts.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [neuroanalytics](https://github.com/neuroanalytics)
- **Source:** [neuroanalytics/data-science-harness](https://github.com/neuroanalytics/data-science-harness)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-neuroanalytics-data-science-harness-datalad-untrack
- Seller: https://agentstack.voostack.com/s/neuroanalytics
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
