Troubleshooting

Atlas edit error: File not found, or Path is a directory, not a file

Updated 7 min read

Atlas fails with File <path> not found, or with Path is a directory, not a file: <path>, because after resolving the path against the instance directory and clearing the external-directory check, the edit tool stats the target: a missing stat produces the not-found error, and a Directory type is rejected outright. The fix is to confirm the path with the glob or read tool before editing. Remember that relative paths resolve against the instance directory, not your shell cwd, so pass an absolute path if you are unsure which root the path is being built from. If you meant to create the file, call edit with an empty oldString or use write. If you meant to edit a file inside a directory, include the filename.

Why does Atlas say the edit target file was not found

Atlas raises File <path> not found because the edit tool stats the target after resolving the path against the instance directory and clearing the external-directory check, and a missing stat is a not-found error. 0 files exist at the resolved path, which is not always the path you typed.

The order of operations matters for diagnosis. Atlas first resolves your path against the instance directory, then runs the external-directory containment check, and only then stats the target. So by the time you see a not-found error, the path has already been transformed into an absolute location and Atlas looked there and found nothing. The gap between the path you supplied and the path Atlas resolved is where the bug usually lives. Confirming the real path with the glob or read tool takes one call and replaces guessing with a fact. Atlas indexes code by AST declarations using tree-sitter, so glob is quick at locating the file you actually meant.

Why does Atlas say the path is a directory, not a file

Atlas raises Path is a directory, not a file: <path> because the edit tool stats the target and rejects a Directory type outright. Atlas edits files, not folders, so the fix is 1 step: append the filename you actually meant to change to the directory path that resolved.

The directory error is more specific than the not-found error and therefore more useful, because it tells you the path resolved to something real. Common shapes: a trailing path segment that names a package rather than a module, a path built by joining a directory with a filename where the filename ended up empty, or an agent that inferred a folder from an import path and stopped there. The remedy is always the same. Append the filename, or use glob to list what is actually inside that directory and pick the right file. There is no flag that makes edit operate on a directory.

Why relative paths resolve against the Atlas instance directory

Relative paths in Atlas resolve against the instance directory, not your shell cwd. That single fact explains a large share of File not found errors, because 1 path can resolve to 2 different places, one when you type it in your terminal and another when the Atlas edit tool builds it from the instance root. Pass an absolute path if unsure.

Do not assume the two roots agree. If a relative path is producing a not-found error that surprises you, pass an absolute path instead and the ambiguity disappears completely. Path resolution against the instance directory is also what feeds the external-directory containment check, which uses containsPath against the instance context, so the same root governs whether a path counts as inside or outside your workspace. When a path resolves somewhere unexpected and lands outside the instance context, you will see an external_directory permission prompt rather than a not-found error, which is itself a useful signal about where the path actually went.

How to create a file in Atlas when the target does not exist

To create a file in Atlas rather than edit one, you have 2 options: call edit with an empty oldString, which is how the edit tool creates a new file, or call the write tool. A File not found error simply means nothing exists at the resolved path yet, and creating the file is a supported, explicit action.

Deciding between creation and correction is the real question when a not-found error appears. If the file genuinely should not exist yet, because you are scaffolding a new module, then creation is the intent and an empty oldString expresses it directly. If the file should exist and does not, the path is wrong and creating a new file at the wrong path only compounds the mistake, leaving you with an orphan file and the original problem intact. Confirm with glob before you decide. One glob call is much cheaper than tracking down a stray file three steps later.

How to verify the Atlas edit path is correct

Verify by calling the Atlas read tool on the path before editing. A successful read proves the path resolves to 1 real file, which is exactly the condition the edit tool's stat is checking. Then re-run edit, and Atlas computes a unified diff for the file edit and surfaces it for approval before writing.

Reading first turns a guess into a fact, and it costs one call. If the read succeeds and edit still reports File not found, compare the exact string you passed to each tool, because a difference in the path is the only way the two can disagree once resolution is identical. If the read itself reports the path as a directory, use glob to list what is inside and select the actual file. Confirm the path before you edit rather than after: Atlas snapshots file changes as git patches, so a wrong edit can be rolled back, but a wrong file created at a wrong path is easier to avoid than to clean up.

