No description
  • Python 92.1%
  • JavaScript 5.7%
  • HTML 1%
  • CSS 1%
  • Dockerfile 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-17 07:59:23 +01:00
.github centralize project instructions and adopt uv workflows 2026-10-08 21:03:53 +02:00
debian add a jenkins pipeline that publishes releases through aptly 2026-11-12 07:48:27 +01:00
docs merge upstream master (lodesman 2026.310.80000) 2026-11-17 07:59:23 +01:00
images add a jenkins pipeline that publishes releases through aptly 2026-11-12 07:48:27 +01:00
nginx add durable scheduling for saved conversations 2026-10-30 07:31:40 +01:00
scripts add a jenkins pipeline that publishes releases through aptly 2026-11-12 07:48:27 +01:00
src merge upstream master (lodesman 2026.310.80000) 2026-11-17 07:59:23 +01:00
systemd add usage statistics and allowance badges 2026-10-30 16:37:17 +01:00
tests merge upstream master (lodesman 2026.310.80000) 2026-11-17 07:59:23 +01:00
.clinerules centralize project instructions and adopt uv workflows 2026-10-08 21:03:53 +02:00
.cursorrules centralize project instructions and adopt uv workflows 2026-10-08 21:03:53 +02:00
.gitignore generate timestamp versions for each package build 2026-10-12 12:25:26 +02:00
.python-version run every Python invocation on uv-managed interpreters 2026-10-31 10:27:24 +01:00
.windsurfrules centralize project instructions and adopt uv workflows 2026-10-08 21:03:53 +02:00
AGENTS.md merge upstream master (lodesman 2026.310.80000) 2026-11-17 07:59:23 +01:00
CLAUDE.md centralize project instructions and adopt uv workflows 2026-10-08 21:03:53 +02:00
GEMINI.md centralize project instructions and adopt uv workflows 2026-10-08 21:03:53 +02:00
Jenkinsfile add a jenkins pipeline that publishes releases through aptly 2026-11-12 07:48:27 +01:00
LICENSE add LICENSE 2026-10-08 18:34:07 +02:00
MANIFEST.in add a jenkins pipeline that publishes releases through aptly 2026-11-12 07:48:27 +01:00
pipeline.toml add a jenkins pipeline that publishes releases through aptly 2026-11-12 07:48:27 +01:00
pyproject.toml build release 2026.310.80000 2026-11-06 08:04:53 +01:00
README.md merge upstream master (lodesman 2026.310.80000) 2026-11-17 07:59:23 +01:00
uv.lock refresh locked Python dependencies 2026-11-07 11:10:45 +01:00
web-assets.lock.json add session search and terminal comfort controls 2026-10-29 17:32:31 +01:00

Lodesman

Fork for the iac AI workstation. This repository is a modified copy of code-orange/lodesman under the same license (LGPL-3.0). Changes since 2026-10-15: providers for Antigravity CLI and Mistral Vibe. Upstream changes are merged from upstream/master.

The web interface includes a persistent task planner for scheduling prompts and skills in saved conversations. Claude, Codex, Copilot, Qwen, and OpenCode support automatic native delivery on compatible versions; providers without a verified connection retain their queued tasks. See scheduled conversation tasks for setup, queue behavior, supported commands, and execution history.

Lodesman resumes available coding-agent conversations in a dedicated tmux server. It discovers all supported providers by default and restores each saved main session in its own pane, using the recorded project directory. The init command sends a short noninteractive prompt in each project's latest saved session, creating a new session only for projects without one.

