TROUBLESHOOT YOUR SWAMP REPO
This guide walks you through diagnosing a broken Swamp repository using the
swamp doctor suite.
Use this when
swamp updatefails with permission errors or autoupdate is not working- An agent reports it cannot find Swamp skills or audit hooks
swampcommands fail with extension load errors- Workflow runs fail to start or report parse errors
- Model definitions contain cleartext secrets that should be in a vault
- Models with sensitive outputs fail at runtime because no vault is configured
swamp doctor datastoresreports foreign namespace contamination in a giga-swamp repository- Workflow runs or suspended approvals are missing after a namespace contamination incident
- You want to verify a repo is healthy after upgrading Swamp or pulling extensions
Prerequisites
- Swamp installed and on your
PATH - A Swamp repository (run
swamp repo initif you don't have one) — except forswamp doctor install, which works from any directory
Run all checks
Start with all seven subcommands to identify which subsystem is broken:
$ swamp doctor install
$ swamp doctor audit
$ swamp doctor datastores
$ swamp doctor extensions
$ swamp doctor workflows
$ swamp doctor secrets
$ swamp doctor vaultsEach ends with a summary line — OVERALL: PASS, OVERALL: FAIL, HEALTHY, or
UNHEALTHY. If all seven pass, your repository and installation are healthy. If
one fails, continue with the relevant section below.
Fix installation problems
Run swamp doctor install from any directory — it does not require a Swamp
repository.
When the output reports UNHEALTHY, it identifies the failing check:
$ swamp doctor install
Installation Health Check
Binary path: /usr/local/bin/swamp
Version: 20260518.215711.0-sha.d4a64cc1
Binary owner: root
Writable: ✗ Binary is owned by root, not current user
Autoupdate
Enabled: no
Last check: 2026-05-18T22:04:59.653Z (error)
Last error: Cannot update /usr/local/bin/swamp: permission denied. Re-run with: sudo swamp update
UNHEALTHYIf the binary is owned by root, reinstall to a user-writable location:
$ curl -fsSL https://swamp-club.com/install.sh | shIf autoupdate reports a permission error, run the update manually with the command shown in the output.
Fix audit integration
When swamp doctor audit reports a failure, the output includes a hint:
$ swamp doctor audit
✗ agent-config-loadable .cursor/hooks.json is missing
hint: Run `swamp init --tool cursor --force` to regenerate.Follow the hint to regenerate the tool configuration. If you switched tools
since initializing the repo, use --tool to check the one you actually use:
$ swamp doctor audit --tool claudeFix datastore health and namespace contamination
This section applies to custom (remote) datastores with a namespace configured.
Filesystem datastores do not have this problem — if swamp doctor datastores
passes on a filesystem backend, no action is needed.
For background on what namespace contamination is and why it happens, see Datastore Architecture.
Run the health check:
$ swamp doctor datastoresIf the output reports contamination, preview what the repair will clean up:
$ swamp doctor datastores --repairThe preview lists the foreign namespaces found, their object counts, and the five cleanup steps that will run. Review the foreign namespace list to confirm these are not objects you need to keep.
If the preview looks correct, execute the repair:
$ swamp doctor datastores --repair -yThe repair runs five steps in sequence: delete foreign objects, rebuild the remote index, wipe the local cache, re-pull scoped data, and invalidate workflow run and catalog indexes. On completion, it reports how many workflow runs were recovered.
If the repair fails mid-way, the error output identifies which step failed and provides a restore command. Run the suggested command to restore local state:
$ swamp datastore sync --pullThen re-run swamp doctor datastores to reassess and retry the repair.
After a successful repair, verify that previously missing workflow runs are now visible:
$ swamp workflow runsSuspended approval runs that were unreachable should also reappear:
$ swamp workflow approvalsFix broken extensions
When swamp doctor extensions reports a failure, use --verbose to identify
the broken source:
$ swamp doctor extensions --verboseThe Per-Source Detail section shows each source file, its state tag, and
bundle path. Look for sources in states other than Indexed — the
RowState table explains each state.
To clean up stale catalog entries, preview the repair first:
$ swamp doctor extensions --repair --dry-runIf the preview looks correct, apply it:
$ swamp doctor extensions --repairIn non-interactive environments (CI), add --yes to skip the confirmation
prompt.
Fix workflow loading errors
When swamp doctor workflows reports a failure, the validation errors appear
inline:
$ swamp doctor workflows
Checking workflows...
✗ broken
→ [
{
"expected": "string",
"code": "invalid_type",
"path": [
"id"
],
"message": "Invalid input: expected string, received undefined"
}
]
0 passed, 1 failed — OVERALL: FAILThe path field in each error points to the problem in the YAML. Fix the
workflow file and re-run swamp doctor workflows to confirm.
Refer to the Workflows reference for the complete YAML schema.
Fix cleartext secrets
When swamp doctor secrets reports a failure, the output lists each definition
holding a cleartext sensitive global argument and the steps to migrate it:
$ swamp doctor secrets
Scanning definitions for cleartext sensitive global arguments…
✗ 1 definition(s) hold a cleartext sensitive global argument (1 definition(s) scanned)
leaky [@demo/secret-demo]
• apiKey
1. Store the secret: swamp vault put my-vault apiKey <value>
2. Reference it: ${{ vault.get('my-vault', 'apiKey') }}
Each secret above sits in cleartext in its definition YAML. Migrate it to a vault, then re-save the definition.Follow the numbered steps in the output for each finding. If no vault exists yet, create one first:
$ swamp vault create <type> <name>Re-run swamp doctor secrets to confirm the finding is resolved.
Fix missing vaults
When swamp doctor vaults reports a failure, the output lists each definition
that has sensitive resource outputs but no vault configured:
$ swamp doctor vaults
Scanning definitions for sensitive resource outputs without a vault…
✗ 1 definition(s) have sensitive resource outputs but no vault is configured (2 definition(s) scanned)
• my-keypair [test/sensitive]
These models will fail at runtime when writing sensitive data. Create a vault: swamp vault create <type> <name>Create a vault for the repository:
$ swamp vault create <type> <name>Re-run swamp doctor vaults to confirm the finding is resolved.
Use JSON output in CI
All subcommands support --json for machine-readable output:
$ swamp doctor install --json | jq '.overallStatus'
"healthy"
$ swamp doctor audit --json | jq '.overallStatus'
"pass"
$ swamp doctor datastores --json | jq '.overallStatus'
"pass"
$ swamp doctor extensions --json | jq '.overallStatus'
"pass"
$ swamp doctor workflows --json | jq '.overallStatus'
"pass"
$ swamp doctor secrets --json | jq '.overallStatus'
"pass"
$ swamp doctor vaults --json | jq '.overallStatus'
"pass"Exit code 1 signals failure, so you can also use the exit code directly in CI
scripts.
Authentication errors
If you see an authentication error when running any of the commands below, authenticate first:
swamp datastore setup extensionswamp vault create(with a non-local type)swamp serve --auth-mode token|oauth
swamp auth loginIf you are using a collective token (swamp_org_ prefix) and see a scope error,
the token is missing the required scope. Create a new token with the appropriate
scope (datastore:*, vault:*, or serve:*) in the collective's settings
page:
swamp auth whoamiCheck the Scopes line to confirm which scopes the token carries. Refer to the
API Key Authentication
reference for the full scope table.
Related
- Doctor — complete flag, exit code, and JSON reference for all subcommands
- Vaults — vault types, creation, and management
- Workflows — workflow YAML schema
- Extension Management — pull, update, rm commands