Skip to main content

Crash-proof checkpoints and resumable task memory for AI coding agents.

Project description

djobs

Crash-proof checkpoints and resumable task memory for AI coding agents.

djobs keeps long coding work recoverable when a terminal command fails, an IDE closes, or a chat loses context. Deterministic hooks cover the common command path; compact MCP tools track structured multi-file work; djobs gain makes the estimated context savings visible.

CI PyPI Website License: MIT Python 3.11+

djobs crash recovery demo

Why djobs

A coding agent can finish twelve files, lose its chat, then spend the next session re-reading the repository and guessing what remains. djobs stores exact work state in SQLite so completed work stays completed and failed or interrupted work can be resumed without replaying the whole conversation.

Layer What it does
preToolUse hook Rewrites meaningful Bash or PowerShell commands through a durable wrapper before execution.
sessionStart hook Injects unfinished and failed checkpoints into the next compatible session.
MCP tools Track semantic tasks, evidence, batches, dependencies, revisions, and multi-agent claims.
djobs gain Reports estimated savings for 24 hours, 30 days, and all time.

Everything is local by default: one SQLite file, no Redis, no broker, and no cloud service.

Quick start

VS Code and GitHub Copilot

Install the djobs — Agent Checkpoints extension from the Marketplace, then run djobs: Set up / Repair djobs from the Command Palette.

The extension installs or repairs the Python runtime, registers the MCP server, and installs deterministic lifecycle hooks without adding a persistent sidebar or poller.

CLI and MCP-compatible hosts

Install the runtime once, then initialize each repository:

pipx install djobs
cd your-repository
djobs init

djobs init writes the MCP configuration, installs the hook configuration, adds optional agent guidance, runs djobs doctor, and prints the resolved queue location.

Useful commands:

djobs doctor                 # verify runtime, MCP, database, and hooks
djobs hook install           # install or repair hooks only
djobs pause                  # temporarily disable hooks and recovery
djobs unpause                # re-enable them
djobs receipt                # evidence-backed work summary
djobs gain                   # estimated token/context savings

Automatic command checkpoints

Smart mode checkpoints tests, builds, linters, type checks, and substantial compound commands. It skips shell-state commands such as cd and read-only commands such as git status.

djobs hook install --mode smart   # recommended
djobs hook install --mode all     # checkpoint almost every terminal command
djobs hook install --mode off     # keep config installed but disable rewriting
djobs hook install --global       # share ~/.djobs/global.db with MCP
djobs hook doctor                 # validate the installed hook file

The wrapper preserves the original command output and exit code. Successful automatic checkpoints are archived after audit evidence is recorded; failed or interrupted checkpoints remain recoverable. Hook handling is fail-open: a djobs problem does not block the original coding task.

Savings analytics

djobs gain                         # current workspace
djobs gain --graph                 # 30-day ASCII graph
djobs gain --history               # recent checkpoint estimates
djobs gain --daily                 # daily non-empty totals
djobs gain --all --format json     # all workspaces, machine-readable
djobs stats                        # alias
djobs state                        # alias

The report separates automatic-hook savings from durable-workflow savings. Its numbers estimate avoided replay, re-reading, and re-planning using published assumptions; they are not provider billing data.

Structured workflows

For semantic multi-step work, the default MCP server exposes compact batch and revision-aware tools such as:

  • enqueue_batch and complete_batch for many tasks in one tool round trip.
  • resume_capsule for a bounded recovery view.
  • resume_delta for changes since a saved revision.
  • work_receipt for evidence plus Git working-tree checks.
  • claim_task, dependencies, resource locks, and agent heartbeats for shared queues.

Advanced queue features also include retries, dead-letter preservation, SQLite and PostgreSQL backends, a local read-only web dashboard, and a full audit log.

Compatibility

Host Current status
GitHub Copilot in VS Code Automatic hooks, native MCP registration, setup, pause/resume, and diagnostics are implemented and tested.
GitHub Copilot CLI/cloud hook format Supported by the hook adapter and unit tests.
Claude Code, Codex, Cursor, Cline, Gemini, other MCP hosts MCP workflows are available when the host supports MCP. Automatic hook behavior depends on that host's hook protocol and still needs broader real-world validation.
Plain browser chat without tools Not automatic; djobs needs MCP or a compatible installed hook host.

The compatibility table is intentionally conservative: shared protocol support is not presented as proof of full end-to-end validation on every agent.

Safety and privacy

  • Queue data stays local unless you intentionally point clients at a shared database.
  • Default MCP auto-approval is read-only; write tools remain explicit unless enabled.
  • djobs pause disables rewriting and recovery without deleting state.
  • The local dashboard binds to 127.0.0.1 by default and has no public-auth layer.
  • Tool output is treated as data, not as instructions that override the user.

Maintained documentation

To prevent documentation drift, this repository keeps a small set of canonical sources:

  • README.md — product behavior, setup, compatibility, and user commands.
  • CONTRIBUTING.md — development workflow and architecture map.
  • AGENTS.md — short rules for AI contributors working on this repository.
  • CHANGELOG.md — release history and release notes.
  • docs/RELEASE.md — the release runbook.

The live landing page is generated from the same product claims in docs/index.html; implementation truth remains in code and tests.

Development

git clone https://github.com/jhuang-tw/djobs.git
cd djobs
python -m venv .venv
pip install -e ".[dev,pg]"
pre-commit install
pre-commit run --all-files
pytest -q

See CONTRIBUTING.md before changing code and docs/RELEASE.md before publishing.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djobs-0.12.0.tar.gz (98.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

djobs-0.12.0-py3-none-any.whl (99.9 kB view details)

Uploaded Python 3

File details

Details for the file djobs-0.12.0.tar.gz.

File metadata

  • Download URL: djobs-0.12.0.tar.gz
  • Upload date:
  • Size: 98.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for djobs-0.12.0.tar.gz
Algorithm Hash digest
SHA256 578add36f90b67c893be4ae0874b637496cc11fba7b4fc6cdb0c40d6de36994f
MD5 9e7bbfb54afb31a32f65f80688b20051
BLAKE2b-256 515695ccebe0cfad6fb2015b7791aec924b6d8296251813d7b0af369bd6a6833

See more details on using hashes here.

Provenance

The following attestation bundles were made for djobs-0.12.0.tar.gz:

Publisher: publish.yml on jhuang-tw/djobs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djobs-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: djobs-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 99.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for djobs-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bba65d3e09bcd2a48ab0dd807fc5c7c27eda593da59f1f06d6ed7850be5a05d
MD5 9037532af98a1d22577d8c6568869a42
BLAKE2b-256 60315e5a769e0a8fa3b1add179838e4a2774e161acf1b7177a34fee90112f041

See more details on using hashes here.

Provenance

The following attestation bundles were made for djobs-0.12.0-py3-none-any.whl:

Publisher: publish.yml on jhuang-tw/djobs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page