Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,10 @@
"enabledPlugins": {
"plugin-dev@claude-code-plugins": true,
"feature-dev@claude-code-plugins": true,
"github-orchestration@constellos-local": true,
"nextjs-supabase-ai-sdk-dev@constellos": true,
"nextjs-supabase-ai-sdk-dev@constellos-local": true,
"project-context@constellos-local": true
"github-orchestration@constellos": true
},
"extraKnownMarketplaces": {
"constellos-local": {
"source": {
"source": "directory",
"path": "${CLAUDE_PROJECT_DIR}/.claude-plugin"
}
},
"claude-code-plugins": {
"source": {
"source": "github",
Expand Down
11 changes: 8 additions & 3 deletions claude-worktree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -766,9 +766,8 @@ _cw_main() {
# Get worktree-specific cache directory (per-worktree isolation)
local wt_cache_dir=$(_cw_get_worktree_cache_dir "$worktree_dir")

# Update symlink to point to this worktree's cache
# This ensures each worktree has isolated cache without breaking others
_cw_update_cache_symlink "$wt_cache_dir"
# NOTE: Symlink update is deferred until AFTER plugins are installed
# This prevents race condition where hooks execute from empty cache

local current_path=$(claude plugin marketplace list 2>/dev/null | grep -A1 "constellos-local" | grep "Directory" | sed 's/.*(\(.*\))/\1/')

Expand Down Expand Up @@ -876,6 +875,12 @@ _cw_main() {
fi
done <<< "$plugins"
fi

# Update symlink AFTER plugins are installed to prevent race condition
# where SessionStart hooks execute from empty cache directory
if [[ -n "$wt_cache_dir" ]]; then
_cw_update_cache_symlink "$wt_cache_dir"
fi
fi
set -e

Expand Down
17 changes: 14 additions & 3 deletions plugins/nextjs-supabase-ai-sdk-dev/hooks/run-session-typechecks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import type { StopInput, StopHookOutput } from '../shared/types/types.js';
import { runHook } from '../shared/hooks/utils/io.js';
import { findConfigFile } from '../shared/hooks/utils/config-resolver.js';
import { detectWorktree } from '../shared/hooks/utils/worktree.js';
import { exec } from 'child_process';
import { promisify } from 'util';

Expand Down Expand Up @@ -49,12 +50,22 @@ async function handler(input: StopInput): Promise<StopHookOutput> {
console.log('[run-session-typechecks] Session ID:', input.session_id);
}

// Find tsconfig.json
const tsconfigDir = await findConfigFile(input.cwd, 'tsconfig.json');
// Normalize cwd to worktree/repo root for consistent config resolution
// This fixes false positives in monorepos where input.cwd might be a subdirectory
const worktreeInfo = detectWorktree(input.cwd);
const searchRoot = worktreeInfo.worktreePath;

if (DEBUG) {
console.log('[run-session-typechecks] Search root:', searchRoot);
console.log('[run-session-typechecks] Is worktree:', worktreeInfo.isWorktree);
}

// Find tsconfig.json starting from repo/worktree root
const tsconfigDir = await findConfigFile(searchRoot, 'tsconfig.json');

if (!tsconfigDir) {
// No tsconfig.json found - skip with warning visible in systemMessage
const warning = `⚠️ TypeScript check skipped: tsconfig.json not found (searched from ${input.cwd})`;
const warning = `⚠️ TypeScript check skipped: tsconfig.json not found (searched from ${searchRoot})`;
if (DEBUG) {
console.warn(`[run-session-typechecks] ${warning}`);
}
Expand Down
17 changes: 14 additions & 3 deletions plugins/nextjs-supabase-ai-sdk-dev/hooks/run-task-typechecks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type { SubagentStopInput, SubagentStopHookOutput } from '../shared/types/
import { runHook } from '../shared/hooks/utils/io.js';
import { getAgentEdits } from '../shared/hooks/utils/subagent-state.js';
import { findConfigFile } from '../shared/hooks/utils/config-resolver.js';
import { detectWorktree } from '../shared/hooks/utils/worktree.js';
import { exec } from 'child_process';
import { promisify } from 'util';

Expand Down Expand Up @@ -92,12 +93,22 @@ async function handler(input: SubagentStopInput): Promise<SubagentStopHookOutput
};
}

// Find tsconfig.json
const tsconfigDir = await findConfigFile(input.cwd, 'tsconfig.json');
// Normalize cwd to worktree/repo root for consistent config resolution
// This fixes false positives in monorepos where input.cwd might be a subdirectory
const worktreeInfo = detectWorktree(input.cwd);
const searchRoot = worktreeInfo.worktreePath;

if (DEBUG) {
console.log('[run-task-typechecks] Search root:', searchRoot);
console.log('[run-task-typechecks] Is worktree:', worktreeInfo.isWorktree);
}

// Find tsconfig.json starting from repo/worktree root
const tsconfigDir = await findConfigFile(searchRoot, 'tsconfig.json');

if (!tsconfigDir) {
// No tsconfig.json found - skip with warning visible in systemMessage
const warning = `⚠️ TypeScript check skipped: tsconfig.json not found (searched from ${input.cwd})`;
const warning = `⚠️ TypeScript check skipped: tsconfig.json not found (searched from ${searchRoot})`;
if (DEBUG) {
console.warn(`[run-task-typechecks] ${warning}`);
}
Expand Down
Loading