These guides follow current development source; public downloads may not include every update. Check version scope

Core and CLI

简体中文 (canonical) · English · Documentation

crates/core is the sole implementation of local environment inventory, plans, file operations, task journals and field restoration. GUI and apps/runner call the same handle_request. SPEC (Chinese) retains the full target; this page describes current implementation only.

jobs.rs validates the original ID, finite status and fields needed for reconciliation. Incomplete records return invalid_job_record without rewriting originals. Legacy jobs retains complete receipts for compatibility. The App and named CLI use readonly jobs_page summaries and job_detail_page sections, each bounded to 256 KiB including the envelope. Lists sort by modification time/ID and enumerate at most 100000 files of metadata without writing an index or clearing journals; each page scans at most 100 candidates. Later pages bind the original digest and filters; changes return stale_history. scan_complete and records_complete distinguish end-of-scan from bad-record gaps on this page, and an empty page may still have next_offset. record_errors reports finite IDs/codes. Oversized single detail items return detail_item_too_large; small full receipts still open the original outcome and restoration actions. Environment discovery loads independently of history failures. I/O keeps the stable io_error code and adds a finite reason, such as permission_denied, storage_full or read_only_filesystem, without raw OS messages or paths. The CLI adapter retains its 20-second deadline and 64 KiB bound, with nonblocking stdout reads so an escaped descendant holding the pipe cannot block a reader join. Timeouts still require querying the original ID.

Host-shared IPv4 / IPv6

telemetry_catalog returns the compiled exact catalog before runtime-path/state initialization and accepts only command. Named CLI/finite SSH share operations' static field contract. No plan/task/network request is created. Policy records nonessential-traffic update/feature-flag collateral; the original egress Proxy owns controlled tests. Telemetry defines observation boundaries. Independent native app_updates.rs owns App updates outside Claude mutation plans; original update intent lives in App data. See App updates.

network.rs owns offline observation, finite-probe metadata/baselines and exact macOS IPv6 plans/approval/journal/restoration; egress probe is the sole HTTPS-byte implementation. network_inspect, network_probe, plan_network_ipv6, plan_network_restore need no environment ID; plans/receipts explicitly use environment_id:null, scope:host_shared. Generic execute admits these two supported mutation kinds without changing separate launch/resume/unknown admission. Generic plan_restore routes original network jobs correctly, never as settings restoration. Linux is readonly; synthetic homes cannot touch host networking. Network owns fields/restoration/uncertainty.

Reads, plans and approval

lintel request reads one JSON object ≤1 MiB from stdin, returns one envelope and exits nonzero on errors. Other commands: lintel --help. Obtain environment ID, preview, then submit the exact returned hash:

{"command":"plan_policy","environment_id":"00000000-0000-4000-8000-000000000001","preset":"reduce","keep_remote_control":false}
{"command":"execute","plan_id":"00000000-0000-4000-8000-000000000002","approval":"exact-hash-returned-by-plan"}

Replace example IDs/hash with executor results; never mutate real data from examples. plan_policy freezes rule version, configuration snapshot, root identity and fields. Changed files/replaced roots/wrong approval refuse. Strict parsing refuses duplicate keys/damaged JSON rather than silently normalizing and overwriting.

Plans freeze settings.json raw bytes and root identity. Preconditions follow actual read/write scope: rebuild/cleanup/import without settings edits can preview/execute with damaged/duplicate-key settings, preserving bytes; policy/field restoration require full parsing. Rules are claude-privacy-v5-2026-10-16 over 27 recognized fields: of the seven leading privacy switches, DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC use nonempty strings, including "0"/"false"; feedback/survey/DO_NOT_TRACK/DISABLE_GROWTHBOOK parse standard booleans, with 0/false/no/off ineffective. Every remaining OTel field keeps its own verified reading: the OTel switches and content fields parse as booleans, OTEL_METRICS_INCLUDE_ACCOUNT_UUID and OTEL_METRICS_INCLUDE_SESSION_ID are default_on (absent already means on; 0/false/no/off excludes them), exporters use finite selectors (none disables exporting), while value fields such as the receiver endpoint report whether a value is configured, and OTEL_LOG_RAW_API_BODIES additionally reads 0/1/file:<dir>. Recognized env keys require strings; unverified boolean forms are uncertain. One core model returns rules/scope/product evidence/impacts; GUI does not infer.

Discovery follows PATH, falling back statically to current-user ~/.local/bin/claude only when absent from noninteractive PATH. No other-user scan/shell initialization. Versions come only from native claude/versions/<version> or npm package.json, without running Claude/accounts. Unknown installs/families/prereleases stay unknown. discover/inspect/plans reidentify; changed executable/version evidence before execution requires preview again. Current official docs are never treated as installed version.

