refactor: Remove hardcoded paths for project and Claude Code executable in various scripts, fixes issue #23

This commit is contained in:
Alex Newman
2025-10-25 13:28:20 -04:00
parent e18f02e2af
commit 9f3bf55c76
5 changed files with 5 additions and 12 deletions
-1
View File
@@ -1098,7 +1098,6 @@ Skip routine operations:
|----------|---------|---------|----------------|
| `CLAUDE_MEM_MODEL` | `claude-sonnet-4-5` | AI model for processing | Invalid = SDK fails |
| `CLAUDE_MEM_WORKER_PORT` | `37777` | HTTP server port | Invalid = Worker won't start |
| `CLAUDE_CODE_PATH` | `/Users/alexnewman/.nvm/versions/node/v24.5.0/bin/claude` | Path to Claude Code | Invalid = SDK fails |
### Constants
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -61,7 +61,7 @@ function buildTimestampMap(): TimestampMapping {
const data = JSON.parse(line);
const timestamp = data.timestamp;
const sessionId = data.sessionId;
const project = data.cwd || '/Users/alexnewman/Scripts/claude-mem';
const project = data.cwd;
if (timestamp && sessionId) {
// Round timestamp to second for matching with XML timestamps
+1 -4
View File
@@ -283,16 +283,13 @@ class SDKWorker {
*/
private async runSDKAgent(): Promise<void> {
// Find Claude Code executable
const claudePath = process.env.CLAUDE_CODE_PATH || '/Users/alexnewman/.nvm/versions/node/v24.5.0/bin/claude';
console.error(`[SDK Worker DEBUG] About to call query with claudePath: ${claudePath}`);
const queryResult = query({
prompt: this.createMessageGenerator(),
options: {
model: MODEL,
disallowedTools: DISALLOWED_TOOLS,
abortController: this.abortController,
pathToClaudeCodeExecutable: claudePath
abortController: this.abortController
}
});
+1 -4
View File
@@ -345,16 +345,13 @@ class WorkerService {
private async runSDKAgent(session: ActiveSession): Promise<void> {
logger.info('SDK', 'Agent starting', { sessionId: session.sessionDbId });
const claudePath = process.env.CLAUDE_CODE_PATH || '/Users/alexnewman/.nvm/versions/node/v24.5.0/bin/claude';
try {
const queryResult = query({
prompt: this.createMessageGenerator(session),
options: {
model: MODEL,
disallowedTools: DISALLOWED_TOOLS,
abortController: session.abortController,
pathToClaudeCodeExecutable: claudePath
abortController: session.abortController
}
});