Skip to content

Claude Code watcher hardcodes ~/.claude/projects/ — doesn't see sessions under $CLAUDE_CONFIG_DIR (e.g. ~/.claude-personal/) #44

Description

@pablosed

Summary

The Claude Code watcher always reads from ~/.claude/projects/. Users who run multiple Claude Code accounts via the $CLAUDE_CONFIG_DIR environment variable (e.g. a separate ~/.claude-personal/ config dir for a personal subscription, distinct from ~/.claude/ for work) end up with transcripts in ~/.claude-personal/projects/ that opensessions never sees.

Result: only one of the configured accounts shows up in the sidebar. For users in the multi-account pattern this is half the value of the integration.

Where it lives

packages/runtime/src/agents/watchers/claude-code.ts:263:

this.projectsDir = join(homedir(), ".claude", "projects");

Comments at line 4 and line 8 reinforce the assumption:

* Watches ~/.claude/projects/ for JSONL file changes,
* Directory structure: ~/.claude/projects/<encoded-path>/<session-id>.jsonl

Suggested fix

Detect all Claude Code config dirs and watch each one's projects/ subdir. Two reasonable signals:

  1. $CLAUDE_CONFIG_DIR env var — Claude Code's officially documented override. If set, watch $CLAUDE_CONFIG_DIR/projects/ in addition to (or instead of) the default.
  2. Convention scan — glob ~/.claude*/projects/ to pick up any sibling config dirs the user has. Cheap, no env-var dependency, works even when opensessions is launched in a shell that doesn't have CLAUDE_CONFIG_DIR exported.

Either approach should compose with the existing single-dir behaviour so the change is backwards-compatible. The ClaudeCodeWatcher would then maintain a set of projects dirs rather than a single one, and the per-dir watch + decoding logic stays as-is.

If multiple accounts could overlap on the same encoded-path (same project run from both accounts), surfacing the config-dir as part of the session identity in the UI (or as a per-session tag/colour) would help disambiguate. Lower-priority than the basic detection fix.

Context

Common pattern in the wild: claude (default config dir, work account) and claude-personal (separate config dir for personal account). CLAUDE_CONFIG_DIR is set per-invocation via shell aliases. Both write transcripts into their respective <config-dir>/projects/<encoded-path>/<session-id>.jsonl.

Happy to PR if a maintainer can confirm which approach (env-var vs glob vs both) you'd prefer.

Environment

  • opensessions installed via TPM (latest as of 2026-05-19)
  • macOS, tmux 3.6a
  • bun 1.3.12
  • Two Claude Code config dirs in active use: ~/.claude/ and ~/.claude-personal/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions