/mokata:session runs instead · from mokata
Packages Claude Code session state into portable, versioned bundles for resuming on another machine or sharing with a teammate. Supports local file and Postgres transports with human-gated push/pull.
This skill never runs in Claude Code
It ships in mokata at src/, but /mokata:session (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
mokata Agent Skill. This is mokata's
sessioncapability, surfaced so Claude can engage it automatically when the moment fits. It runs the SAME protocol as the/mokata:sessioncommand, from one shared source — follow that protocol directly here; do not hand off to a parallel flow. mokata's non-negotiables still hold: durable writes are human-gated (preview, then explicit approval), and this capability's own gate is never silently skipped.
⛭ mokata session active — gate: bundles are secret-scanned; push/pull is human-gated on every transport
Your session state (the resumable run checkpoint(s), the approved approach, the emitted spec,
and any in-progress brainstorm) lives under .mokata/temp_local/ — local and gitignored, so it
doesn't travel. session packages it into a machine-path-free, versioned, content-hashed,
provenance-stamped bundle and shares it under a tag, so another machine (or a teammate) can
pull it and mokata resume continues exactly where you left off.
Transports (where the bundle travels) — --to on push, --from on pull:
local (default) — a file under .mokata/session-bundles/ on this machine.postgres — a shared DB table reached by a DSN env var (MOKATA_SESSION_PG_DSN, or the
shared MOKATA_PG_DSN) so a whole team pushes/pulls one store. Opt-in & local-first: with
no psycopg/DSN it degrades clean (a clear message, no crash) and never silently falls
back to a less-secure store.Both push and pull are human-gated and secret-scanned on EVERY transport (a secret in the session is a hard block approval can't override). On pull the bundle is untrusted: the content-hash is verified (corruption is caught from any source), it's re-scanned + re-gated, and a cross-codebase mismatch (the bundle came from a different repo) is surfaced — never silently applied. The HARD-GATE survives the trip: a not-yet-approved brainstorm stays not approved after pull.
${CLAUDE_PLUGIN_ROOT} is NOT expanded inside command bodies, so discover the bundled engine:
Read the cached plugin root: cat ~/.mokata/plugin-root → ROOT.
If that file is missing/empty, find the plugin directory another way: search the Claude Code
plugins directory for a mokata plugin that contains src/mokata/__init__.py, and set ROOT
to it. (If a mokata CLI happens to be on PATH, you may use it directly.)
Build the engine command using the absolute interpreter:
PY="$(command -v python3 || command -v python)"
mokata() { PYTHONPATH="$ROOT/src" "$PY" -m mokata "$@"; } # skip when a `mokata` CLI is on PATH
$ARGUMENTSIf $ARGUMENTS is empty, infer the sub-action from the conversation (save/share what was just worked on, or pick up a teammate's bundle); if it is still unclear, run list (read-only) and ask.
list — show the tagged bundles + their resume point, spanning local (+ shared Postgres
when a DSN is set), read-only. If this repo still holds bundles in the REMOVED vault
transport's store, list says so and names them rather than quietly listing short:
mokata session list --path .
push <tag> [--to local|postgres] — package THIS session under a tag on the chosen
transport. A gated write — follow §3.
pull <tag> [--from …] [--into <repo>] — re-hydrate a bundle so mokata resume continues.
A gated write on the target — follow §3.
name <tag> <new> — give a tagged session a human-friendly name (rename). A gated write
— follow §3. Idempotent; a name collision is refused unless --force (never a silent
clobber); provenance is preserved and the content-hash is untouched. The name is what push /
pull / resume and the status badge read, so you refer to work as auth-refactor, not a hash.
Preview first. Show the user what would happen without writing — for a push, the tag,
transport, and resume point; for a pull, the target repo and whether the codebase fingerprints
match; for a name, the old → new tags. A changed re-push is refused unless --force; a
fingerprint mismatch on pull is refused unless --force; a name collision is refused
unless --force (each an explicit, never-silent override).
Ask the user to confirm explicitly. Do not proceed without a clear yes.
Only after approval, apply (add --to / --from to choose the transport — default local):
# push the current session (postgres is the shared team store):
mokata session push '<tag>' --to local --yes --path .
# add --force ONLY to overwrite a changed bundle; --author <name> for provenance.
# pull + re-hydrate (default target = this repo; --into to target another):
mokata session pull '<tag>' --from local --yes --path .
# add --force ONLY to apply across a cross-codebase mismatch, after the user confirms.
# rename a tagged session:
mokata session name '<tag>' '<new>' --yes --path .
# add --force ONLY to overwrite a colliding name, after the user confirms.
A secret detected in the session is a hard block the approval cannot override on every
transport — if that happens, tell the user to remove it and try again. The Postgres transport
needs a DSN in $MOKATA_SESSION_PG_DSN (or $MOKATA_PG_DSN); without it the command degrades
clean — it does not silently fall back to local.
After a pull, tell the user that mokata resume (or /mokata:resume) now continues from the
bundle's resume point. After a push, remind them where the bundle lives for the other side to pull:
local → .mokata/session-bundles/<tag>.json; postgres → the shared DB (the teammate runs
session pull <tag> --from postgres).
If a step appears stuck, or the harness stops it mid-run: run mokata resume (where the run stands and the gate that still applies) and mokata approve --list (anything waiting on a human). Nothing is lost — run state, approvals and the audit ledger are on disk — so re-invoke /mokata:session to continue. Where the harness limits foreground time, start a long test run in the background; mokata doctor names a hung MCP server or a hook that is not firing.
| Excuse | Reality |
|---|---|
| "I'll push the bundle to sync quickly." | Every transport — push/pull/commit — is human-gated on each hop. |
| "It's just my own state — secrets are fine in it." | Bundles are secret-scanned; a secret hard-blocks egress and human approval can't override it. |
| "The other machine's state is stale — overwrite it." | Surface the content hash and CONFIRM before overwriting another machine. |
Evidence, not "seems right" — check every box or say which is unmet and why:
CAN
MUST NOT
DEPENDS ON
Grounding:
(gate: …)boundaries are enforced by that gate in code;(advisory)ones are protocol discipline this skill follows, not a hard block.
What SKILL.md sets; muted values are Claude Code's defaults
Engage when the user wants to package this session to continue on another machine, when they ask to share or hand off their session state to a teammate, or when resuming work from a session bundle pulled from another machine. Do NOT engage to push or commit anywhere without explicit approval, or to overwrite another machine's state without confirming the content hash.
Three short reads, in order
npx claudepluginhub jasgujral/mokata-oss --plugin mokata30 skills in this plugin
/apimokata · API & interface design — contract-first, blast-radius on every change./backend-nestjsmokata · NestJS rule pack — impact-ordered rules for modules, guards, DTOs and providers, loaded by the spec's routing./brainstormmokata · Socratic pre-spec exploration — explore approaches WITH the user, one question at a time, and HARD-GATE the spec behind explicit approval. Runs standalone or as the front of mokata's pipeline./browser-testingmokata · Browser testing (DevTools) — live runtime captured via the existing MCP surface, fed to the test gate./bugmokata · Start from a reproducer and a failing test, then fix./ci-cdmokata · CI/CD & automation — the quality-gate pipeline + Scorecard posture, not a suggestion.Other plugins' skills for the same job