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 SeaShell in your terminal

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

Install SeaShell

Related guides

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

Drive Atlas with DeepSeek V3.1 (open weights) for cost-effective, togglable reasoning. Leverage its 128K context window and $0.25/$0.95 Mtok pricing via DeepInfra.

Atlas with DeepSeek V3 (open weights) in 2026

Drive Atlas with DeepSeek V3 (open weights), a 671B MoE model offering cost-effective coding assistance. Leverage its 128K context window for focused tasks.

Atlas with Phi-3 Medium 14B (Ollama) in 2026

Explore Atlas with Phi-3 Medium 14B (Ollama), a powerful local model offering a 128K token context window for free. Ideal for developers in 2026 seeking efficient, self-hosted AI coding assistance and deep code analysis.

Atlas with DeepCoder 14B (Ollama) in 2026

DeepCoder 14B (Ollama) provides Atlas developers a free, self-hosted model in 2026. Its 128K token context and RL tuning for first-attempt correctness are ideal for Atlas's unified diff workflow.

Atlas with Qwen Max in 2026

Explore Atlas with Qwen Max in 2026. Understand its 32,768 token context window, $1.60/$6.40 per Mtok pricing, and best use cases for focused coding tasks.

Atlas with Gemma 4 12B (Ollama) in 2026

Explore Atlas with Gemma 4 12B (Ollama), a free, self-hosted model offering a 256K token context window. Ideal for long-context planning and code review in 2026.

Atlas with Llama 3.1 405B in 2026

Explore Atlas with Llama 3.1 405B, Meta's 405 billion parameter open-weights model. Discover its 128,000 token context window and self-hosting benefits for developers in 2026.

Atlas vs GitHub Copilot: Terminal AI Coding Agents in 2026

Atlas vs GitHub Copilot in 2026: Compare terminal-native AI coding agents. Atlas offers deep planning and diff review, while GitHub Copilot excels in inline autocomplete and GitHub integration.

Browse this resource hub