plandex-ai/plandex · error

path %s is not in the project

Error message

path %s is not in the project

What it means

IsIgnored treats a path that is neither an active path nor inside any git-ignored directory as not belonging to the project, and errors with this message. It is a guard against loading context files that were never registered by path resolution.

Source

Thrown at app/cli/fs/paths.go:463

	return true, nil
}

func IsIgnored(paths *types.ProjectPaths, path, baseDir string) (bool, string, error) {
	if !paths.AllPaths[path] {
		// if the path isn't in AllPaths, it either:
		// 1. doesn't exist (in which case we shouldn't be calling this function)
		// 2. is a subpath of a git ignored dir

		for dir := range paths.GitIgnoredDirs {
			subpath, err := IsSubpathOf(dir, path, baseDir)
			if err != nil {
				return false, "", fmt.Errorf("error checking if %s is a subpath of %s: %s", path, dir, err)
			}
			if subpath {
				return true, "git", nil
			}
		}
		return false, "", fmt.Errorf("path %s is not in the project", path)
	}

	if paths.ActivePaths[path] {
		return false, "", nil
	}

	if paths.PlandexIgnored != nil && paths.PlandexIgnored.MatchesPath(path) {
		return true, "plandex", nil
	}

	return true, "git", nil
}

var skipDirs = map[string]bool{
	".git":              true,
	"node_modules":      true,
	"venv":              true,
	".cache":            true,

View on GitHub (pinned to e2d772072e)

Solutions

  1. Use a path relative to the project root that exists under it
  2. Run the path through ParseInputPaths so it gets registered in ActivePaths before IsIgnored
  3. cd to the project root before invoking the command
  4. Check the path spelling/existence (ls the file)

Example fix

// before
plandex load /tmp/notes.txt
// after
cd /path/to/project
plandex load ./notes.txt
Defensive patterns

Strategy: validation

Validate before calling

rel, err := filepath.Rel(projectRoot, absPath)
if err != nil || strings.HasPrefix(rel, "..") {
    return fmt.Errorf("%s is outside the project root", path)
}
if _, err := os.Stat(absPath); err != nil {
    return fmt.Errorf("%s does not exist: %w", path, err)
}

Try / catch

ok, _, err := IsIgnored(path, paths, baseDir)
if err != nil && strings.Contains(err.Error(), "is not in the project") {
    return fmt.Errorf("re-run path resolution for %s before loading", path)
}

Prevention

When it happens

Trigger: Calling MustLoadContext (or the anonymous caller) with a path that does not appear in paths.ActivePaths and is not a subpath of any GitIgnoredDirs entry — i.e. the path was never resolved in this project tree.

Common situations: Passing absolute paths outside the project root; referencing a file after moving it; loading paths from a different Plandex project or a stale current directory.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/b643681acc91f685. Report an issue: GitHub.