Provider Session discovery Interactive resume tmux name
Claude Code CLAUDE_CONFIG_DIR/projects/*/<UUID>.jsonl, or ~/.claude/projects/ Exact transcript with --resume and --remote-control cc-UUID
Codex CODEX_HOME/sessions/**/rollout*.jsonl, or ~/.codex/sessions/ codex resume --no-alt-screen UUID cx-UUID
OpenCode SQLite session_v2 / session, or legacy session JSON opencode --session ID; v2 also uses --standalone oc-ses_ID
GitHub Copilot CLI COPILOT_HOME/session-state/<UUID>/workspace.yaml, or ~/.copilot/ copilot --resume=UUID --remote cp-UUID
Gemini CLI GEMINI_CLI_HOME/.gemini/tmp/*/chats/session-*.jsonl, or ~/.gemini/ gemini --skip-trust --resume UUID gm-UUID
Cursor CLI CURSOR_CONFIG_DIR/chats/<md5>/<UUID>/meta.json, or ~/.cursor/ cursor-agent --trust --resume=UUID cu-UUID
Qwen Code QWEN_RUNTIME_DIR/projects/<slug>/chats/<UUID>.jsonl, defaulting to the configured runtime directory or ~/.qwen/ qwen --resume UUID qw-UUID
Antigravity CLI SQLite index ~/.gemini/antigravity-cli/conversation_summaries.db with conversations/<UUID>.db agy --conversation UUID --remote-control ag-UUID
Mistral Vibe VIBE_HOME/logs/session/unified/<ID>/meta.json, or ~/.vibe/ vibe --trust --resume ID vb-ID

Codex includes saved main interactive and noninteractive sessions. Intentionally archived Codex sessions must be unarchived in Codex before Lodesman discovers them. OpenCode includes archived root sessions that its CLI can resume. Child and subagent sessions are excluded. Resume uses each agent's authentication, approvals, and permission settings. Remote control is enabled for providers whose CLI supports it: Claude sessions resume with --remote-control, and before launch Lodesman runs codex remote-control start once per Codex profile, so resumed Codex sessions attach to its shared remote-control daemon, which keeps running after Lodesman exits. If the daemon cannot connect (for example, the account must enable multi-factor authentication first), Lodesman logs a warning and starts Codex without remote control. Copilot sessions resume with --remote, which makes them controllable from GitHub web and mobile and stays enabled for later resumes. Antigravity CLI sessions resume with --remote-control, which prints a link to continue the conversation on antigravity.google.com. OpenCode, Gemini CLI, Cursor CLI, and Mistral Vibe have no comparable option for local sessions and resume as local tmux sessions. Qwen Code also resumes in the local terminal; its separate managed web/daemon conversations cannot be reopened by the native terminal CLI and are not included.

Before resuming Codex sessions, Lodesman records trust_level = "trusted" in CODEX_HOME/config.toml for each session folder that Codex would otherwise stop at its "Trust this folder?" screen, with a backup, as choosing "Trust and continue" would. It uses the key Codex asks about: the canonical Git repository root (a linked worktree's main checkout), else the nearest project_root_markers root, else the folder itself when it has .codex settings or is inside a Git checkout; folders outside any project never ask. Trust alone changes Codex's defaults there: new threads without explicit sandbox or permission settings use its workspace-write profile instead of read-only, with on-request approvals unless an approval policy is set; resumed threads usually keep their saved settings. Codex also loads that project's .codex configuration, which can change approval and sandbox settings, MCP servers and exec policies; project hooks still need Codex's own review.

Decisions saved in CODEX_HOME/config.toml, /etc/codex/config.toml, or /etc/codex/managed_config.toml are kept, including untrusted, so such sessions still wait at Codex's restricted folder screen; enterprise configuration delivered from the cloud is not visible to Lodesman. The home directory, non-UTF-8 paths, and projects whose .codex/config.toml Codex would reject once trusted are never trusted, so Codex asks instead of failing on every restart. Lodesman only appends new tables and verifies the result; if it cannot record trust safely, or runs on Python older than 3.11, it logs a warning and Codex asks instead. Panes already waiting at the screen keep waiting until they are answered or restarted.

Before resuming Copilot sessions, Lodesman adds missing project directories to trustedFolders in COPILOT_HOME/config.json, with a backup, so the folder trust dialog does not block the pane. Gemini runs with --skip-trust, which trusts the folder for that run without writing settings, and Cursor runs with --trust, which records Cursor's own workspace trust marker. Antigravity CLI asks for folder trust in interactive sessions, so Lodesman adds missing project directories to trustedWorkspaces in ~/.gemini/antigravity-cli/settings.json, with a backup. Mistral Vibe runs with --trust, which trusts the folder for that run without writing settings. Copilot and Cursor detached, task-bound, subagent, and empty sessions are excluded, as are Gemini subagent and empty sessions, Antigravity subagent and empty conversations, and Mistral Vibe subagent and archived sessions. Antigravity CLI has no option for another data directory; it and Lodesman use the running user's home directory.

Requirements and installation

Requires Linux, Python 3.12 or later, and the CLI for each agent you want to use. Use uv for setup, installation, and development commands, and run every Python command through it. uv downloads and runs the CPython version pinned in .python-version (3.12, the minimum supported version); python-preference = "only-managed" in pyproject.toml means a system Python is never used, not even to create .venv. uv python install installs the pinned interpreter in advance. The Debian package is the exception: it builds and runs on the distribution's python3. Interactive restoration also requires tmux 3.2 or later; init does not use tmux. Claude's automatic project trust preparation also requires Git. No additional Python runtime packages are required for the core CLI. The optional web interface uses aiohttp and bundles xterm.js. Complete each agent's login and initial setup; restoring Claude sessions also needs its one-time Remote Control consent.

From a source checkout, create the project environment from the checked-in lockfile:

uv sync --locked
uv run --locked python src/lodesman.py --list-agents
uv run --locked python src/lodesman.py --dry-run

The project environment runs directly from src/: package = false keeps uv sync from installing the checkout or creating its console script. Explicit package builds and tool installation remain available below. The supply-chain policy excludes releases from the last seven days, enables malware checks, and configures uv-secure to reject yanked or quarantined releases.

For standalone use, install the checkout into a dedicated uv tool environment:

uv tool install --managed-python .
"$(uv tool dir --bin)/lodesman" --dry-run

uv tool commands do not read the project's python-preference, so --managed-python keeps the tool environment on a uv-managed CPython. The executable is placed in the directory reported by uv tool dir --bin. If that directory is on PATH, run lodesman directly. Otherwise, run uv tool update-shell and reopen your shell. Install external provider packages in the same tool environment with uv tool install --managed-python . --with PACKAGE.

Version 3 is a Python package. Copying only src/lodesman.py into a bin directory no longer installs the complete application. Existing cc-UUID tmux names and the lodesman socket are preserved. After upgrading, regenerate the systemd service to reference the new installation and choose --agent claude if you want to keep the previous Claude-only scope.

Debian package

Build the package on Debian 13 or later after installing the build dependencies, then install it:

sudo apt install debhelper dh-python pybuild-plugin-pyproject python3-all python3-setuptools python3-aiohttp
uv run --locked python scripts/build.py debian
sudo apt install "../lodesman_$(dpkg-parsechangelog -S Version)_all.deb"

The package installs /usr/bin/lodesman, creates the lodesman system account with home /var/lib/lodesman if it is missing, installs the configuration file /etc/lodesman/lodesman.conf, and enables and starts the daemon unit described in Run as a daemon. Local edits to the configuration file are kept on upgrades. The package also enables a daily timer that installs and updates all seven coding agents: first installs check bundled SHA-256 hashes (signatures are optional), then updates use the trusted vendor commands as lodesman. Downloads begin after installation; account login remains a separate step. See Agent installation and updates for the schedule, verification policy, and manual operation. Another timer saves usage statistics for the web interface every five minutes. The build runs the test suite; set DEB_BUILD_OPTIONS=nocheck to skip it. Unlike every other Python command in this repository, the Debian build and the installed package use Debian's python3, not uv's managed CPython: pybuild builds the package, the build runs the suite with python3, and /usr/bin/lodesman and the other installed commands start that interpreter. scripts/build.py runs under uv and removes the uv environment before it calls dpkg-buildpackage.

The package also adds lodesman to the docker group on installation and upgrades, creating the group if needed and preserving existing memberships. Install Docker separately. For installations outside the Debian package, apply the same membership with:

sudo usermod -aG docker lodesman

New logins and service starts pick up the group membership. Existing tmux sessions keep their original groups. Coordinate a daemon restart separately when they need Docker access: restarting lodesman.service ends its sessions. Package upgrades do not restart the daemon.

APT repository

Jenkins builds each stamped release in containers, from the commit that stamped it, and publishes it through aptly: to the lodesman/staging repository first, and to lodesman/prod once a smoke test of the installed packages has passed there. To release, stamp a version without building it locally, then commit and push:

uv run --locked python scripts/build.py stamp

Published packages carry the Debian release in their version, such as 2026.310.80000~deb13. See Packaging pipeline for the Jenkins job, the build server, and the APT source that installs and upgrades Lodesman from the repository.

Optional web interface

The separate lodesman-web package provides browser access to existing tmux sessions through a custom xterm.js interface. Nginx handles TLS and authentication; the web gateway runs as lodesman on a restricted Unix socket. Opening a session attaches to it, and closing the browser leaves the coding agent running. The gateway never initializes, resumes, or restarts agent sessions.

Search and filter sessions by project, provider, or status. Terminal controls include text search, copy selection, font size, and a collapsible session list; display preferences are remembered in the browser. The header shows each provider's remaining plan allowance, and the Usage dialog shows the complete usage statistics.

The build produces matching lodesman and lodesman-web Debian packages. Both services are enabled and started by default on installation. Configure the web gateway's public origin and nginx for browser access. See Web interface setup and operation for installation, authentication, Python installation, and verification commands.

Initialize projects

Choose one coding agent to initialize a saved session in every direct project subdirectory. The default project root is /var/lib/lodesman/:

lodesman init --coding-agent claude --dry-run
lodesman init --coding-agent claude
lodesman init --coding-agent codex --project-root /srv/projects
lodesman init --coding-agent opencode --project-root /srv/projects
lodesman init --coding-agent qwen --project-root /srv/projects

--agent is an alias for --coding-agent. Initialization requires exactly one provider and honors its profile and executable options. The project root must already exist. Projects run in name order; hidden directories, directory symlinks, files, and deeper subdirectories are excluded. Projects do not need to be Git repositories.

For each project, Lodesman finds the latest discoverable saved session in the selected provider and profile, matching the session's resolved working directory to the project directory. If several sessions have the same modification time, the session ID breaks the tie. A session discovery failure aborts the run before launching any commands.

Each project receives the prompt Reply with OK only. through the selected agent's noninteractive CLI, using its configured model and authentication. The prompt continues the existing conversation when one is available and creates a new saved session otherwise. Existing sessions keep their names. Initialization finishes after the reply and does not open interactive sessions or tmux panes:

Provider Initialization behavior
Claude Code Requests max effort, which Claude caps to the model's supported level. Limits the prompt to one turn and disallows all tools. Names new sessions after the project folder. Prepares project trust before each launch.
Codex Resolves the configured default model and its highest advertised effort. Starts the profile's remote-control daemon, then sends the prompt through a short-lived codex app-server on stdio with a read-only sandbox and approvals set to never. Names new sessions after the project folder and permits projects outside Git. codex exec is not used because the daemon hides its non-interactive sessions from remote control.
OpenCode Applies each model's highest advertised reasoning options through a process-local configuration, retaining native model and variant selection. Uses run with configured permissions, without a tool ban or turn limit. Gives new sessions the project folder as their title. Requires persistent storage.
GitHub Copilot CLI Uses the headless SDK protocol to resolve the session's model and highest supported effort before sending the prompt. Disables optional tools and denies permission requests. Names new sessions after the project folder.
Gemini CLI Prepares maximum thinking settings in the project's .gemini/settings.json, retaining the configured model. Uses headless -p with --skip-trust; headless mode denies every tool call that needs approval. Gemini has no session-name option.
Cursor CLI Resolves the default model and maximum supported thought settings in a temporary configuration, then uses --print --mode=ask --trust with the original chat store. Print mode rejects approval requests and ask mode is read-only by Cursor's policy. Print-mode chats stay unnamed.
Qwen Code Sets model.reasoningEffort to max in the project's .qwen/settings.json, preserving model selection and other settings. Native provider logic caps effort to the model's supported level. Uses headless --prompt with --chat-recording so new sessions persist, retaining Qwen's permission settings.
Antigravity CLI Sends the prompt with --effort max; the CLI validates the effort against the default model before creating or changing a conversation and names that model's levels, so the helper retries once with the highest of them, or without --effort when the model has none. Uses print mode, which needs no folder trust, with --mode plan; tool calls that need approval are denied. The CLI has no conversation-name option.
Mistral Vibe Uses --prompt with the read-only plan agent, one assistant turn, and --trust; resumed sessions use the configured default agent again. Vibe has no per-run thinking option, so the model keeps its configured thinking level (the default model uses its highest, high). It cannot prompt an existing session noninteractively, so init refuses projects that already have a Vibe session; the daemon only initializes projects without one. Sessions stay unnamed.

Maximum effort applies to both new-session initialization and existing-session pings, including sessions created by the daemon. Model names are not pinned by Lodesman. Models or automatic modes without an adjustable effort setting retain their native behavior. Ordinary interactive resume commands retain their existing behavior; initialization does not change shared authentication or permission settings.

Gemini and Qwen effort settings persist in the project because their CLIs have no per-run effort override. Existing settings receive an exact backup before an atomic update; unrelated settings and inherited model overrides are preserved. Gemini 3 and 4 use HIGH thinking, while Gemini 2.5 Pro uses a 32,768-token thinking budget and 2.5 Flash models use 24,576, following Google's thinking limits. Qwen uses its native max setting; explicitly disabled reasoning and managed settings retain their native precedence. Managed provider settings can still cap the effective effort. Other providers apply their overrides during the init process without rewriting shared profile configuration.

Initialization runs sequentially in each project's directory. Each command has a 120-second timeout; use --init-timeout SECONDS to change it. On timeout or interruption, Lodesman stops the launcher and its child process group. A project preparation failure, launch failure, or timeout is reported and remaining projects continue. The timeout applies to the noninteractive command, excluding preflight and preparation. A dry run shows whether each project will create a session or ping an existing one, and prints the commands without checking executables, changing trust, or calling a model.

Saved sessions can be resumed interactively with lodesman --agent claude --latest-per-project. Initialization cannot be included in a generated systemd service; use the daemon below to initialize projects continuously.

Select sessions

The default selects all available main sessions across all providers, including old or completed conversations. A dry run reads session metadata without launching agent CLIs, updating trust, or editing saved conversations.

lodesman --dry-run
lodesman --dry-run --agent claude --agent codex
lodesman --dry-run --latest-per-project --max-age-days 7
lodesman --session claude:12345678-1234-1234-1234-123456789abc
lodesman --session codex:12345678-1234-1234-1234-123456789abc
lodesman --session opencode:ses_example
  • --agent NAME restricts discovery to that provider and can be repeated.
  • --session AGENT:ID selects a conversation and can be repeated. Bare IDs are accepted when unambiguous, as are tmux names such as cc-UUID and cx-UUID.
  • --latest-per-project selects the latest session separately for each provider and project.
  • --max-age-days N selects sessions updated within the past N days.
  • --list-agents lists built-in and installed plugin providers.

lodesman resume explicitly selects this default command.

An explicit session that is missing, ambiguous, or excluded by another filter aborts the run before launching or replacing sessions. Missing providers with no stored sessions do not prevent other providers from running. A provider with unreadable storage, a missing executable, or a failed preparation step is reported and skipped during default runs; explicitly selected sessions fail together.

Profiles and executables

Option Default
--claude-config-dir PATH CLAUDE_CONFIG_DIR or ~/.claude; --config-dir remains an alias
--codex-home PATH CODEX_HOME or ~/.codex
--opencode-data-dir PATH $XDG_DATA_HOME/opencode or ~/.local/share/opencode
--opencode-db PATH OPENCODE_DB or opencode.db inside the OpenCode data directory
--copilot-home PATH COPILOT_HOME or ~/.copilot
--gemini-cli-home PATH GEMINI_CLI_HOME or the home directory (state in PATH/.gemini)
--cursor-config-dir PATH CURSOR_CONFIG_DIR, $XDG_CONFIG_HOME/cursor, or ~/.cursor
--cursor-data-dir PATH CURSOR_DATA_DIR or ~/.cursor
--qwen-home PATH QWEN_HOME or ~/.qwen; configuration and credentials
--qwen-runtime-dir PATH QWEN_RUNTIME_DIR, native runtime settings, or the Qwen home; saved conversations
--vibe-home PATH VIBE_HOME or ~/.vibe
--claude-bin, --codex-bin, --opencode-bin, --copilot-bin, --gemini-bin, --cursor-bin, --qwen-bin, --antigravity-bin, --vibe-bin Respective executable on PATH (cursor-agent for Cursor, agy for Antigravity)
--tmux-bin tmux on PATH
--socket NAME lodesman

OpenCode's data directory must end in opencode, because the CLI selects it through its parent XDG_DATA_HOME. --opencode-db accepts an absolute path or a filename relative to that directory, including databases used by alternate release channels. Discovery reads SQLite without starting OpenCode or triggering a storage migration. Legacy JSON is considered only when the default database is absent. OpenCode v2 runs standalone so a shared server cannot silently select another database.

Qwen Code is included in the installation/update timer. Run qwen as the lodesman account and complete /auth before selecting --agent qwen. Its configuration and session directories can be selected separately. If a project uses a different advanced.runtimeOutputDir, pass that directory explicitly with --qwen-runtime-dir; Lodesman reports conflicting locations before initializing rather than creating a second conversation elsewhere. Qwen JSONL files are read without changing the transcript or launching Qwen. The browser terminal and provider filter recognize qw- sessions automatically. Profiles redirected through .env, unresolved runtime variables, and relative profile environment paths require explicit directory options. If Qwen folder trust is enabled, trust the project in Qwen before initialization; Lodesman does not override a trust denial to apply its effort setting.

To use DeepSeek models with the existing OpenCode provider, follow DeepSeek through OpenCode. Authentication and model selection happen in OpenCode; Lodesman discovers and resumes those sessions as opencode.

Claude project trust

Before launching Claude sessions, its provider sets hasTrustDialogAccepted to true for the selected project directories, their direct subdirectories, and nested Git or Claude projects. This includes projects without Git. Scans skip Git metadata and directory symlinks; Git paths normalize to repository roots, and linked worktrees use the main checkout. The home directory itself is excluded.

For resume, the scan starts at each selected Claude session's project. For initialization, it starts at each project being initialized. It does not start at the directory where Lodesman or systemd was invoked. Codex and OpenCode sessions do not cause Claude trust updates.

Trust is merged into ~/.claude.json by default, or .claude.json inside an explicit Claude profile. Unrelated settings are preserved. Changed files receive a timestamped .claude.json.bak-YYYYMMDD-HHMMSS-ffffffZ backup (UTC) before atomic replacement. Invalid configuration and detected concurrent changes prevent the affected Claude sessions from launching. During initialization, a trust failure is reported for that project and the next project is attempted. Already-trusted projects cause no write or backup. Dry runs and service generation do not prepare trust.

Run with systemd

Choose providers and filters when generating the service; they are retained:

mkdir -p ~/.config/systemd/user
"$(uv tool dir --bin)/lodesman" --print-service \
  > ~/.config/systemd/user/lodesman.service
systemctl --user daemon-reload
systemctl --user enable --now lodesman.service

For example, add --agent claude --agent codex --latest-per-project to --print-service to restrict the service. Omitting --agent retains the default of all providers, including plugins installed later. Profile paths and managed environment variables are recorded so service reloads use the intended stores.

To keep the user service running after logout and start it at boot:

sudo loginctl enable-linger "$(id -un)"
tmux -L lodesman ls
tmux -L lodesman attach
systemctl --user reload lodesman.service
journalctl --user -u lodesman.service -b

Detach with Ctrl+b, then d. Reload discovers newly available sessions without restarting live panes. Stopping or restarting the service terminates its tmux server and managed processes. If migrating from the older claude-tmux-restore.service, stop and disable that service before starting this one; do not restore the same sessions simultaneously on the old claude-restore socket and the new socket.

Run as a daemon

lodesman daemon runs until stopped. It first resumes saved sessions like lodesman does, honoring --agent, --latest-per-project, and --max-age-days. Then it scans --project-root (default /var/lib/lodesman/) every --scan-interval seconds (default 10). For each selected provider, a visible, nonsymlink project directory without a saved session for that provider is initialized with the Reply with OK only. prompt and its new session is started in tmux with the provider's remote-control features. A newly cloned repository therefore appears as a new remote session in the Claude and ChatGPT clients.

  • Providers come from --agent, otherwise from the configuration file below, otherwise every provider whose CLI is installed is used and missing CLIs are skipped at startup. A selected provider whose CLI is missing is an error.
  • A directory is initialized only after it is unchanged for one scan and has no .git/index.lock, so an in-progress checkout is not picked up early.
  • Claude initialization adds the project's trust entry when it is missing.
  • Projects that already have a session for a provider are not prompted again. Live panes are left running. Startup selections and newly initialized sessions are retried until their first successful start and then supervised. When the program exits, including a successful exit after a CLI update, the daemon resumes the same saved conversation in the same tmux pane. It waits at least 15 seconds after detecting the exit, then restarts on an eligible scan. Repeated exits or restart failures also wait at least 15 seconds between attempts. The executable and provider capabilities are checked again so an updated CLI is picked up. Browser and SSH attachments remain connected.
  • Automatic recovery applies to supervised single-pane sessions. Live panes, unrelated sessions, and multiple-pane layouts are left alone. Explicitly deleting a tmux session or its managed pane ends supervision for it; quitting the program inside a supervised pane causes it to restart. One-shot resume runs and generated user services do not provide continuous supervision.
  • Sessions saved before a failed initialization are recovered without sending another prompt. A failed initial preflight, discovery, initialization, or first session start is retried after 10 minutes; initial network outages are retried on the next scan. Long initialization or network checks can delay scans.
  • Manual lodesman and lodesman init runs share the daemon's lock and are skipped while a scan is working, and vice versa.

The daemon reads /etc/lodesman/lodesman.conf when it exists; --config PATH selects another file, which must exist. The Debian package installs it with Claude Code and Codex selected:

[daemon]
# Providers to resume and initialize, separated by spaces or commas.
# Leave empty to use every provider whose CLI is installed.
agents = claude codex

Unknown sections, settings, or provider IDs stop the daemon with exit code 2. Restart the service after editing the file. Add a provider only after its CLI is installed and logged in for the lodesman account; otherwise each of its initializations fails and is retried every 10 minutes.

The first start initializes every existing project that lacks a session for a selected provider, which can mean many model calls and tmux sessions. Preview them with lodesman init --dry-run --agent NAME --project-root PATH.

Assign agents per project

With --assignments PATH, the daemon works only on the provider and project pairs listed in a JSON file instead of every selected provider on every project:

{"projects": {"shop": ["codex", "claude"], "homepage": ["antigravity"]}}

Keys are names of direct project directories in --project-root. A missing file assigns nothing. The daemon rereads the file on every scan, so no restart is needed. At startup it resumes only assigned pairs. A newly assigned pair resumes its latest saved session, or is initialized and started when it has none. Removing a pair does not end its tmux session; whoever edits the file ends it (tmux -L lodesman kill-session). A pair assigned again later resumes again. An unreadable or invalid file is logged once, and the last readable assignments stay in effect. Providers still come from --agent or agents; assigned providers outside that selection are ignored.

The Debian package (see Debian package) installs systemd/lodesman.service as a system unit for the lodesman account, whose home /var/lib/lodesman holds the checkouts. The unit is enabled at boot and started automatically on installation. Its first scan initializes projects that lack sessions. Inspect the running service with:

sudo systemctl status lodesman.service
journalctl -u lodesman.service -f
sudo -u lodesman tmux -L lodesman ls

Package upgrades issue a start request without stopping or restarting an already running daemon, so running sessions survive; restart it yourself to use the new version. Explicit administrator disablement and system service-start policy are respected. Without the package, install Lodesman for that account, change the unit's ExecStart path, and copy the unit to /etc/systemd/system/ before enabling it.

The unit runs the daemon under dbus-run-session, so all sessions share one D-Bus session bus. Without a bus, tools such as gh start a new dbus-daemon on every keyring lookup and never stop it. The package also raises fs.inotify.max_user_instances to 8192 through /usr/lib/sysctl.d/60-lodesman.conf, because each agent session holds inotify instances and the default of 128 per user runs out after a few dozen sessions.

Stopping or restarting the daemon service terminates its tmux server and the managed sessions. Do not run it together with a --print-service unit on the same tmux socket.

Usage statistics

lodesman stats reports token usage and the remaining plan allowance for every provider, or for those selected with --agent, in each selected profile:

lodesman stats
lodesman stats --agent claude --agent codex --json

Usage covers requests, input, cache reads and writes, output, reasoning, the total, and cost where an agent records it, over the last 24 hours, 7 days, and 30 days and all time. The JSON report and the web interface also break it down by model. Input excludes cache reads and writes, output includes reasoning, and the total adds input, cache reads and writes, and output. Allowance shows each plan window's used and remaining share and its reset time, plus details such as credits or extra usage.

Provider Usage Allowance
Claude Code Transcripts, including subagents, and Claude Code's per-session cost ledger Plan limits from Anthropic's usage service
Codex Rollouts, including archived and compressed ones Rate limits that Codex records with each response
OpenCode Its SQLite database Not reported
GitHub Copilot CLI Usage receipts in session-state/*/events.jsonl Quota that Copilot records with each response
Gemini CLI Chat recordings, including subagents Code Assist quota for Google account sign-in
Cursor CLI Not recorded locally Plan usage from Cursor's dashboard service
Qwen Code Its monthly token-usage ledger Not reported

