Skip to content

Environment Variables Reference

Phantom reads its runtime configuration from environment variables. These cover paths and limits, analysis thresholds, FFT/frame sizes, and behavior flags. phantom doctor prints the complete list with the value each has in your environment (or that it is unset).

Settings resolve per call within the running process. If you edit an assistant’s MCP environment configuration, restart its Phantom server to load that environment. The analysis cache keys on your settings, so a tuned run is never served a result computed under different settings.

Paths and Limits

Variable Default Description
PHANTOM_AUDIO_DIR (none) Restrict input file reads to this directory tree. When unset, inputs may be read from anywhere (Phantom’s core use case); writes are always confined regardless.
PHANTOM_OUTPUT_DIR ~/.phantom/output Directory all file writes are confined to. Writes outside it are rejected. Created on demand when unset; set this to write elsewhere.
PHANTOM_PROFILES_DIR (built-ins) Custom reference profile directory (overrides built-ins).
PHANTOM_METRICS_DIR (platform default) Directory for live metrics snapshots: ~/Library/PhantomStudio/metrics (macOS), %APPDATA%\PhantomStudio\metrics (Windows), ~/.config/PhantomStudio/metrics (Linux).
PHANTOM_MAX_DURATION 900 (15 min) Maximum audio duration in seconds
PHANTOM_MAX_FILE_SIZE 500000000 (500 MB) Maximum file size in bytes
PHANTOM_MAX_DECODED_BYTES 1000000000 (1 GB) Maximum decoded float32 footprint per audio file in bytes
PHANTOM_MAX_AGGREGATE_BYTES 4000000000 (4 GB) Combined decoded-size cap for multi-file tools

The Windows metrics-directory convention does not mean the Phantom package supports Windows. Live JSON snapshots are limited to 1,000,000 bytes in 1.6.0; this limit is separate from audio-file limits.

Analysis Thresholds

Variable Default Description
PHANTOM_POLARITY_THRESHOLD -0.5 Overall L/R correlation below this flags polarity inversion
PHANTOM_PHAT_WINDOW_S 10.0 GCC-PHAT cross-correlation window in seconds
PHANTOM_CREST_FACTOR_LOW_DB 6.0 Crest factor below this marks the track as over-compressed
PHANTOM_CLIPPING_THRESHOLD 1.0 Per-channel magnitude at or above this counts as clipping; the default also checks integer PCM full-scale rails
PHANTOM_DC_OFFSET_THRESHOLD 0.0005 Mean sample value above this flags DC offset
PHANTOM_ISP_OVERSHOOT_DB 0.5 True-peak overshoot above this flags inter-sample peaks
PHANTOM_ISP_SEVERE_DBTP -1.0 True peak above this raises ISP severity to significant
PHANTOM_DYNAMIC_SPREAD_MIN_DB 10.0 Minimum P90-P10 block spread to trust a noise-floor estimate
PHANTOM_NOISE_FLOOR_MODERATE_DB -50.0 Noise floor above this is flagged moderate
PHANTOM_NOISE_FLOOR_MINOR_DB -60.0 Noise floor above this is flagged minor
PHANTOM_SNR_PROFESSIONAL_DB 60.0 SNR at or above this counts as professional
PHANTOM_SNR_POOR_DB 50.0 SNR below this is flagged poor/significant
PHANTOM_SPECTRAL_FLATNESS_MIN 0.01 Minimum flatness to run band-excess detectors
PHANTOM_BAND_EXCESS_THRESHOLD_DB 6.0 Band energy above expected level triggers detection
PHANTOM_RESONANCE_MEDIAN_FLOOR_DB -40.0 Median spectral level floor for resonance detection
PHANTOM_RESONANCE_PROMINENCE_DB 12 Peak prominence threshold for resonance detection
PHANTOM_LOSSY_SHELF_DROP_DB 20.0 Shelf drop above this indicates a lossy codec
PHANTOM_MASKING_SEVERITY_HIGH 0.6 Overlap score at or above this is labeled high severity
PHANTOM_MASKING_SEVERITY_MODERATE 0.3 Overlap score at or above this is labeled moderate severity
PHANTOM_MASKING_SEVERITY_LOW 0.1 Overlap score at or above this is labeled low severity
PHANTOM_MASKING_FLOOR_DB 40.0 Bands more than this below the pair peak are zeroed before scoring

FFT / Frame Sizes

Variable Default Description
PHANTOM_SPECTRAL_FRAME_SIZE 2048 Frame size of the main spectral analysis pass
PHANTOM_SPECTRAL_HOP_SIZE 1024 Hop size of the main spectral analysis pass
PHANTOM_OCTAVE_FRAME_SIZE 4096 Frame size of the octave-band energy pass (spectral + masking)
PHANTOM_OCTAVE_HOP_SIZE 2048 Hop size of the octave-band energy pass
PHANTOM_FLATNESS_FRAME_SIZE 4096 Frame size of the spectral-flatness gate (band-excess detectors)
PHANTOM_SPECTRUM_FRAME_SIZE 8192 Frame size of the shared power-spectrum pass (resonance, lossy-codec detection)

Changing frame sizes changes the analysis geometry, so results are not numerically comparable with the built-in genre profiles or reference-target comparisons, both of which are calibrated to the default frame sizes. See AnalysisSettings for the full comparability caveat.

Output and Behavior

Variable Default Description
PHANTOM_MASKING_TOP_N (auto) Number of top masking pairs returned (scales with stem count when unset)
PHANTOM_PROFILE_MERGE (none) Merge a user profile over the built-in instead of replacing it
PHANTOM_PROFILE_OVERRIDE_QUIET (none) Silence the user-profile-override log line
PHANTOM_DEBUG (none) Enable verbose error output from MCP tools
PHANTOM_QUIET (none) Suppress startup preflight messages

Installer-only variables

PHANTOM_NO_TELEMETRY is not a runtime variable and doesn’t appear in phantom doctor. The installers (install.sh, install.ps1) honor it to opt out of install telemetry:

# macOS / Linux
curl -sSL https://fadelab.net/install | PHANTOM_NO_TELEMETRY=1 bash

The variable has to go on bash, not on curl. Writing PHANTOM_NO_TELEMETRY=1 curl ... | bash sets it for the download and not for the script that reads it, so telemetry still fires.

The Windows installer honors the same variable, but Phantom cannot be installed on Windows yet — see Getting Started for why and what’s being done about it.

Pro tip

The complete list above matches phantom doctor output exactly. If a variable isn’t listed here, the runtime doesn’t read it.

Optional analytics

With your permission, Vercel measures page views and loading performance, and PostHog measures page views and selected button clicks. We do not send search text or form details, record sessions, or link analytics to your email. Your choice lasts 180 days. You can withdraw anytime using Privacy choices in the footer. Forms work either way.

Privacy policy