For an established project after dependency or service changes.
Install and check your version Browse the documentation
1. Check the configuration being compared
Run this workflow from the intended project directory with its .stack.toml available. Reconciliation compares configured service keys against provider names found by the local scanner. If configuration cannot be read, the source implementation uses an empty configured set; confirm the file is present and readable before interpreting the report.
Review your installed CLI help before using the source flags shown here. The scan uses supported manifests, configuration files and .env.example, so a missing detection is a prompt to investigate rather than proof that a service is unused.
stack doctor --help Sources: runReconcile and configuration fallback Detection evidence and limits
2. Generate the reconciliation report
The reconciliation branch reads configuration and local detection evidence without changing the service configuration. In JSON mode it returns after reconciliation rather than proceeding to provider health checks.
Inspect the configured, detected, orphans and untracked arrays in the reconciliation report. Orphans are configured names absent from detection; untracked entries are detected names absent from configuration. Custom service keys can differ from provider names, so check that mapping when reviewing a mismatch.
stack doctor --reconcile --json 3. Separate drift from provider health
The JSON reconciliation path returns normally even when it reports drift. Automation must inspect the report rather than interpreting a zero exit status as no differences.
A matching local inventory does not establish that remote services are healthy. The regular doctor path performs separate configured-service checks and requires the Phantom setup. Use the CLI reference to select the check you actually need.
Sources: JSON completion and health-check branches Doctor command reference
4. Review cleanup as a separate action
The source removal command's --allOrphans mode rescans current evidence, removes orphaned local configuration and MCP entries, and attempts Phantom secret cleanup. It does not consume a saved reconciliation report or delete upstream provider resources.
Inspect the service mapping and current evidence before running removal. Secret cleanup can require terminal confirmation or leave stored secrets behind; read the reported result. Local cleanup does not close provider accounts or stop their billing.
Sources: Local removal and upstream-resource boundary Maintenance guide and cleanup limits