Production MongoDB backup and restore practices that the documentation gets wrong.

MITAuto-check passedDatabases

Install Mongodb Backups

skills CLI
$ npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill mongodb-backups -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TheDecipherist/claude-code-mastery-project-starter-kit mongodb-backups --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TheDecipherist/claude-code-mastery-project-starter-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/mongodb-backups .claude/skills/mongodb-backups && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
mongodb-backups
GitHub stars
338
Token cost
~1.3k tokens
SKILL.md length
586 words
Files
1
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

Production MongoDB backup and restore practices that the documentation gets wrong.

  • Writing a mongodump/mongorestore pipeline
  • SKILL.md covers Dump from a secondary, stream…, Save a collection inventory…, The --nsInclude trap on… and Tier collections so restore is…, plus 2 more sections
  • Calls aws and mongosh
  • A backup cron job

What it does

Mongodb Backups is an agent skill from TheDecipherist/claude-code-mastery-project-starter-kit. Production MongoDB backup and restore practices that the documentation gets wrong. Use when writing a mongodump/mongorestore pipeline, a backup cron job, an S3 backup, or a selective restore, or when planning recovery. Covers streaming to object storage with no temp file, saving a collection inventory, the --nsInclude trap on gzipped archives, collection tiering for fast restores, and matching write concern to data criticality. Defers replica-set topology and tuning to mongodb-replica-sets, and query patterns to…

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering NoSQL databases, Backup and disaster recovery and File uploads and storage. It works with MongoDB. The repository describes itself as: The definitive starting point for Claude Code projects. Based on Claude Code Mastery Guides V1-V5. The licence is MIT.

When your agent uses it

  • Writing a mongodump/mongorestore pipeline
  • A backup cron job
  • A selective restore
  • Planning recovery

Example prompts

  • “/mongodb-backups”

What it can do on your machine

Read from SKILL.md and the folder at commit 61fbb99. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • aws
    • mongosh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use aws, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Mongodb Backups loads about 1.3k tokens when it runs. Until then it costs about 137 tokens; SKILL.md has 586 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~137
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TheDecipherist/claude-code-mastery-project-starter-kit at commit 61fbb99, republished under its MIT licence (© TheDecipherist). 586 words, ~1,321 tokens.

Download SKILL.mdSave it as .claude/skills/mongodb-backups/SKILL.md (or your agent's skills folder).
name
mongodb-backups
description
Production MongoDB backup and restore practices that the documentation gets wrong. Use when writing a mongodump/mongorestore pipeline, a backup cron job, an S3 backup, or a selective restore, or when planning recovery. Covers streaming to object storage with no temp file, saving a collection inventory, the --nsInclude trap on gzipped archives, collection tiering for fast restores, and matching write concern to data criticality. Defers replica-set topology and tuning to mongodb-replica-sets, and query patterns to mongodb-rules.
when_to_use
- Writing or reviewing a mongodump / mongorestore pipeline or backup cron job - Streaming a backup to S3 or other object storage - Doing a selective restore…

MongoDB Backups and Restore

From running thousands of production backups. The defaults and the docs leave out the parts that bite during an actual restore.

Dump from a secondary, stream straight to object storage

Point mongodump at a secondary so the backup doesn't add load to the primary, and pipe the archive directly to S3 with no intermediate file on disk. On a replica set, --oplog captures a consistent point-in-time snapshot.

bash
mongodump --host mongodb-secondary.internal:27017 \
  --username "$U" --password "$P" --authenticationDatabase admin \
  --db "$DB" --oplog --gzip --archive \
  | aws s3 cp - "s3://bucket/$DB/$(date +%Y%m%d_%H%M%S).dump.gz"

Keep a latest.dump.gz alias next to the timestamped file so restore scripts always know where to look.

Save a collection inventory with every backup

You cannot inspect a --gzip --archive after the fact. There is no list, peek, or inspect flag, it's an opaque binary blob, and --dryRun finishes before the archive is demuxed so it tells you nothing. So write the collection list at backup time, right beside the dump:

bash
mongosh --quiet --host "$HOST" -u "$U" -p "$P" --authenticationDatabase admin \
  --eval "db.getSiblingDB('$DB').getCollectionNames().forEach(c => print(c))" \
  | aws s3 cp - "s3://bucket/$DB/$(date +%Y%m%d_%H%M%S).collections.txt"

Six months later when you need a selective restore, you read the file instead of trying to remember what was in the archive.

The --nsInclude trap on gzipped archives

The docs say --nsInclude filters a restore to specific collections. It does, from a directory dump (one .bson per collection). But from a --gzip --archive, which is what almost every production pipeline uses, --nsInclude (and --nsFrom/--nsTo) silently restore everything anyway and throw duplicate-key errors on the collections you never asked for. The archive is a single multiplexed stream that mongorestore can't seek, so the namespace filter doesn't hold. This is real and long-standing (JIRA TOOLS-2023, open over six years).

The reliable approach is the inverse: --nsExclude every collection you don't want, generated from the inventory file. Don't hand-build 100+ exclude flags at 2 AM, script it to read the inventory and emit the restore command.

Tier collections so restore is a command, not improvisation

Decide ahead of time what gets restored, and keep the lists in the restore script:

  • Tier 1, critical business data (orders, customers, products, inventory): always restore.
  • Tier 2, regenerable (sessions, caches, tokens, search indexes): never restore. Restoring stale sessions is worse than having none, you log people back into dead state.
  • Tier 3, historical/analytical (audit logs, history, analytics rollups): restore only on demand. This is the bulk of the exclude list.

When the incident hits you want to run a command, not write one.

Show full SKILL.md (207 more words)Show less

A replica set is only a backup at w:"majority"

Write concern quietly decides whether replication is durability or just a live mirror. w:1 acknowledges on the primary alone, so a write lost before it replicates never existed anywhere else. w:"majority" means the data is on a majority of members before the app gets the OK. Match it to data criticality rather than setting one value globally: w:"majority" for data you can't lose, w:1 for the regenerable and the disposable. See mongodb-replica-sets for the full read/write semantics.

Test the restore before you need it

A backup you've never restored is a hypothesis. Practice the selective restore in staging, and time how long a replica-set member rebuilds from zero (delete a secondary's data dir, restart, and watch db.adminCommand({ replSetGetStatus: 1, initialSync: 1 }).initialSyncStatus). That number is what tells you, at 2 AM, whether to wait for self-healing or restore from backup. Point-in-time recovery needs --oplog backups plus mongorestore --oplogReplay --oplogLimit "<ts>:<inc>".

One adjacent footgun that kills backups: unrotated MongoDB diagnostic logs fill the disk and the primary goes read-only. Set systemLog.logRotate: rename with rotation and alert on disk at 80%.


This skill is built to grow. Add a rule when a real restore surprise has a stable, defensible fix.

© TheDecipherist, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/mongodb-backups of TheDecipherist/claude-code-mastery-project-starter-kit.

Open the folder on GitHubat commit 61fbb99

Compare with similar skills

Mongodb Backups next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Mongodb Backups compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Mongodb Backups this skillTheDecipherist/claude-code-mastery-project-starter-kit338—~1.3kAutomated safety check: PassMIT
Mongodbsickn33/agentic-awesome-skills47k2 repos~2.7kAutomated safety check: NotesMIT
Database Backupssickn33/agentic-awesome-skills47k2 repos~3.1kAutomated safety check: NotesMIT
Use Sealoshashgraph-online/awesome-codex-plugins1.2k—~2.2kAutomated safety check: PassApache-2.0
Mongodb Atlas Stream Processingmongodb/agent-skills1901 repos~4.9kAutomated safety check: PassApache-2.0
Mongodb Qe Size Estimationmongodb/agent-skills190—~4.2kAutomated safety check: PassApache-2.0

Similar skills

  • Mongodb

    sickn33/agentic-awesome-skills

    Administer MongoDB databases. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~2.7k tokens
    DatabasesAuto-check: notes
  • Database Backups

    sickn33/agentic-awesome-skills

    Implement database backup strategies. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~3.1k tokens
    DatabasesAuto-check: notes
  • Use Sealos

    hashgraph-online/awesome-codex-plugins

    Deploy and operate apps on Sealos Cloud: sign in to a Sealos account, deploy any project or self-hosted app (from the template store, an official Docker image, or project source code), provision…

    1.2k GitHub stars~2.2k tokensUpdated today
    DatabasesAuto-check passed
  • Official

    Manages MongoDB Atlas Stream Processing (ASP) workflows. An agent skill from mongodb/agent-skills.

    190 GitHub starsUsed in 1 repo~4.9k tokens
    Backend & APIsAuto-check passed
  • Mongodb Qe Size Estimation

    mongodb/agent-skills

    Official

    Estimates the storage and memory impact of encrypting fields in collections with Queryable Encryption (QE) enabled.

    190 GitHub stars~4.2k tokensUpdated today
    DatabasesAuto-check passed
  • Mongodb

    RightNow-AI/openfang

    MongoDB operations expert for queries, aggregation pipelines, indexes, and schema design

    18k GitHub stars~821 tokensUpdated 3 mo ago
    DatabasesAuto-check passed

More from TheDecipherist/claude-code-mastery-project-starter-kit

All 24 skills in this repo
  • Create Service

    TheDecipherist/claude-code-mastery-project-starter-kit

    Scaffold a new microservice that follows the project's server/handlers/adapters architecture.

    338 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check: notes
  • CSS Structure

    TheDecipherist/claude-code-mastery-project-starter-kit

    Where CSS should live. An agent skill from TheDecipherist/claude-code-mastery-project-starter-kit.

    338 GitHub stars~1k tokensUpdated 3 mo ago
    Auto-check passed
  • Docker

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production Docker best practices for writing Dockerfiles, Compose files, and Swarm stacks.

    338 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check: notes
  • Docker Swarm

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production Docker Swarm deployment rules: what changes when a compose file goes from a single node to a multi-node Swarm.

    338 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • Mongodb Replica Sets

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production MongoDB replica-set operation: topology, durability, host tuning, and the container-specific gotchas Claude gets wrong.

    338 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check passed
  • Nginx

    TheDecipherist/claude-code-mastery-project-starter-kit

    Production NGINX configuration best practices, especially as a reverse proxy in front of containerized backends.

    338 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Mongodb Backups

What does Mongodb Backups do?

Production MongoDB backup and restore practices that the documentation gets wrong. Mongodb Backups is an agent skill from TheDecipherist/claude-code-mastery-project-starter-kit. Production MongoDB backup and restore practices that the documentation gets wrong.

When should I use Mongodb Backups?

Mongodb Backups fits situations like: writing a mongodump/mongorestore pipeline; A backup cron job; A selective restore; planning recovery.

How do I install Mongodb Backups in Claude Code?

Run `npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill mongodb-backups -a claude-code`. Or copy the skill folder (.claude/skills/mongodb-backups in TheDecipherist/claude-code-mastery-project-starter-kit) into .claude/skills/mongodb-backups in your project. Claude Code loads it when a task matches its description.

How do I install Mongodb Backups in Codex?

Run `npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill mongodb-backups -a codex`. Or copy the skill folder (.claude/skills/mongodb-backups in TheDecipherist/claude-code-mastery-project-starter-kit) into .agents/skills/mongodb-backups in your project. Codex loads it when a task matches its description.

Can I use Mongodb Backups in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TheDecipherist/claude-code-mastery-project-starter-kit --skill mongodb-backups -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/mongodb-backups, .gemini/skills/mongodb-backups, .github/skills/mongodb-backups and .opencode/skills/mongodb-backups in your project.

What does Mongodb Backups need to run?

Going by SKILL.md and its folder, Mongodb Backups needs the command-line tools its instructions call (aws and mongosh).

Does Mongodb Backups access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Mongodb Backups safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Mongodb Backups use?

Mongodb Backups is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Mongodb Backups use?

About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Mongodb Backups?

Skills that share tags, products or a category with Mongodb Backups: Mongodb (sickn33/agentic-awesome-skills, 47k stars), Database Backups (sickn33/agentic-awesome-skills, 47k stars), Use Sealos (hashgraph-online/awesome-codex-plugins, 1.2k stars) and Mongodb Atlas Stream Processing (mongodb/agent-skills, 190 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Mongodb Backups?

TheDecipherist (a GitHub user) maintains it in TheDecipherist/claude-code-mastery-project-starter-kit, which has 338 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on June 29, 2026.

Source: TheDecipherist/claude-code-mastery-project-starter-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.