Resolve Claude projects directory inside the lib (honor CLAUDE_CONFIG_DIR) #34
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/claude-code-query#34
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
DirectConversationLogIndexrequires callers to pass a fully-resolvedprojectDir: os.Path. That forces every consumer to reimplement two facts about Claude Code's on-disk layout:~/.claude/projects/, but honoringCLAUDE_CONFIG_DIRwhen set./home/mph/ops/kanon→-home-mph-ops-kanon.Neither concern is app logic; both are "how Claude Code stores sessions." The lib is the natural owner.
Real-world bite
In
kanon'stranscript-analyzecommand we hardcodedos.home / ".claude" / "projects". On a machine whereCLAUDE_CONFIG_DIR=~/.claude-iw(iw-cli's isolated config), session discovery fails with "No sessions found for this project" even thoughclaude --resumefinds them fine — because the actual sessions live under~/.claude-iw/projects/….Every consumer will hit this eventually, and each will fix it independently (or not).
Proposed API
Something like:
And convenience overloads on
DirectConversationLogIndexthat take acwddirectly:Existing path-based methods stay for callers that already know the project dir.
Acceptance
CLAUDE_CONFIG_DIRis honored when resolving the base projects dir/→-, leading-) lives in the lib with testsDirectConversationLogIndexhas a cwd-based entry point so consumers don't touch pathsContext
Downstream bug report and discussion:
kanontranscript-analyze on PROC-272. Stopgap in kanon will addCLAUDE_CONFIG_DIRhandling locally until this lands.