Stacks

Diagnose a Hanging or Long-Running Elixir Command with Atlas (2026)

Updated 8 min read

When an Elixir command hangs, Atlas tells you which of two things is happening: the command is genuinely slow, or it is silently blocked waiting on interactive input. Atlas's bash tool races every command against a timeout, and when the timeout expires it reports exactly what happened and what to do, saying to retry with a larger timeout if the command is expected to take longer and is not waiting for interactive input. That second clause is the diagnosis. A mix deps.get stuck on a Hex prompt or an ExUnit via mix test run blocked on stdin will never finish by waiting, no matter how large you make the timeout.

Why does my mix command hang forever under an AI agent?

An Elixir mix command hangs under an agent for one of two reasons: it is genuinely slow, or it is blocked waiting for input that will never arrive. Atlas's bash tool races every command against a timeout, and in 2026 the resulting message names which case you are in.

Compiling a large umbrella app or running a full ExUnit via mix test suite can legitimately take minutes. Fetching a fresh dependency tree with Mix and Hex can too. But a mix command that is waiting on stdin, for example a Hex prompt asking whether to install a missing archive, is not slow at all. It is stopped, and it will stay stopped forever. Distinguishing those two cases is the entire diagnosis, and Atlas surfaces the distinction rather than leaving you to infer it from silence.

What does the shell_metadata block tell an Elixir developer?

Read the shell_metadata block in the bash tool's output when a command is killed. For an Elixir developer in 2026 that block is the primary evidence: it carries the exit code, and it distinguishes a timeout kill from your own interrupt of a long mix compile.

The shell_metadata block is where the truth lives. When a mix test run is killed by the timeout, the metadata says so and the accompanying message tells you to retry with a larger timeout if the command is expected to take longer and is not waiting for interactive input. When you aborted it yourself, the metadata says User aborted the command, which distinguishes your interrupt from a timeout. Those are different failures with different fixes, and conflating them is how Elixir developers waste an afternoon raising a timeout on a command that was never going to finish.

How do I tell if a mix command is slow or blocked on input?

Decide from the message: Atlas explicitly calls out the interactive-input case. If your Elixir command could plausibly prompt, for example mix deps.get pulling a new Hex package or a mix task asking to overwrite a file, treat it as blocked first, because in 2026 a blocked command never resolves by waiting.

The heuristic is about the command, not the clock. Ask whether the mix task has any reason to prompt. Fetching from Hex can ask to install a missing rebar or an archive. An interactive mix task can ask for confirmation before overwriting lib/my_app/application.ex. A generator can ask before writing into a supervision tree. Any of those will sit at a prompt forever inside a non-interactive shell. Compilation of a large OTP application, by contrast, has nothing to ask, so a hang there is almost always genuine slowness.

How do I fix an Elixir command blocked on interactive input?

If the Elixir command is blocked, re-run it with the tool's non-interactive flags, and 3 common ones are -y, --no-input, and CI mode, so it cannot prompt. A mix task that cannot ask a question cannot hang on one, and Atlas re-issues the corrected command through the bash tool immediately.

The fix is to remove the prompt, not to wait longer. Mix and Hex tasks accept flags that force the non-interactive path, and CI mode is the general form of the same idea: run as if no human is present. Atlas re-runs the command with those flags through the bash tool and reads the shell_metadata block again. If the command now completes with a zero exit code, the diagnosis was correct. If it now runs long but does finish, the hang was a prompt all along.

How do I fix an Elixir command that is genuinely slow?

If the command is genuinely slow, retry with a larger timeout value in milliseconds, as the message instructs. A full ExUnit via mix test suite on an OTP application, or a cold compile of an umbrella project, legitimately exceeds a short default in 2026 and simply needs more room.

A larger timeout is the correct response to genuine slowness and the wrong response to a prompt. Atlas passes the new timeout in milliseconds on the bash call and re-runs, for example a mix test run across every app in the umbrella. If the suite is chronically slow, narrow it first: run ExUnit via mix test against a single test file under test/ rather than the whole project, which is faster and produces output small enough to reason about. Atlas reads the exit code from the metadata either way.

How does Atlas keep a hanging Elixir command from becoming dangerous?

Every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs, so a mix task that could rewrite your supervision tree can be set to ask. In 2026 that means a hanging mix command is a diagnostic problem, not a safety problem, in an Elixir codebase.

Permissions run before the shell does. You can allow mix compile and ExUnit via mix test, ask on mix deps.get, and deny anything that would publish to Hex. When Atlas does change Elixir source, it computes a unified diff for every file edit and surfaces it for approval before writing, and it snapshots file changes as git patches so an edit to lib/my_app/application.ex can be diffed and rolled back. Run mix format afterwards so the diff carries the change rather than whitespace.

