AugmentClaude

Swamp Data Manager

List, query, version, and clean up model data artifacts with flexible filtering.

Installation

  1. Make sure Claude is on your device and in your terminal.

    Skills load from ~/.claude/skills/ when Claude Code starts up — so you need it on your machine first. If you don't have it yet, install it once with the command below, then run claude in any terminal to verify.

    One-time setup
    npm i -g @anthropic-ai/claude-code

    Already have it? Skip ahead.

  2. Paste into Claude Code or into your terminal.

    This copies the whole skill folder into ~/.claude/skills/swamp-data-swamp-club/ — the SKILL.md plus any scripts, reference docs, or templates the skill ships with. Safe default: works for every skill.

    Faster alternative (instruction-only skills)

    Skips the clone and grabs only the SKILL.md file. Don't use this if the skill ships Python scripts, reference markdowns, or asset templates — they won't be downloaded and the skill will fail when it tries to load them.

    Quick install (SKILL.md only)
    Sign up to copy
  3. Restart Claude Code.

    Quit and reopen Claude Code (or any other agent that loads from ~/.claude/skills/). New skills are picked up on startup.

  4. Just ask Claude.

    Skills auto-activate when your request matches the skill's description — no slash command needed. Trigger phrases live in the skill's own frontmatter; you can read them in the “What this skill does” section above.

Prefer to read the source first? Open on GitHub.

When Claude uses it

Manage swamp model data — list data artifacts, view version history, delete data artifacts, run garbage collection, and query data using CEL predicates. Use when working with swamp model data lifecycle, retention policies, version cleanup, removing specific data artifacts, searching for data by field values, filtering by attributes or tags, or exploring results after running a model method. Triggers on "swamp data", "model data", "data list", "data get", "data versions", "garbage collection", "gc", "data gc", "data retention", "data lifecycle", "version history", "data cleanup", "data delete", "delete data artifact", "remove data", "purge data", "prune data", "expire data", "ephemeral data", "data query", "query data", "find data", "search data where", "filter data", "which data has", "data with", "select from data", "data.query", "context.queryData", "CEL predicate", "data predicate", "inspect results", "method output", "factory results", "browse artifacts", "what did method produce".

What this skill does

Swamp Data Skill

Manage model data lifecycle through the CLI. All commands support --json for machine-readable output.

Verify CLI syntax: If unsure about exact flags or subcommands, run swamp help data for the complete, up-to-date CLI schema.

Query is the primitive; get/list/search/versions are shortcuts

swamp data query is the general data-access command — it takes any CEL predicate over artifact metadata and content, with optional projections via --select. The get, list, search, and versions subcommands are shortcuts for common queries. Prefer the shortcut when your intent matchesswamp data get my-model state reads more clearly than the equivalent predicate. Reach for swamp data query directly when you need a multi-field predicate, a projection, or history beyond a single version.

CLI shortcut mapping

ShortcutUnderlying query
swamp data get <m> <n>swamp data query 'modelName == "<m>" && name == "<n>"' --select content
swamp data get <m> <n> --version 2swamp data query 'modelName == "<m>" && name == "<n>" && version == 2' --select content
swamp data list <m>swamp data query 'modelName == "<m>"'
swamp data list <m> --type resourceswamp data query 'modelName == "<m>" && dataType == "resource"'
swamp data list --workflow <w>swamp data query 'workflowName == "<w>"'
swamp data list --run <id>swamp data query 'workflowRunId == "<id>"'
swamp data versions <m> <n>swamp data query 'modelName == "<m>" && name == "<n>" && version >= 0' --select 'version'
swamp data search --tag env=prodswamp data query 'tags.env == "prod"'

The shortcut and the equivalent query run through the same catalog and return the same DataRecord shape. See references/fields.md for the full list of queryable fields and predicate operators.

Quick Reference

TaskCommand
Query by modelswamp data query 'modelName == "my-model"'
Query by typeswamp data query 'dataType == "resource"'
Query with projectionswamp data query 'modelName == "x"' --select 'name'
Query by tagsswamp data query 'tags.env == "prod"'
Query by contentswamp data query 'attributes.status == "failed"'
List model dataswamp data list <model> --json
List workflow dataswamp data list --workflow <name> --json
Get specific dataswamp data get <model> <name> --json
Get metadata onlyswamp data get <model> <name> --no-content --json
Get data via workflowswamp data get --workflow <name> <data_name> --json
View version historyswamp data versions <model> <name> --json
Run garbage collectionswamp data gc --json
Rename data instanceswamp data rename <model> <old> <new>
Delete data artifactswamp data delete <model> <name> --force
Delete one versionswamp data delete <model> <name> --version 3
Preview GC (dry run)swamp data gc --dry-run --json

See references/concepts.md for lifetime types, tags, and version GC policies.

Query Data

Use swamp data query with CEL predicates for filtering and --select for projection. See references/fields.md for all filterable fields and CEL operators.

# By model
swamp data query 'modelName == "my-model"'

# By type and tags
swamp data query 'dataType == "resource" && tags.env == "prod"'

# With projection — extract specific fields
swamp data query 'modelName == "scanner"' --select '{"name": name, "os": attributes.os}'

# By content
swamp data query 'attributes.status == "failed"' --select 'name'

# History — all versions of a specific data item
swamp data query 'modelName == "my-model" && name == "state" && version >= 0' --select 'version'

# Interactive mode — TUI with live autocomplete, no predicate needed
swamp data query

List Model Data

View all data items for a model, grouped by tag type. Shortcut for swamp data query 'modelName == "<model>"'.

swamp data list my-model --json

Output shape: Returns modelId, modelName, modelType, groups (items grouped by type tag, each with id, name, version, size, createdAt), and total. See references/output-shapes.md for the full output shape.