How to fix it

  1. 01Confirm the path with the glob or read tool before editing, so you are working from what exists rather than what you assume exists.
  2. 02Remember that relative paths resolve against the instance directory, not your shell cwd. Pass an absolute path if you are unsure.
  3. 03To create a file, call edit with an empty oldString, or use the write tool.
  4. 04If you meant to edit a file inside a directory, include the filename. A bare directory path is rejected outright.
  5. 05Re-run edit against the confirmed path and check that Atlas surfaces a unified diff for approval.

Frequently asked questions

why does Atlas say file not found when editing
The Atlas edit tool stats the target after resolving the path against the instance directory and clearing the external-directory check. A missing stat is a not-found error, meaning nothing exists at the resolved path, which may differ from the path you typed.
what does path is a directory not a file mean in Atlas
The path you supplied resolved to a real directory, and the Atlas edit tool rejects a Directory type outright. Include the filename you actually meant to edit, or use glob to list what is inside that directory.
why does my relative path not work in Atlas edit
Relative paths in Atlas resolve against the instance directory, not your shell cwd, so a path that works in your terminal can resolve somewhere else entirely. Pass an absolute path if you are unsure which root is being used.
how do I create a new file in Atlas when edit says not found
Call edit with an empty oldString, which is how the edit tool creates a new file, or use the write tool. Confirm the path with glob first, because creating a file at a wrong path compounds the original mistake.
how do I check a path before editing in Atlas
Use the glob or read tool. A successful read proves the path resolves to a real file, which is the same condition the edit tool's stat check is testing, and one call replaces a guess with a fact.
can Atlas edit a directory
No. After stating the target, Atlas rejects a Directory type outright with Path is a directory, not a file. There is no flag that makes edit operate on a folder, so include the filename.
does Atlas check permissions before the file-not-found error
Yes. Atlas resolves the path against the instance directory, then clears the external-directory check, and only then stats the target. A path that resolved outside the workspace produces an external_directory permission prompt instead of a not-found error.

Try Atlas in your terminal

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

Install Atlas

Related guides

Atlas with DeepSeek V3.1 (open weights): Togglable Thinking in 2026

Run Atlas on DeepSeek V3.1 (open weights) in 2026. One MIT-licensed checkpoint with thinking and non-thinking modes, $0.25 per Mtok in and $0.95 per Mtok out.

Atlas with DeepSeek V3 (open weights): The Frozen 671B Baseline in 2026

Run Atlas on DeepSeek V3 (open weights) in 2026. DeepInfra hosts the MIT-licensed 671B MoE at $0.32 per Mtok input, $0.89 per Mtok output, 128K context.

Atlas with Phi-3 Medium 14B (Ollama): 128K Context at 7.9GB in 2026

Phi-3 Medium 14B (Ollama) gives Atlas a 128K tokens (131,072) window from a 7.9GB download, Free (self-hosted). Pull phi3:14b, not :medium-4k. Setup and tradeoffs.

Atlas with DeepCoder 14B (Ollama): RL-Tuned for First-Attempt Diffs in 2026

DeepCoder 14B (Ollama) is a 9.0GB RL-tuned coder with a 128K context, built for first-attempt correctness. Free (self-hosted). Atlas setup and tradeoffs for 2026.

Atlas with Qwen Max: Setup, Cost, and the 32,768 Token Limit in 2026

Run Atlas on Qwen Max in 2026. Alibaba's original flagship costs $1.60 per Mtok input, $6.40 per Mtok output, with a 32K tokens (32,768) context window.

Atlas with Gemma 4 12B (Ollama): 256K Context from a 7.6GB Download in 2026

Gemma 4 12B (Ollama) is a 7.6GB download with a 256K tokens (262,144) context, Free (self-hosted). The longest Gemma window that fits a mid-range GPU. Atlas setup.

Atlas with Llama 3.1 405B: The 243GB Landmark in 2026

Llama 3.1 405B in Atlas for 2026: 405 billion openly released parameters, a 128,000 token window, Free (self-hosted), and a 243GB download that decides everything.

Atlas vs GitHub Copilot: Terminal AI Coding Agents in 2026

Comparing Atlas, the terminal-native AI coding agent, with GitHub Copilot's editor extension and chat features for developers in 2026. Explore planning, pricing, and privacy.

Browse this resource hub