mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-26 05:27:06 +00:00
Claude Code moves the session transcript to the new cwd's project dir when the session enters or leaves a git worktree. The local-mode scanner pinned the launch project dir, so nothing reached the web until the session left the worktree. Look the transcript up by session id across project dirs when the known path is gone. Fixes #1950 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
12 lines
405 B
TypeScript
12 lines
405 B
TypeScript
import { homedir } from "node:os";
|
|
import { join, resolve } from "node:path";
|
|
|
|
export function getClaudeProjectsDir() {
|
|
return join(process.env.CLAUDE_CONFIG_DIR || join(homedir(), '.claude'), 'projects');
|
|
}
|
|
|
|
export function getProjectPath(workingDirectory: string) {
|
|
const projectId = resolve(workingDirectory).replace(/[^a-zA-Z0-9]/g, '-');
|
|
return join(getClaudeProjectsDir(), projectId);
|
|
}
|