inspect returns all 27 recognized env values, settings path/state, effect_timing: next_launch and runtime_verified: false. The masked key (OTEL_EXPORTER_OTLP_HEADERS) reports only masked: true and value: null; its value never reaches ordinary inspection, plan, receipt or snapshot output. Explicit config_read in advanced editing returns the selected file text through its private interaction channel. Work statistics read metadata only, without content/digests/archive-admission limits. Budget/unreadable gaps mark each category complete: false rather than failing unrelated settings inspection.

PresetExact current changes
preserveDISABLE_ERROR_REPORTING=1, CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1; current metrics/proactive-feedback values retained
reduceAbove plus DISABLE_TELEMETRY=1, DISABLE_FEEDBACK_COMMAND=1
customPer-field custom_settings keep/disable/enable/remove/set; missing means keep; a set value comes from custom_values
keep_remote_control=truepreserve/reduce evaluate version/Trusted Devices for telemetry coexistence; custom records intent/evaluates exact diff without overriding choices
release_settingspreserve/reduce selected conflicting fields become explicit after:null deletions, removed only with exact approval and individually restorable

preserve/reduce act only on the four switches in that table plus explicit release_settings; every OTel field is reachable through custom alone and is never silently turned on or off by a preset.

Custom example:

{"command":"plan_policy","environment_id":"00000000-0000-4000-8000-000000000001","preset":"custom","custom_settings":{"DISABLE_ERROR_REPORTING":"disable","DO_NOT_TRACK":"keep","OTEL_LOGS_EXPORTER":"set","CLAUDE_CODE_DISABLE_WEB_FETCH":"remove"},"custom_values":{"OTEL_LOGS_EXPORTER":"none"},"keep_remote_control":true,"trusted_devices":"not_required"}

custom_settings accepts all 27 v5 keys in policy.rs catalog() order: the seven privacy switches (DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, DISABLE_FEEDBACK_COMMAND, CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY, DO_NOT_TRACK, DISABLE_GROWTHBOOK, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC) plus the OTel and remaining fields (CLAUDE_CODE_ENABLE_TELEMETRY, OTEL_LOG_USER_PROMPTS, OTEL_LOG_ASSISTANT_RESPONSES, OTEL_LOG_TOOL_CONTENT, OTEL_LOG_TOOL_DETAILS, OTEL_LOG_RAW_API_BODIES, OTEL_LOG_MANAGED_SETTINGS, CLAUDE_CODE_OTEL_CONTENT_MAX_LENGTH, OTEL_LOGS_EXPORTER, OTEL_TRACES_EXPORTER, OTEL_METRICS_EXPORTER, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, OTEL_METRICS_INCLUDE_ACCOUNT_UUID, OTEL_METRICS_INCLUDE_SESSION_ID, OTEL_METRICS_INCLUDE_VERSION, OTEL_METRICS_INCLUDE_ENTRYPOINT, OTEL_METRICS_INCLUDE_REPOSITORY, CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL, CLAUDE_CODE_DISABLE_WEB_FETCH). keep retains string bytes; disable retains already-disabled values or writes that variable's off value (DISABLE_*-style switches, i.e. the seven privacy switches and CLAUDE_CODE_DISABLE_WEB_FETCH, "1"; positive content/telemetry Boolean "0"; default_on "false"; an exporter "none"; any other free-value field can only be removed); enable turns a signal on (a default_on field is enabled by deleting the key, marked restores_default: true); remove deletes that user-settings key without promising enabled features, absent keys produce no change. Missing custom_settings means {}.

A set value travels outside the action channel as custom_values: {"<FIELD>": "<string>"}: it applies only to fields whose action is exactly set, both must appear together (a set without a value and a value without a set both refuse), and it is accepted only under preset: "custom". The core validates each value against its field semantics (the content-length limit must be digits only, the receiver endpoint may not contain whitespace, each exporter accepts only its own documented selectors, raw bodies accept only 0/1/file:<dir>) and refuses control characters or newlines. The masked key OTEL_EXPORTER_OTLP_HEADERS admits only keep/disable/remove: it usually carries receiver credentials, the policy editor does not accept new credential values, so this field cannot be written or replaced there and never accepts a custom_values entry — a violation returns masked_setting_not_writable. If a policy change removes or replaces an existing masked value, the Engine routes it through the same config_edit path: passphrase-encrypted preservation of the complete configuration precedes writing. The public diff carries no original value; selected-field restoration uses the original task. The seven privacy switches, like every other recognized field, admit all five actions (keep/disable/enable/remove/set); the direction of disable/enable follows the switch's DISABLE_* meaning. Empty diffs preserve bytes/permissions/existence, update drift baseline and complete with restorable: false. Other presets reject custom_settings; null/arrays/unknown keys/nested objects/actions refuse. Custom rejects nonempty release_settings; use remove.

