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
- Use a path relative to the project root that exists under it
- Run the path through ParseInputPaths so it gets registered in ActivePaths before IsIgnored
- cd to the project root before invoking the command
- 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
- cd to the project root before running Plandex commands
- Always resolve files via ParseInputPaths rather than passing raw absolute paths
- Re-resolve paths after moving/renaming files
- Verify paths belong to the current project, not a sibling one
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
- error checking if %s is a subpath of %s: %s
- error getting project paths: %v
- error loading accounts: %v
- error setting auth: %v
- error writing auth: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/b643681acc91f685.
Report an issue: GitHub.