Skip to content

Home directory sessions get assigned unknown-project instead of a valid project name #1478

@loganprit

Description

@loganprit

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

  1. Open a Claude Code session from ~ (not inside a project directory)
  2. Make tool calls to generate observations
  3. Check the pending queue or database:
    curl -s http://localhost:37777/api/pending-queue | jq '.queue.messages[].project'
    # Returns: "unknown-project"
    
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions