Skip to content

Claude Code sessions from custom CLAUDE_CONFIG_DIR are not detected #38

@voyvodka

Description

@voyvodka

Problem

Claude Code supports custom config directories via the CLAUDE_CONFIG_DIR environment variable. This is commonly used to maintain separate profiles:

# default
claude                                       # uses ~/.claude/

# custom profiles
CLAUDE_CONFIG_DIR=~/.claude-personal claude  # uses ~/.claude-personal/
CLAUDE_CONFIG_DIR=~/.claude-work claude      # uses ~/.claude-work/
CLAUDE_CONFIG_DIR=/opt/my-config claude      # any arbitrary

Each profile stores its sessions independently under its own projects/ directory. Currently editors/claude.js only scans ~/.claude/projects/, so all sessions from custom profiles are completely missed.

The config directory can be any arbitrary path — not necessarily under ~/ or following a .claude-* naming convention — so a glob-based auto-detection alone wouldn't cover all cases.

In my case, only 135 out of 606 sessions (22%) are being detected — the remaining 471 sessions across two additional profiles are invisible to Agentlytics.

Expected behavior

Sessions from all Claude Code config directories should be discovered and included in analytics.

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