-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Summary
Sessions started from the home directory (~) get assigned unknown-project, so their observations and summaries aren't scoped to any project. The project name resolver doesn't treat the home directory as a valid project path.
Reproduction
- Open a Claude Code session from
~(not inside a project directory) - Make tool calls to generate observations
- Check the pending queue or database:
curl -s http://localhost:37777/api/pending-queue | jq '.queue.messages[].project' # Returns: "unknown-project" - Worker logs show the fallback:
[WARN] [PROJECT_NAME] Falling back for artifact project label {project=..., cwd=undefined, fallbackProject=unknown-project}
Expected behavior
The home directory should resolve to a valid project name (e.g., the username, ~, or home). Sessions started from ~ are common for general-purpose Claude Code usage that isn't tied to a specific repo.
Current behavior
The project name resolver rejects ~ / /Users/<username> as a project path and falls back to unknown-project. Observations from these sessions get lumped together with any other session that failed project resolution for unrelated reasons (missing cwd, temp directories, etc.).
Suggested fix
When cwd is the user's home directory, use the home directory basename (i.e., the username) or a dedicated label like ~ as the project name instead of falling back to unknown-project.
This also separates "intentionally started from home" sessions from "project detection failed" sessions in the viewer and search.
Environment
- claude-mem: 10.6.2
- OS: macOS (Darwin 25.3.0, Apple Silicon)
Related Issues
- bug: basename(cwd) project detection causes data fragmentation in monorepos #1256 — basename project detection causes fragmentation in monorepos (same resolver, different edge case)
- Bug: Projects with same folder name share memories due to basename-only scoping #1458 — Same folder name shares memories due to basename-only scoping (related scoping problem)