Skip to content

Add claude-slack-test command and standardize paths to ~/.claude/slack/#12

Open
BRBCoffeeDebuff wants to merge 1 commit into
dbenn8:mainfrom
BRBCoffeeDebuff:feature/consistent-paths-and-test-command
Open

Add claude-slack-test command and standardize paths to ~/.claude/slack/#12
BRBCoffeeDebuff wants to merge 1 commit into
dbenn8:mainfrom
BRBCoffeeDebuff:feature/consistent-paths-and-test-command

Conversation

@BRBCoffeeDebuff

@BRBCoffeeDebuff BRBCoffeeDebuff commented Jan 17, 2026

Copy link
Copy Markdown

Summary

  • Add claude-slack-test command for testing Slack connection
  • Add --local flag to test directory-level hook configuration
  • Add optional --description flag to claude-slack for meaningful thread descriptions
  • Standardize all paths to ~/.claude/slack/ directory structure

Problem

1. No way to test Slack connection

Users had no simple way to verify their Slack setup was working before starting a session. If something was misconfigured, they'd only find out after starting Claude and wondering why messages weren't appearing.

2. Inconsistent path configuration

The codebase had paths scattered across multiple locations with inconsistent defaults:

Component Was Using Should Use
.env / .env.example /tmp/claude_socks, /tmp/claude_sessions/ Config defaults
config.py ~/.claude/slack/ ✅ Correct
slack_listener.py /tmp/claude_slack.sock Config defaults
claude_wrapper_hybrid.py /tmp/claude_output_*.txt Config defaults
hooks/*.py /tmp/*_hook_debug.log Config defaults
bin/claude-slack-monitor /tmp/slack_*.log Config defaults
bin/claude-slack-debug ~/.local/share/claude-code-integration/ Config defaults

This caused:

  • Data loss on reboot - /tmp/ is cleared on system restart
  • Permission issues - /tmp/ may have different permissions
  • Confusion - Different components looking in different places
  • Documentation mismatch - README/SECURITY.md referenced old paths

3. No way to add context to Slack threads

When multiple sessions are running, thread headers only showed the project name. Users couldn't tell which session was for what task without opening the thread.

4. No per-directory setup verification

Users couldn't verify if a specific project directory had hooks properly configured before starting a session.

Solution

New claude-slack-test command

# Test global Slack API connection
claude-slack-test

# Test current directory's hooks setup  
claude-slack-test --local

Path standardization

All components now consistently use ~/.claude/slack/ (configurable via environment variables):

~/.claude/slack/
├── logs/                    # All log files
│   ├── slack_listener.log
│   ├── notification_hook_debug.log
│   ├── stop_hook_debug.log
│   └── claude_output_*.txt
├── sockets/                 # Unix sockets for IPC
│   └── *.sock
└── registry.db              # Session database

Optional session descriptions

claude-slack -d "Working on authentication feature"

Creates thread with description visible in header:

🚀 my-project
_Working on authentication feature_
Session: abc12345...  |  Terminal: iTerm

Files Changed

New:

  • bin/claude-slack-test - Test command with --local flag

Modified for path consistency:

  • core/slack_listener.py - Use get_socket_dir() for legacy socket
  • core/claude_wrapper_hybrid.py - Use LOG_DIR for buffer files
  • hooks/on_notification.py - Add LOG_DIR, fix debug log and buffer paths
  • hooks/on_stop.py - Add LOG_DIR, fix debug log path
  • hooks/on_pretooluse.py - Add LOG_DIR, fix debug log path
  • hooks/check_hook_status.sh - Fix debug log default path
  • bin/claude-slack-listener - Fix monitor log path
  • bin/claude-slack-monitor - Add env loading, fix all log paths
  • bin/claude-slack-debug - Fix log/socket directory paths

Modified for description feature:

  • bin/claude-slack - Add --description and --help flags
  • core/claude_wrapper_hybrid.py - Pass description to registry
  • core/session_registry.py - Include description in Slack thread header

Documentation:

  • .env.example - Show correct default paths (commented out)
  • README.md - Update path references
  • SECURITY.md - Update path references

Test plan

  • claude-slack-test - Verifies Slack API connection, sends test message
  • claude-slack-test --local - Verifies directory has hooks configured
  • claude-slack-health - All checks pass with new paths
  • Verify logs appear in ~/.claude/slack/logs/
  • Verify registry.db created in ~/.claude/slack/
  • Verify claude-slack -d "description" shows in thread header

Breaking Changes

None. Environment variables still work for custom paths. Only defaults changed from /tmp/ to ~/.claude/slack/.

🤖 Generated with Claude Code

New Features:
- Add claude-slack-test command for testing Slack connection
- Add --local flag to test directory-level hook configuration
- Add optional --description flag to claude-slack for meaningful thread descriptions

Path Standardization:
- Consolidate all paths to ~/.claude/slack/ directory structure:
  - ~/.claude/slack/logs/ for all log files
  - ~/.claude/slack/sockets/ for Unix sockets
  - ~/.claude/slack/registry.db for session database
- Remove hardcoded /tmp/ paths that were inconsistent with config.py defaults
- Update .env.example to show correct default paths (commented out)
- Fix .env to not override defaults with /tmp/ paths

Files Changed:
- bin/claude-slack-test (new): Test Slack connection and directory setup
- bin/claude-slack: Add --description and --help flags
- bin/claude-slack-listener: Fix monitor log path
- bin/claude-slack-monitor: Add env loading, fix log paths
- bin/claude-slack-debug: Fix log/socket directory paths
- core/slack_listener.py: Use get_socket_dir() for legacy socket
- core/claude_wrapper_hybrid.py: Use LOG_DIR for buffer files
- core/session_registry.py: Add description support in Slack threads
- hooks/on_*.py: Add LOG_DIR, fix debug log paths
- README.md, SECURITY.md: Update path references

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant