replicate

replicate is a command for Codex from benbjohnson/litestream-skills. It costs 0 tokens per session (962 once invoked), scanned A, original, Apache-2.0.

A command that continuously copies changes from SQLite databases to configured backup storage using Litestream.

In plain words
What is it for?
Use it to replicate one or more databases, run replication beside an application, restore a missing database automatically, or perform a single replication run.
Why use it?
It keeps an up-to-date remote copy of database changes, so the database can be recovered after local data loss.

Command for Codex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/benbjohnson/litestream-skills/replicate
Clone the repo
git clone --depth 1 https://github.com/benbjohnson/litestream-skills

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for replicate

README.md
[![agentmods](https://agentmods.dev/badge/commands/benbjohnson/litestream-skills/replicate.svg)](https://agentmods.dev/commands/benbjohnson/litestream-skills/replicate)
Your own site
<a href="https://agentmods.dev/commands/benbjohnson/litestream-skills/replicate"><img src="https://agentmods.dev/badge/commands/benbjohnson/litestream-skills/replicate.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 962 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00962
Opus 5 $0.00000 $0.00481
Sonnet 5 $0.00000 $0.00192
Haiku 4.5 $0.00000 $0.00096

Measured 3d ago against content hash 63f37a0978fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

replicate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.codex/skills/litestream/commands/replicate.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.

replicate Command

Continuously replicate SQLite databases to cloud storage.

Synopsis

# With config file
litestream replicate [-config PATH]

# With command line arguments
litestream replicate [flags] DB_PATH REPLICA_URL [REPLICA_URL...]

# Run application alongside replication
litestream replicate -exec "myapp serve"

Description

The replicate command is the main Litestream daemon. It:

  1. Opens configured SQLite databases
  2. Monitors the WAL for changes
  3. Converts changes to LTX format
  4. Uploads to configured storage backends
  5. Manages checkpoints and compaction

Flags

Flag Description
-config PATH Configuration file path (default: /etc/litestream.yml)
-no-expand-env Disable environment variable expansion
-exec COMMAND Run command as subprocess (shutdown when it exits)
-restore-if-db-not-exists Restore from replica if database doesn't exist
-once Replicate once and exit
-force-snapshot Force snapshot creation (requires -once)
-enforce-retention Enforce snapshot retention (requires -once)

Examples

Using Config File

# Use default config location
litestream replicate

# Specify config file
litestream replicate -config /path/to/litestream.yml

Command Line Arguments

# Single replica
litestream replicate /data/app.db s3://bucket/backup

# Multiple replicas (deprecated: use config file)
litestream replicate /data/app.db s3://bucket/backup sftp://user@host/backup

Run Application Subprocess

# Via command line
litestream replicate -exec "myapp serve --port 8080"

# Via config file
# exec: "myapp serve --port 8080"

Litestream will:

  1. Start replication
  2. Execute the command
  3. Shut down gracefully when command exits

Auto-Restore on Startup

litestream replicate -restore-if-db-not-exists

If the database doesn't exist, restore it from the replica before starting replication.

One-Shot Replication

Read the full file on GitHub · 166 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 166 lines · 0 tokens per session scan A 63f37a0978fb

Subscribe to this mod's changes

replicate is a command published in the GitHub repository benbjohnson/litestream-skills (5 stars, last pushed 7mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 962 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.