Get Specific Data

Retrieve the latest version of a specific data item. Shortcut for swamp data query 'modelName == "<model>" && name == "<name>"' --select content (omit --select content to return metadata only).

swamp data get my-model execution-log --json

# Metadata only (no content)
swamp data get my-model execution-log --no-content --json

Output shape: Returns id, name, modelId, version, contentType, lifetime, tags, ownerDefinition, size, checksum, and content. See references/output-shapes.md for the full output shape.

Workflow-Scoped Data Access

List or get data produced by a workflow run instead of specifying a model.

# List all data from the latest run of a workflow
swamp data list --workflow test-data-fetch --json

# List data from a specific run
swamp data list --workflow test-data-fetch --run <run_id> --json

# Get specific data by name from a workflow run
swamp data get --workflow test-data-fetch output --json

# Get with specific version
swamp data get --workflow test-data-fetch output --version 2 --json

View Version History

See all versions of a specific data item. Shortcut for swamp data query 'modelName == "<model>" && name == "<name>" && version >= 0'.

swamp data versions my-model state --json

Output shape: Returns dataName, modelId, modelName, versions (each with version, createdAt, size, checksum, isLatest), and total. See references/output-shapes.md for the full output shape.

Rename Data

Data instance names are permanent once created — deleting and recreating under a new name loses version history and breaks any workflows or expressions that reference the old name. Use data rename to non-destructively rename with backwards-compatible forwarding. The old name becomes a forward reference that transparently resolves to the new name.

When to rename:

  • Refactoring naming conventions (e.g., web-vpcdev-web-vpc)
  • Reorganizing data after a model's purpose evolves
  • Fixing typos in data names without losing history

Rename workflow:

  1. Verify the new name doesn't already exist:
    swamp data get my-model new-name --no-content --json
    
    This should return an error (not found). If it succeeds, the name is taken.
  2. Rename the data instance:
    swamp data rename my-model old-name new-name
    
  3. Confirm the forward reference works:
    swamp data get my-model old-name --no-content --json
    
    Should resolve to new-name via the forward reference.

What happens:

  1. Latest version of old-name is copied to new-name (version 1)
  2. A tombstone is written on old-name with a renamedTo forward reference
  3. Future lookups of old-name transparently resolve to new-name
  4. Historical versions of old-name remain accessible via data.version("model", "old-name", N)

Forward reference behavior:

  • data.latest("model", "old-name") → resolves to new-name automatically
  • data.version("model", "old-name", 2) → returns original version 2 (no forwarding)
  • model.<name>.resource.<spec>.<old-name> → resolves to new name in expressions

Important: After renaming, update any workflows or models that produce data under the old name. If a model re-runs and writes to the old name, it will overwrite the forward reference.

Delete Data

Permanently remove a data artifact from a model. The artifact identity is the (model, name) pair — swamp data delete operates on that pair, not on individual versions, unless --version is given.

When to delete:

  • Re-running an import or start method that's blocked by an existing-state guard (e.g., [NP-E028]) when you want a clean re-import
  • Removing data that was created in error
  • Cleaning up after a destructive change to an external resource

Default semantics:

  • swamp data delete <model> <name> — deletes all versions of the artifact. Prompts [y/N] with the exact version count before proceeding.
  • swamp data delete <model> <name> --version 3 — deletes only that single version. The artifact's other versions remain.
  • swamp data delete <model> <name> --force — skips the confirmation prompt. Required in scripts, JSON mode, and any non-interactive context.

Errors are loud, not silent:

  • Missing model → Model not found: <ref>
  • Missing artifact → No data named "<name>" exists for model <model>
  • Missing version → Version <V> does not exist for "<name>" (available versions: 1, 2, 3)
# Full-artifact delete with confirmation prompt
swamp data delete my-server hetzner-state

# Surgical single-version delete
swamp data delete my-server hetzner-state --version 2

# Non-interactive (scripts, automation)
swamp data delete my-server hetzner-state --force --json

Note on rename forwarders: If oldName → newName was renamed, deleting newName leaves the tombstone on oldName forwarding to nothing. Lookups via the forwarded path will return null. Delete the tombstone explicitly with swamp data delete <model> oldName if you want a clean slate.

Garbage Collection

Clean up expired data and old versions based on lifecycle settings.

IMPORTANT: Always dry-run first. GC deletes data permanently. Follow this workflow:

  1. Preview what will be deleted:
    swamp data gc --dry-run --json
    
  2. Review the output — verify only expected items appear
  3. Run the actual GC only after confirming the dry-run output:
    swamp data gc --json
    swamp data gc -f --json  # Skip confirmation prompt
    

Dry-run output shape: Returns expiredDataCount and expiredData (each with type, modelId, dataName, reason). See references/output-shapes.md for the full output shape.

GC output shape: Returns dataEntriesExpired, versionsDeleted, bytesReclaimed, and expiredEntries. See references/output-shapes.md for the full output shape.

Accessing Data in Expressions

CEL expressions access model data in workflows and model inputs. Functions, examples, and key rules are in references/expressions.md.

Data Ownership

Data is owned by the creating model — see references/data-ownership.md for owner fields, validation rules, and viewing ownership.

Data Storage

Data is stored in the .swamp/data/ directory:

.swamp/data/{normalized-type}/{model-id}/{data-name}/
  1/
    raw          # Actual data content
    metadata.yaml # Version metadata
  2/
    raw
    metadata.yaml
  latest → 2/    # Symlink to latest version

When to Use Other Skills

NeedUse Skill
Create/run modelsswamp-model
View model outputsswamp-model (output commands)
Create/run workflowsswamp-workflow
Repository structureswamp-repo
Manage secretsswamp-vault
Understand swamp internalsswamp-troubleshooting

References

Related skills