Step by step

  1. 01Run atlas in your Elixir project, the one with a mix.exs, and let Atlas read your supervision tree, contexts, and deps.
  2. 02Run the mix command through the bash tool and read the shell_metadata block in the output when it is killed.
  3. 03Decide from the message whether the command is slow or blocked: Atlas explicitly calls out the interactive-input case.
  4. 04If it is blocked, re-run with the tool's non-interactive flags (-y, --no-input, CI mode) so the Mix or Hex task cannot prompt.
  5. 05If it is genuinely slow, for example a full ExUnit via mix test run on an umbrella app, retry with a larger timeout value in milliseconds as the message instructs.
  6. 06If you aborted it yourself, note that the metadata says User aborted the command, which distinguishes your interrupt from a timeout.
  7. 07Narrow a chronically slow suite by running ExUnit via mix test against a single file under test/ instead of the whole project.
  8. 08Review any unified diff Atlas surfaces before it writes to a .ex file, then run mix format.

Frequently asked questions

mix deps.get hangs when run by an ai coding agent
A hanging mix deps.get is usually blocked on a Hex prompt, not slow. Atlas's bash tool calls out the interactive-input case explicitly. Re-run with the non-interactive flags (-y, --no-input, CI mode) so the Mix and Hex task cannot prompt.
how do i tell if my elixir command is slow or stuck
Read the shell_metadata block in the bash tool's output. Atlas explicitly distinguishes the interactive-input case from genuine slowness. If the mix task has any reason to prompt, treat it as blocked, because waiting will never resolve it.
atlas timed out running mix test how do i increase the timeout
Retry with a larger timeout value in milliseconds, as the message instructs. A full ExUnit via mix test run on an umbrella application legitimately takes longer than a short default. Narrow to a single test file first if the suite is chronically slow.
what does User aborted the command mean in atlas
It means you interrupted the command yourself rather than the timeout killing it. The shell_metadata block reports User aborted the command, which distinguishes your interrupt from a timeout so you do not mistakenly raise the timeout on a mix task you stopped.
can atlas run mix commands in an elixir umbrella project
Yes. Atlas runs mix commands through the bash tool, which is a real shell. Run atlas in a project with a mix.exs, let it read your supervision tree, contexts, and deps, and it can compile, run ExUnit via mix test, and run mix format.
how do i stop atlas from running a dangerous mix task
Every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs. Allow mix compile and mix test, ask on mix deps.get, and deny anything that publishes to Hex or mutates state you care about.
why does a larger timeout not fix my hanging elixir build
Because the build is probably not slow. A Mix or Hex task blocked waiting on stdin is stopped, not running, and no timeout will ever be large enough. Re-run it with non-interactive flags so it cannot prompt in the first place.

Try Atlas in your terminal

The terminal-native AI coding agent. Free core, single binary.

Install Atlas

Related guides

Diagnose a Hanging or Long-Running Command with Atlas in 2026

How to diagnose a hanging command with Atlas in 2026: the bash tool races every command against a timeout and tells you whether it is slow or blocked on input.

Atlas for Elixir in 2026

Adopt Atlas, the terminal-native AI coding agent, for Elixir development in 2026. Enhance productivity with deep code understanding, safety features, and direct integration into mix projects and OTP applications.

Plan a Multi-File Elixir Change Before Editing with Atlas (2026)

Plan a multi-file Elixir change before editing with Atlas in 2026. Plan mode denies all edit tools, so you research contexts and GenServers and design the change first.

Document an Elixir Module with a README in 2026 using Atlas

Generate accurate, up-to-date README documentation for your Elixir modules with Atlas. Leverage Mix, Hex, and ExUnit for verified, traceable docs.

Audit an Elixir Repo with Parallel Subagents in 2026 using Atlas

Sweep your Elixir repository for specific problems without blowing your context window. Atlas uses parallel subagents, ExUnit, Mix, and Hex to audit large Elixir codebases efficiently.

Review a Pull Request in Elixir with Atlas in 2026

Streamline your Elixir pull request reviews in 2026 with Atlas. Leverage AI to fetch diffs, analyze full files, check mix.exs dependencies, and run ExUnit via mix test for comprehensive bug detection.

Refactor a legacy module in Elixir with Atlas in 2026

Refactor Elixir modules safely in 2026 with Atlas, the terminal-native AI coding agent. Pin behavior with ExUnit via mix test, map callsites with LSP, and apply changes with atomic patches.

Run the Test Suite and Triage the Failures in Elixir with Atlas (2026)

Triage a red ExUnit suite in Elixir with Atlas in 2026. Run mix test through bash, read the retained log past the 2000-line truncation, and group causes with grep.

Browse this resource hub