Per-field behaviour, current setting, source, receiver or on-disk destination, main impact and version evidence all come from the same core rule model (inspect.policy.rules, carrying category, semantics, sources, default_state, impact, version_floor, depends_on); the GUI does not infer them. Conflict attribution lists the actual source paths and permits a writable user/project-local location, but never treats the GUI process environment as another terminal's or IDE's real launch environment. OTEL_EXPORTER_OTLP_HEADERS reports only masked: true and never reaches ordinary output; a credential-bearing OTEL_EXPORTER_OTLP_ENDPOINT (user:pass@host, ?query, #fragment) is treated the same way.

Edits target registered-root settings.json.env. preserve/reduce do not add blanket disable; custom explicitly selects any of the 27 fields. All share diff/approval/readback/restoration. No wildcard OTel cleanup or proxy/AWS/Google/permissions/hooks/MCP edits. Private writes retain existing read permissions while removing group/other writes. Readback does not affect existing processes; UI says next launch. Project/organization/IDE/service/auth sources are incompletely discovered. Known local managed-settings prevents lower-level override.

Remote Control versions and existing settings

Version/conditionWith effective telemetry / DO_NOT_TRACK disable
Before Claude Code 2.1.283, including 2.1.154–2.1.282Conflicts with Remote Control; pre-2.1.154 messages differ
2.1.283+, declared no Trusted Devices requirementConfiguration can retain Remote Control without reopening telemetry
2.1.283+, declared Trusted Devices requiredRelated controls require explicit removal
Unknown family/organizationconditional, no availability promise

Effective DISABLE_GROWTHBOOK/nonessential switches independently block Remote Control under their own semantics. trusted_devices is user-declared unknown (default)/required/not_required, never organization discovery. Sources reviewed 2026-10-03: env vars, Remote Control.

Selecting preserved features after reduced egress computes existing conflicts. preserve/reduce explicitly remove selected DISABLE_TELEMETRY/DO_NOT_TRACK/DISABLE_GROWTHBOOK/CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC via release_settings; custom uses remove. Values are never deleted by guessed authorship; later edits stale plans. Only this user settings changes; shell/project/organization remain their owners'. Existing processes are not unset; restart.

inspect.policy/Plan.policy/Receipt.policy retain same version/rules, with supported_presets. Plans/receipts retain preset, exact custom selections and diff-based projection. Rule changes stale unexecuted plans. blocked/conditional/configuration_compatible never prove runtime. Account/subscription/organization/device enrollment/API endpoint/other sources remain unaccepted. Old runners lacking versioned results/custom support show update guidance.

Environments and storage

Default state: macOS ~/Library/Application Support/Lintel, Linux ~/.local/share/lintel. Explicit development LINTEL_TEST_HOME/LINTEL_STATE_DIR needs an existing independent home. discover can register existing default .claude; register takes explicit absolute roots; create_environment creates roots in Lintel-owned storage.

Directories 0700, records 0600, with temporary write/fsync/rename/directory fsync. Targets reject symlinks, root/home, abnormal hardlinks and wrong owners. Discovery executes no Claude/auth helpers/shell rc/hooks/MCP.

Concurrency and recovery boundaries

The local operation lock serializes mutation only within the same state directory. Different states targeting one root rely on snapshots/rechecks, without shared exclusion. jobs/job and the new jobs_page/job_detail_page can read atomically persisted journals during execution. The new page interfaces remain readonly without reconciling or updating records; a real writer holding lock prevents interrupted classification. Without a writer, legacy job queries of nonterminal records become needs_reconciliation. Receipt ID equals plan ID; repeated execute returns original without repetition.

Durable acceptance precedes execution/verification/result. request runs foreground; submit accepts execute only, passes stdin to worker and ACKs after accepted journal persistence. Linux PID 1 systemd/euid 0 uses system transient; nonroot needs preexisting Linger=yes/current-UID user bus for user transient. Original environment travels via private same-host stdin pipe and cwd remains, preserving auth/proxy checks without values in units/argv/receipts/disk. Worker checks actual cgroup before acceptance; Restart=no, no resubmission or second launcher after manager uncertainty. Others retain setsid with explicit limits for macOS/non-systemd/ineligible users. Internal execution mode/manager/unit/continuation/limitation/reboot_survival:false persists before ACK, not caller-spoofable. Old receipts remain without invented facts. Lost connections query original, restoration separately approves. PAM/logout/reboot/VPS evidence: current state (Chinese).

Before settings atomic rename, original job settings_write persists synced staged object's identity/digest/permissions/frozen hash. After publication-before-receipt interruption, job/plan_restore under lock compares current/original/staged objects and persists settings_recovery state/reason/message. Only staged-object-matching written permits restorable; original still present is not_written, other bytes/objects/changed plan/root ownership_unproven. Neither rewrites/deletes/restores automatically. Original remains needs_reconciliation, never retrospective full success. Equal fields after outside atomic rewrite do not prove owned publication; legacy jobs get no fabricated intent.

Restore only edited fields still equal original written values; conflicts refuse, unrelated edits remain. Snapshot/recheck/atomic replacement is not atomic compare-and-swap with uncooperative editors; a final-check/rename race remains. Service pause proves only specific unit/hold, not all Claude/IDE/terminal/supervisor writers.

Encrypted archives and new environments

Categories: instructions/memory/sessions. Archive plans execute with archive_passphrase ≥12 characters in that request only, never plan/journal/support.

plan_archive outcome archive_only encrypts selected work without root/settings/credential changes or original edits. Explicit absolute output_path freezes path/parent device/inode, rechecked at acceptance/publication; replaced parents stale_plan, unattempted old plans without identity need preview; completed originals remain query-only. Destination must be absent, parent preexisting; core creates no parent. Default archive remains private state with receipt archive_path. plan_preserve additionally creates/imports to new root, outcome preserve/preserved, coverage retains old_login/old_root and service_binding:unchanged. next_steps describes new protection/login/runtime checks, references/explicit instructions. Old environment steps are preserved, never unfinished. plan_show returns frozen public fields without raw snapshots/root identity/extra. New planned_target freezes full root/ID/destinations/purposes/activation and execution reuses that allocation; old relative import_manifest remains compatible. Passphrases never enter plans.

plan_reset accepts only recipe rebuild: archive/new-root/import retaining old root/login, historical partially_completed cleanup/login semantics; old receipts are not made green.

Recognized paths: root CLAUDE.md, projects/*/memory/.md, projects/*/.jsonl, prior lintel-imports/CLAUDE.md, direct lintel-N-CLAUDE.md and lintel-imports/projects/**, with original categories/no nested lintel-imports. Admission: 256 MiB/file, 1 GiB total, 10,000 files, 50,000 entries, 30 seconds; incomplete scans never count complete. Plans/receipts/registry share 16 MiB JSON read/write budget, rejecting before persistence. Body limits do not guarantee deep-path/destination metadata fits; narrow exact selection. Execution rechecks path/identity; archive checks free space on frozen output-parent storage, never substitutes state disk.

Packages are standard age-passphrase JSON lintel.work/1 with generator/created_at and file path/category/digest, reread after creation. New generator is Lintel; inspect reads the self-declaration, older/unrecognized packages return null, never attributing outsiders or authenticating provenance. Packages are self-contained across independent installs: archive_inspect/archive_read/plan_import accept exactly one job_id or absolute archive_path. Job source checks recorded path/archive_digest, rejecting replaced valid packages as stale_archive; missing legacy digest remains compatible. External paths are independent, with identical full limits/passphrase/corruption/absolute/parent/duplicate/category/digest safeguards. Import freezes source/encrypted digest and rereads at execution. Same names/unselected categories/originals remain protected by create_new. Public import_manifest projects frozen package format/self-declared generator/exact encrypted sha256 and files source/destination(relative to target)/category/size/sha256, including lintel-N allocation, without text/passphrase/other extra. Preview/plan_show/GUI share it. Historical lintel.state/1 backups remain separate and are not auto-imported; new authentication plans do not generate them.

package.rs is the only production codec, using serde DeserializeSeed/Visitor, duplicate-key checks and age streaming. The whole-Value reader is small-test-only; lintel.state/1 describes a historical client-state format, not a write step in new authentication cleanup. Frozen originals stream/hash into private 0700/0600 staging; incoming byte arrays stream u8 without whole-package materialization. Metadata ≤1 MiB/field, 16 MiB total; data token ≤128 bytes before serde; plaintext/ciphertext have finite encoded budgets derived from body capacity. Buffering sits below gates so prior-field prefetch cannot bypass budget. Digest/authentication/tail use one non-following handle, checking path/handle before/after; returns only finite metadata/request windows. age headers ≤64 KiB; scrypt rejects log N>20 without altering package strength. Writer retains age device-cost choice; actual KDF memory/build conditions are measured separately.

Before publication persist exact destination/cipher digest, recheck parent, atomic no-replace publish, parent sync and full authenticated readback. Intent is not completion. Failed parent sync retains exact path/intent and needs_reconciliation; readable output never proves completion. Import/resume stream into same-directory temps, verify digest/fsync, no-replace rename/parent sync/readback. Failure retains original job/published artifacts without renamed retries. RAII removes only owned unpublished cipher/copy temps on normal write/sync/intent errors; published artifacts remain. Operation staging normally cleans via RAII; resume explicitly closes full decoded staging before successful exec, failing closed on cleanup with original ID. Kills may leave random private directories, never implicitly swept. State/output need expanded/cipher/temp disk and verification time despite streaming memory.

Current data flow is readonly on originals; only approved core publishes/imports. Verification success is not client-loading/authentication proof:

flowchart TD
    F["Frozen selection / complete digests"] --> S["work.rs: private original staging"]
    S --> E["package.rs: streaming age encoding"]
    E --> J["Durable archive intent"]
    J --> P["No-replace ciphertext publish / parent sync"]
    P --> V["package.rs: full authentication / digest / EOF"]
    C["Existing job or independent package"] --> V
    V --> D["Operation-private decoded staging"]
    D --> R["session.rs: pages ≤256 KiB"]
    D --> A["Approved mapping / complete digests"]
    A --> I["archive.rs: temp copy / no-replace / sync / readback"]

Every open/page fully verifies. After full decode, resume rechecks root/cwd/client/startup before first intent/copy, then rechecks before launch after copy/explicit staging closure. Later changes retain intent/exact copy, query-only. RAII cleans only this operation; killed leftovers need original-task inspection.

New roots follow completed work archiving. Historical cleanup state backups remain compatibility records, not prerequisites for new plans. App defaults all materials to lintel-imports; explicit instruction activation places root CLAUDE.md actively, old raw defaults retained. No settings/hooks/MCP/plugins/credentials restoration. Re-archiving retains reference categories, including direct lintel-N-CLAUDE.md, without activating. Shared allocation preserves all names/parents first, then prefixes colliding files lintel-N-, retaining both bytes/extensions/categories, without overwrite/nesting. Independent imports share frozen allocation/rechecks; existing targets refuse. Default archives remain private state; old packages supported.

Finite components and capacity preflight

components.rs inspect_components projects lintel.components/1: exact environment/root, optional target-host cwd, time, finite sources/scopes/next entries/original records. CLI reads static installation metadata; config returns only paths/existence, hook/MCP/credential-helper/policy-helper/plugin booleans and finite auth-variable names, no commands/arguments/env values/text. Shared startup.rs lists root/cwd/up to 32 ancestors, managed files/up to 64 drop-in entries. Ancestors are candidates without version-loading priority inference. Organization/worktree main/directory contents/actual loading/OS enforcement uncovered. Auth metadata only, without credentials/probe.

Original scan ≤10,000 directory entries, no job reconciliation, same environment plus matching legal filename/original ID, at most 50 records, distinguishing incomplete reads/display truncation. Refresh ≤8 exact recorded units; failures unknown with original IDs. task_result.coverage is history. Browser/IDE/Desktop/unsupported supervisors remain independent of root processing.

work_preflight shares metadata scanner/category/body/file/entry/symlink rules; at most 200 blockers, truncation never changes refusal, 50,000 entries/30 seconds with first missing relative source. No digests/frozen approval; manifests/execution own admission. lintel.work/1 remains 256 MiB/1 GiB/10,000 files, unchanged scan/selection budgets.

work_inventory sorts original paths/paginates metadata; complete means entire scan independent of next_offset. Digest binds full observation; later expected_digest mismatch stale_inventory. No execution grant. Additive selected_paths in preflight/archive/preserve is finite exact originals; omission retains categories. Operations/core share static categories; path/count/encoded-JSON/ancestor guards separately validate. Exact mode checks selected originals only, skipping unselected oversized/special entries. Plans freeze paths/device/inode/owner/ctime/full content; same-byte replacements require preview. Checks surround reads/before acceptance without OS CAS. Public work_selection exposes mode/paths, new-root mapping stays frozen. Identities never enter lintel.work/1; old categories/cleanup/reset/import/package bytes remain compatible.

Local data, identity, snapshots and configuration editing

These groups reuse the same plan/approval/job/receipt chain without adding a second executor. Every observation reads metadata or finite static sources only; nothing runs Claude, executes hooks or contacts public endpoints, and writes happen only inside an approved plan.

residue_inventory (residue.rs) scans local data through a finite known-location table plus up to eight caller-supplied extra_roots. Known locations carry work/residue/identity/config classes; version-dependent ones are unclassified; anything outside the table is not covered rather than assumed absent. Rows carry only path, category, class, size and mtime and can be filtered by class/category/project/time/size; offset+limit (≤200) page over one expected_digest, and a change returns stale_inventory. complete describes the whole observation independently of paging; depth/entry/row budgets, read failures and skipped special/unsafe entries stay explicit. Only clearable residue is a default clear candidate; unclassified requires explicit selection in the current preview, work requires delete_work, and an identity location reports presence only and is never a clear target.

identity_inspect (client_data.rs) recognizes only the verified persistent field userID and the account trace oauthAccount, returning presence/persistence by default without values. Only reveal: true places the raw userID in this response (reveal_scope: private_response_only); oauthAccount stays presence-only, and the raw value never enters a plan, job, receipt, snapshot or Agent metadata.

snapshot_save/snapshot_list/snapshot_compare/env_compare (snapshot.rs, comparison_control.rs) save sanitized semantic snapshots and compare them: egress settings, configuration sources, hook/MCP/plugin declarations, identity same/different and residue counts. Request headers, credential-bearing receivers and raw identities stay out; identity comparison material stays in private local state, comparisons expose only same/changed/unknown, and different salt domains cannot attest a change. An immediate env_compare shares one temporary salt and saves neither a snapshot nor a persistent salt. Missing/damaged/unreadable configuration is marked incomplete rather than "off", and hidden values stay undetermined. snapshot_accept accepts selected differences as the comparison baseline: it means accept the current value, is not a restoration source and is not one simultaneous full observation; restoring original values still needs the original task or an encrypted backup and a new approval. drift with lightweight: true reads finite configuration sources only when an environment opens or a launch happens and returns configuration_sources_only; there is no resident watcher, and residue/identity need an explicit full comparison. Once a semantic baseline exists, accept_drift refuses to overwrite it with semantic_baseline_selection_required; use per-item snapshot_accept.

config_inspect/config_read/plan_config_edit/plan_config_apply/config_restore_inspect/plan_config_restore (config_control.rs) edit the writable user configuration files an environment explicitly selects. source_scope classifies a file as user/project/project_local/project_mcp/explicit_user_config; managed and identity files stay read-only and refuse writes. plan_config_edit needs a strict JSON document plus the read-time expected_digest and computes a per-field diff; public_change reports an unrecognized or credential value (masked_setting) only as masked: true with before/after null, so raw text appears only through an explicit advanced edit. Execution first seals the current configuration as an age lintel.config/1 backup (config_archive_path), then publishes and reads back byte-for-byte; plan_config_restore touches only the fields the original task changed, requires the current value to still equal the written value (else restore_conflict) and preserves unrelated later edits; plan_config_apply copies only recognized ordinary configuration and refuses to carry identity or receiver credentials across environments. plan_client_workflow composes configuration edits, residue clearing and identity reset into one client_workflow plan with one approval and one original job; a file cannot belong to two steps (overlapping_actions), each step completes or is skipped independently, and an interruption is queried by the original ID only.

plan_cleanup's clear_residue recipe and the standalone plan_identity_reset each act on exactly the selected originals: clear_residue needs a non-empty residue_paths, optionally writes an independent lintel.residue/1 encrypted backup before deleting, rechecks each file's identity and lets one file's failure skip only that file; identity_reset removes only the verified userID (plus explicit identity_backup_paths), preserving it in an encrypted backup first, keeping every other key value-by-value and never logging out or clearing credentials. residue_archive_inspect/plan_residue_restore are the finite read/restore entries for those backups: lintel.residue/1 is separate from the work package, restores only the original paths recorded in the package, refuses to overwrite an existing file (restore_conflict), and is not a work import.

Finite cleanup and authentication

The source selection and verification capabilities in this section shipped in App / CLI 0.2.0 Preview. See the cleanup guide and official evidence record.

cleanup_inspect retains exact-file metadata and writer observations. New auth_inventory(environment_id, project_cwd?) uses bounded reads of known locations in auth_sources.rs, separating confirmed local sources, the current executor's environment, declarations, inaccessible sources and other contexts. It never runs Claude, shell startup, helpers, hooks or MCP, reads history, or returns tokens, helper bodies or stable credential fingerprints. Presence and empty/nonempty value state do not prove actual use.

plan_cleanup recipes repair_login/reset_client/retire retain the same plan, approval and original-job authority and require writers_confirmed_stopped:true. Additions are auth_source_ids, optional project_cwd and default-off verify_auth_status. Select editable IDs from the same environment's inventory; paths and secrets are not source IDs. Omission by an old raw caller defaults only to precisely recognized target-local fields: claudeAiOauth in .credentials.json, primaryApiKey in client state, and /claudeAiOauth in supported Keychain items. Default-root state is the home .claude.json; a custom root uses its own .claude.json. Explicit selection also supports recognized user-settings authentication fields/helpers and simple shell assignments. Unknown formats, other fields, MCP/plugins and work remain; mixed stores are never deleted wholesale.

Private extra.authentication uses lintel.auth-cleanup/1, binding source IDs, exact locators, file/parent identity and per-plan salted content digests without credential bytes; Keychain persistent references/accounts remain private and never enter the public projection. Checks run before acceptance, after preservation and at edit boundaries; changed selected sources return stale_auth_source. Requested runtime checks also freeze/recheck the executable; rediscovery cannot retarget old approval. Unexecuted old plans lacking the new binding or requiring official logout return stale_auth_plan; accepted originals remain query-first and never replay. Newly appearing unselected sources are retained and reported by fresh observations.

Official documentation explicitly states that /logout also removes saved MCP logins and plugin sensitive values. CLI auth logout has no verified adapter meeting this development's preservation scope, so new official_logout:true requests return official_logout_scope_unsafe without invoking it. This decision follows documentation and scope requirements, not a real CLI/Keychain trial in this development. Exact Keychain field cleanup is a separate finite capability and never establishes coverage of unselected services, other accounts, shared profiles or server revocation.

keychain.rs/keychain/macos.rs query finite services and the current account through Security.framework. Naming derives from static inspection of Claude Code 2.1.101 without executing the client. Default roots check the bare service and root hash; custom roots check hashes. An inherited raw CLAUDE_CONFIG_DIR resolving to the target also contributes its hash. Approval freezes item identity and a whole-payload digest; in-memory JSON transformation removes only /claudeAiOauth, preserving mcpOAuth, pluginSecrets and unknown fields. SecItemUpdate changes data only without deleting/recreating the item or exporting secrets to temporary files. Each item is limited to 1 MiB within the 8 MiB source budget. limits.keychain_scan_complete is independent of file scanning; limits.keychain:"selected_services_only" retains finite coverage. Immediate pre-update comparison and full readback provide no external-writer CAS or cross-source atomicity. Changes/uncertainty retain the original ID without update retries. Production native API and real-client acceptance are separately recorded, never inferred from synthetic fixtures.

Execution order is: admission checks → work encryption for reset/retire → frozen new-root creation/import for reset → writer/source recheck → exact authentication edits → entry retirement if selected → independent verification. New authentication plans create no lintel.state/1 or token-recovery backup. Work packages still reread against the original archive_digest; replacement yields stale_archive before creation/import/editing. Later failure retains completed archives, roots and steps. reactivate_environment restores registry eligibility only, never deleted credentials.

Known running Claude writers refuse without global killing or complete wrapper discovery. Exact Linux systemd bindings require a separate pause plan and live owned hold/inactive/MainPID/empty-cgroup evidence; a manual stopped declaration cannot substitute. Other writers remain independent; see services. Shared files change only within the supported frozen scope. Complex shell files remain declaration-only, with no execution to infer ownership.

Exact file edits compute a replacement in bounded memory, move the original into private staging beside the source, publish without overwriting another writer and read back; success removes the staged original. This is not OS CAS against open external descriptors. Interruption/conflict may retain credential-containing material, reported in retained_sensitive_material. If staging is renamed/replaced and its identity is lost, state is location_unknown and its path is only the last known location; no scan follows it. Unconfirmed material prevents local completion, and original-job queries neither replay edits nor sweep staging.

auth_verify(environment_id, job_id?, observe_runtime?) independently rereads sources and may associate the original job without rewriting its receipt. Default observe_runtime:false starts no client. Explicit observation runs auth status for this executor/root before the final file reread, allowing status/helper credential regeneration to be observed. Existing auth_probe remains a separate explicit action, requiring configDirectory and a finite authentication method, returning sanitized state and identity_observed without email/raw output. That command may access authentication facilities, execute helpers or contact networks. Real Claude/Keychain acceptance remains separate.

Receipts separate selected local sources, the current executor, other contexts and server revocation. Removed local sources can coexist with remaining authentication. Successful selected cleanup retains the historical partially_completed overall status; local_cleanup and per-source results explain the completed scope, without converting unknowns into machine-wide logout. Accepted failures preserve structured error:{code,message,phase,recovery}, completed steps and artifacts, directing recovery to original-ID lookup.

lintel tui provides inventory, finite source selection, these recipes, archive reading/import and reactivation; named CLI/raw JSON share core. Passphrases use a no-echo terminal or one-time JSON stdin, never plans, journals or support output.

Launch and support

session.rs owns bounded session_read by package source/file digest: byte continuation, structured records/raw text. Unknown/damaged originals remain; thinking/signature opaque. Text/passphrases never ordinary journals. Full package authentication then staging seek ≤256 KiB, offsets in original bytes including CRLF/non-UTF8. Legacy archive_read retains ≤1 MiB preview.

launch.rs owns plan_launch/launch_request, separate plan_resume/resume_request and readonly launch_query/launches. Root selects state; cwd selects work. Preview freezes target/executable/static version, first execution rechecks and persists intent before Terminal/PTY. Repeats/interruption query-only. Resume private byte-identical copies protect archived originals; assessment ≤8 MiB, larger files unsupported but readable. Version/auth/runtime/write boundaries: frozen plans/operator guide.

startup.rs shared finite projection lintel.startup/1 exposes candidate paths/states/declarations, no commands/env/credential/instruction bodies. Settings/MCP reads ≤1 MiB/file, 16 MiB total, with distinct symlink/special/restricted/parse states. Private extra.startup_binding freezes identities/salted settings digests and rechecks before intent/copy/Terminal, stale_plan on changes. Unattempted old plans need preview; existing originals query first. New roots do not remove project/system sources; loading/auth/Terminal remain unverified. Directory metadata does not freeze descendants/writers.

Directory identity includes device/inode/owner/birth time to catch immediate Linux inode reuse without freezing ordinary project edits. Unavailable birth time refuses new preview; unattempted legacy plans require preview. Existing query-first behavior stays, without OS CAS.

macOS explicit launch creates private .command/request to Terminal using CLAUDE_CONFIG_DIR; optional loopback sets uppercase/lowercase HTTP(S) proxies only for new context. Existing sessions/NO_PROXY remain. launch_requested means request delivery, not observed Claude/network effects.

lintel launch <environment-id> execs only with stdin/stdout TTY and one ID, no hidden-pipe interactive agents/prompt arguments. TUI o shares launch and returns after Claude exit. export_support allowlists platform/version/count/capability, omitting directories/names/config/tokens/sessions/hosts and never uploads.

Verification commands cargo test -p lintel-core, python3 tests/cli_journey.py, python3 tests/policy_journey.py, python3 tests/work_preservation_journey.py, python3 tests/portable_work_journey.py and the new python3 tests/client_control_journey.py (explicit selection journey-client-control) mutate only new synthetic roots. Coverage: invalid/stale/legacy rules, links/restore conflicts/repeats/interruption/concurrent queries/encryption; archive-only/no root, output-parent/no overwrite, independent homes/packages/import, stale/passphrase/corruption, preserve complete/reset partial, ordered reset, unsafe logout refusal before side effects, exact-edit conflicts retaining work/structured errors across Engine, secret-free plan_show. CLI uses actual process settings round trips; policy covers static identities/Remote Control/27-field inspect states/custom actions and explicit values/no-op/frozen receipts/restoration/outside edits; portable covers independent-process transfer/inventory/path import/accepted error persistence. The client-control journey uses fresh CLI processes to cover residue inventory/masked identity/sanitized snapshots/fresh comparison, refusal of malformed or unpaired requests, one damaged record not hiding readable neighbors, raw values never entering ordinary output, and observations that neither run the client nor create mutation jobs; core unit regressions add the private config backup/restore/replay path, cross-environment apply excluding private material, per-file recheck of residue clear and identity reset, and lintel.residue/1 read/restore plus occupied-target refusal. Version executables are inert, never Claude.

Independent packages/import files publish via same-parent synced temp/system atomic no-replace rename, avoiding double-link cleanup windows, then readback. Import checks all actual ancestors before preview/body write: no links/nondirectories; existing target-root directories owned by executor, traversable/writable nearest parent. path_unreadable/wrong_owner/migration_destination_unwritable refuse before all body writes, without permission changes. Only new parents 0700, existing root/parent modes retained, files 0600. macOS renameatx_np(RENAME_EXCL), Linux renameat2(RENAME_NOREPLACE); unsupported returns atomic_publication_unsupported, retaining data/job without hardlink/overwrite fallback. Settings restoration retains snapshot/recheck without external-editor CAS.

Accepted error also carries available step_id/uncertain_side_effects. New-root path/ID/executing step persists before mkdir; failed registration/interruption remains locatable, intent not success. Batch import persists executing step first; failures retain root/published files/create-migrate uncertainty, preserving work archives separately from state backups already held by historical jobs. New authentication plans create no state backup.

Before archive publish persist executing archive step/archive_path/archive_intent_digest for exact cipher; only successful readback sets completed/archive_digest. Interrupted paths are not completion: query/check artifacts; existing packages can unlock by job, absent yields read error. Reads prefer completed digest then intent, legacy neither remains compatible. Historical mixed-state receipts may contain state_archive_path/executing intent from before publication, with completion only after readback. The field remains for historical queries, not as a new-plan step; its path records the original target. Query/check the original artifacts without automatic resend, overwrite or import.

Approved migration tests the whole path set with empty files in private target-filesystem staging before content: new-root environments parent for preserve/reset, approved root for import. Normal cleanup removes only own empty files/directories, never recursive extra contents. Case/Unicode-equivalent collisions return migration_path_conflict before root/body creation. Packages remain readable; reorganize/rearchive or choose a distinguishing filesystem. Preview writes nothing; test runs only approved execute.

Before creating probe directory persist migration_probe path/status and migration_preflight executing step. Confirmed cleanup status removed; uncertain cleanup retained stops bodies. Interrupted executing retains original path; query neither deletes nor reruns, App exposes pending directory. Only original empty-file scope is owned; extras retained, never called a new environment.

Atomic publication references: Linux rename, Apple rename. New-root plans freeze full destinations before approval; unaccepted old plans lacking them stale_plan, accepted history query-only without recreating. Legacy portable imports omitting activation retain root CLAUDE.md destinations; old protocols/packages are unchanged.

Residue producers and the production reader share admission of 8 MiB per file, 32 MiB total and 2,000 entries. Identity packages include client_state (at most 2 MiB) in both total and entry count. Finite encoded/cipher budgets derive from raw and metadata bounds; the JSON byte-array encoding and lintel.residue/1 remain compatible. Preview rejects control characters in paths while preserving Unicode and spaces. Before any removal, the published package must pass the production reader's environment, path, byte-count and digest checks. Each quarantine persists quarantine_path and source_identity before rename, retaining held_path, stage and retention facts on failure. Uncertain parent sync remains failure; absent files alone do not establish completion.