Lodesman keeps its records in usage.sqlite3 in $XDG_STATE_HOME/lodesman (default ~/.local/state/lodesman). It reads only new lines of growing logs and counts each request once, so the first run over a large history takes the longest, and totals remain after agents delete or compress old transcripts. Reading compressed Codex history requires the zstd tool or Python 3.14. Usage includes only requests that agents recorded on this machine; use elsewhere, such as in the web or desktop apps, appears only in the allowance. Claude Code saves final output counts for only some responses, so its output and reasoning in time windows are lower bounds. All-time totals also include its cost ledger, which is an API list-price estimate rather than a subscription charge; a forked conversation's ledger, which starts from its parent's totals, is left out.

Claude Code, Gemini CLI, and Cursor CLI allowance requests use the agent's saved login, which Lodesman only reads: it never refreshes or rewrites credentials, follows redirects, or sends a login to a non-HTTPS endpoint (the agents' CODE_ASSIST_ENDPOINT and CURSOR_API_ENDPOINT overrides included). Lodesman asks each service at most once a minute per profile. After a failure it shows the last answer with its age. It waits an hour after a rejected login, unless the agent saves a new one, and after rate limiting it waits as long as the service asks, from one minute to one hour (five minutes if unspecified). When a saved token is about to expire, the agent renews it the next time it runs. --offline skips these requests and shows the last answer. Codex and Copilot allowance comes from their own logs and needs no request. A window whose reset time has passed since its last check is shown as reset, with its full allowance. Reports never include tokens, account identifiers, or transcript text.

