Skip to content
Open
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
14 changes: 7 additions & 7 deletions cc_sessions/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -1778,14 +1778,14 @@ function configure_settings(project_root) {
let settings = get_settings(project_root);
const is_windows = process.platform === 'win32';
const sessions_hooks = {
'UserPromptSubmit': [ { hooks: [ { type: 'command', command: is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\user_messages.js"' : 'node $CLAUDE_PROJECT_DIR/sessions/hooks/user_messages.js' } ] } ],
'UserPromptSubmit': [ { hooks: [ { type: 'command', command: is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\user_messages.js"' : 'node "$CLAUDE_PROJECT_DIR/sessions/hooks/user_messages.js"' } ] } ],
'PreToolUse': [
{ matcher: 'Write|Edit|MultiEdit|Task|Bash|TodoWrite|NotebookEdit', hooks: [ { type: 'command', command: is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\sessions_enforce.js"' : 'node $CLAUDE_PROJECT_DIR/sessions/hooks/sessions_enforce.js' } ] },
{ matcher: 'Task', hooks: [ { type: 'command', command: is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\subagent_hooks.js"' : 'node $CLAUDE_PROJECT_DIR/sessions/hooks/subagent_hooks.js' } ] },
{ matcher: 'Write|Edit|MultiEdit|Task|Bash|TodoWrite|NotebookEdit', hooks: [ { type: 'command', command: is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\sessions_enforce.js"' : 'node "$CLAUDE_PROJECT_DIR/sessions/hooks/sessions_enforce.js"' } ] },
{ matcher: 'Task', hooks: [ { type: 'command', command: is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\subagent_hooks.js"' : 'node "$CLAUDE_PROJECT_DIR/sessions/hooks/subagent_hooks.js"' } ] },
],
'PostToolUse': [ { hooks: [ { type: 'command', command: is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\post_tool_use.js"' : 'node $CLAUDE_PROJECT_DIR/sessions/hooks/post_tool_use.js' } ] } ],
'PostToolUse': [ { hooks: [ { type: 'command', command: is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\post_tool_use.js"' : 'node "$CLAUDE_PROJECT_DIR/sessions/hooks/post_tool_use.js"' } ] } ],
// Install kickstart SessionStart hook initially; will be replaced if skipping
'SessionStart': [ { matcher: 'startup|clear', hooks: [ { type: 'command', command: is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\kickstart_session_start.js"' : 'node $CLAUDE_PROJECT_DIR/sessions/hooks/kickstart_session_start.js' } ] } ],
'SessionStart': [ { matcher: 'startup|clear', hooks: [ { type: 'command', command: is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\kickstart_session_start.js"' : 'node "$CLAUDE_PROJECT_DIR/sessions/hooks/kickstart_session_start.js"' } ] } ],
};
if (!settings.hooks || typeof settings.hooks !== 'object') settings.hooks = {};

Expand Down Expand Up @@ -2469,15 +2469,15 @@ async function _ask_statusline() {

// Use Windows or Unix path syntax based on platform
const is_windows = process.platform === 'win32';
const statusline_cmd = is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\statusline.js"' : 'node $CLAUDE_PROJECT_DIR/sessions/statusline.js';
const statusline_cmd = is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\statusline.js"' : 'node "$CLAUDE_PROJECT_DIR/sessions/statusline.js"';

settings.statusLine = { type: 'command', command: statusline_cmd };
fs.writeFileSync(settings_file, JSON.stringify(settings, null, 2));
set_info([color('✓ Statusline configured in .claude/settings.json', Colors.GREEN)]);
} else {
// Show platform-appropriate example
const is_windows = process.platform === 'win32';
const example_cmd = is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\statusline.js"' : 'node $CLAUDE_PROJECT_DIR/sessions/statusline.js';
const example_cmd = is_windows ? 'node "%CLAUDE_PROJECT_DIR%\\sessions\\statusline.js"' : 'node "$CLAUDE_PROJECT_DIR/sessions/statusline.js"';

set_info([
color('You can add the cc-sessions statusline later by adding this to .claude/settings.json:', Colors.YELLOW),
Expand Down
14 changes: 7 additions & 7 deletions cc_sessions/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ def configure_settings(project_root: Path):
{
'type': 'command',
'command': 'python "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\user_messages.py"' if is_windows
else 'python $CLAUDE_PROJECT_DIR/sessions/hooks/user_messages.py'
else 'python "$CLAUDE_PROJECT_DIR/sessions/hooks/user_messages.py"'
}
]
}
Expand All @@ -1877,7 +1877,7 @@ def configure_settings(project_root: Path):
{
'type': 'command',
'command': 'python "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\sessions_enforce.py"' if is_windows
else 'python $CLAUDE_PROJECT_DIR/sessions/hooks/sessions_enforce.py'
else 'python "$CLAUDE_PROJECT_DIR/sessions/hooks/sessions_enforce.py"'
}
]
},
Expand All @@ -1887,7 +1887,7 @@ def configure_settings(project_root: Path):
{
'type': 'command',
'command': 'python "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\subagent_hooks.py"' if is_windows
else 'python $CLAUDE_PROJECT_DIR/sessions/hooks/subagent_hooks.py'
else 'python "$CLAUDE_PROJECT_DIR/sessions/hooks/subagent_hooks.py"'
}
]
}
Expand All @@ -1898,7 +1898,7 @@ def configure_settings(project_root: Path):
{
'type': 'command',
'command': 'python "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\post_tool_use.py"' if is_windows
else 'python $CLAUDE_PROJECT_DIR/sessions/hooks/post_tool_use.py'
else 'python "$CLAUDE_PROJECT_DIR/sessions/hooks/post_tool_use.py"'
}
]
}
Expand All @@ -1910,7 +1910,7 @@ def configure_settings(project_root: Path):
{
'type': 'command',
'command': 'python "%CLAUDE_PROJECT_DIR%\\sessions\\hooks\\kickstart_session_start.py"' if is_windows
else 'python $CLAUDE_PROJECT_DIR/sessions/hooks/kickstart_session_start.py'
else 'python "$CLAUDE_PROJECT_DIR/sessions/hooks/kickstart_session_start.py"'
}
]
}
Expand Down Expand Up @@ -2635,7 +2635,7 @@ def _ask_statusline():

# Use Windows or Unix path syntax based on platform
is_windows = sys.platform == 'win32'
statusline_cmd = 'python "%CLAUDE_PROJECT_DIR%\\sessions\\statusline.py"' if is_windows else 'python $CLAUDE_PROJECT_DIR/sessions/statusline.py'
statusline_cmd = 'python "%CLAUDE_PROJECT_DIR%\\sessions\\statusline.py"' if is_windows else 'python "$CLAUDE_PROJECT_DIR/sessions/statusline.py"'

settings['statusLine'] = {'type': 'command', 'command': statusline_cmd}
with open(settings_file, 'w') as f: json.dump(settings, f, indent=2)
Expand All @@ -2644,7 +2644,7 @@ def _ask_statusline():
else:
# Show platform-appropriate example
is_windows = sys.platform == 'win32'
example_cmd = 'python "%CLAUDE_PROJECT_DIR%\\sessions\\statusline.py"' if is_windows else 'python $CLAUDE_PROJECT_DIR/sessions/statusline.py'
example_cmd = 'python "%CLAUDE_PROJECT_DIR%\\sessions\\statusline.py"' if is_windows else 'python "$CLAUDE_PROJECT_DIR/sessions/statusline.py"'

set_info([ color('You can add the cc-sessions statusline later by adding this to .claude/settings.json:', Colors.YELLOW),
color('{',Colors.YELLOW), color(' "statusLine": {',Colors.YELLOW), color(' "type": "command",',Colors.YELLOW),
Expand Down