--json prints the report as JSON. --save also writes it to stats.json in the same state directory for the web interface, which shows each provider's remaining allowance in its header; with --agent, the other providers keep their saved entries. The Debian package enables lodesman-stats.timer, which runs lodesman stats --save as lodesman every five minutes. The service can write only Lodesman's state directory, which the package creates:

systemctl list-timers lodesman-stats.timer
journalctl -u lodesman-stats.service

The command exits with 4 when it cannot read some provider's usage; allowance problems are reported in the output instead.

Session behavior and failures

Repeated resume runs preserve live panes and restart dead ones; process output remains visible after exit. Duplicate protection is local to the selected tmux server, not agent processes started elsewhere. A live pane does not prove successful authentication, a completed resume, or a Remote Control connection.

Use --session AGENT:ID --replace-selected to deliberately terminate and restart an explicitly selected session. Replacement requires exactly one pane in each existing selected tmux session and is never included in a generated service. Use it only when no work is running in the selected panes.

Exit code Meaning
0 Completed successfully, including no matching sessions or project directories
1 Configuration or runtime error preventing the requested run
2 Invalid arguments
4 Some providers or sessions could not be restored, or some projects could not be initialized
75 Required network connectivity is temporarily unavailable and nothing launched

The generated service treats 4 as a completed partial start. Reload it to retry skipped providers. Code 75 is retried after 15 seconds. Claude retains its Anthropic connectivity check and Cursor checks its API endpoint; Codex, OpenCode, Copilot, Gemini, and Mistral Vibe do not assume a cloud endpoint because their configurations may use local or custom models, and Antigravity CLI reports connectivity itself. --wait-network 0 disables connectivity checks; the default wait is 60 seconds. If Claude is unreachable, available providers can still start and the run reports a partial result.

Resuming restores conversation state, not interrupted operating system processes. Original special CLI flags are not reconstructed. Session storage formats are internal agent interfaces, so each provider checks and isolates its own format.

Extend and test

External providers register through the lodesman.providers Python entry-point group. See the provider contract for the lifecycle, registration, metadata rules, and test guidance.

Run the isolated regression suite from the checkout on Linux:

uv run --locked --extra web python -B -m unittest discover -s tests -v

Build the source distribution and wheel in dist/:

uv run --locked python scripts/build.py python

The build wrapper generates a version from local wall-clock time as YEAR.DAY_OF_YEAR.HHMMSS, with each component written without leading zeros, matching semantic-versioning-now.sh. For example, October 12, 2026 at 14:30:52 produces 2026.285.143052; at midnight, the last component is 0. Each invocation updates pyproject.toml, src/lodesman_core/__init__.py, and uv.lock, and adds an entry to debian/changelog. Like the reference script, versions have second precision; builds started in the same second reuse the version and changelog entry. Commit these generated version changes together.

Use uv run --locked python scripts/build.py all to build the Python artifacts in dist/ and both Debian packages in the parent directory with the same version. Omitting the target defaults to python. Ordinary uv run and uv sync keep the stamped version. The underlying commands uv build --no-sources and dpkg-buildpackage -us -uc -b also use the current version without generating a new timestamp.

Provider behavior is based on the installed CLI capabilities and these upstream references: Claude sessions, Claude effort, Codex CLI, Codex App Server, Copilot SDK, Gemini configuration, Cursor CLI, Antigravity CLI, Mistral Vibe, OpenCode CLI, OpenCode plugins, and OpenCode v2 CLI.