Skip to content

Fix Claude Code hook setup for multi-agent development#33

Merged
rinadelph merged 1 commit into
rinadelph:mainfrom
AstroMined:main
Jul 14, 2025
Merged

Fix Claude Code hook setup for multi-agent development#33
rinadelph merged 1 commit into
rinadelph:mainfrom
AstroMined:main

Conversation

@AstroMined

Copy link
Copy Markdown
Contributor

Summary

Fixes broken Claude Code hook configuration that prevented multi-agent file locking system from functioning. Adds automated setup, documentation, and missing files to improve new user experience.

Closes #32

Changes Made

🛠️ Setup Automation

  • Added setup-claude-hooks.sh - Automated hook configuration script
    • Backs up existing settings safely
    • Configures proper PreToolUse and PostToolUse hooks
    • Verifies hook files exist and are executable
    • Creates necessary runtime directories

📚 Documentation Improvements

  • Updated docs/getting-started.md - Added hook setup section with troubleshooting
  • Created CONTRIBUTING.md - Missing file referenced in README with complete dev guidelines
  • Updated .gitignore - Exclude hook runtime files and backup configurations

🔧 Technical Details

The original issue was hardcoded paths in .claude/settings.json pointing to:

"/home/alejandro/Code/MCP/Agent-MCP/rins_hooks/hooks/git-agentmcp/index.js"

Fixed with relative paths to working hooks:

{
  "hooks": {
    "PreToolUse": [{"command": "node \"./agent_mcp/hooks/file-lock-manager.js\""}],
    "PostToolUse": [{"command": "node \"./agent_mcp/hooks/activity-broadcaster.js\""}]
  }
}

Impact

Before

  • ❌ Claude Code hook errors on every file operation
  • ❌ Multi-agent file locking completely broken
  • ❌ No setup documentation for new users
  • ❌ Missing CONTRIBUTING.md referenced in README

After

  • ✅ Smooth automated setup with ./setup-claude-hooks.sh
  • ✅ Multi-agent file locking prevents conflicts
  • ✅ Clear documentation and troubleshooting guide
  • ✅ Complete contribution guidelines for developers

Testing

Manual Testing

  • Fresh repository clone
  • Hook setup script execution
  • File operations without errors
  • Multi-agent coordination functionality
  • Documentation clarity and completeness

Verification Steps

  1. Clone repository: git clone https://github.com/rinadelph/Agent-MCP.git
  2. Run setup: ./setup-claude-hooks.sh
  3. Test functionality: Edit files with Claude Code (no errors expected)
  4. Verify coordination: Multiple agents can work without conflicts

Files Changed

  • setup-claude-hooks.sh - New automated setup script
  • CONTRIBUTING.md - New contribution guidelines
  • 📝 docs/getting-started.md - Added hook setup section
  • 🔧 .gitignore - Exclude hook runtime files

Breaking Changes

None. This is purely additive functionality that improves the setup experience.

Community Benefit

This PR ensures every new user can successfully use Agent-MCP's core multi-agent features without hitting setup roadblocks. The automated setup script and improved documentation will significantly reduce support burden and improve adoption.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

- Add setup-claude-hooks.sh script for automatic hook configuration
- Create missing CONTRIBUTING.md file referenced in README
- Update getting-started.md with hook setup instructions
- Add .gitignore entries for hook runtime files

Fixes issue where Claude Code hooks pointed to non-existent paths,
preventing multi-agent file locking system from functioning.
The setup script configures proper PreToolUse and PostToolUse hooks
for conflict prevention in multi-agent development workflows.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@rinadelph rinadelph merged commit 42fd2ae into rinadelph:main Jul 14, 2025
rinadelph pushed a commit that referenced this pull request Aug 11, 2025
- Add setup-claude-hooks.sh script for automatic hook configuration
- Create missing CONTRIBUTING.md file referenced in README
- Update getting-started.md with hook setup instructions
- Add .gitignore entries for hook runtime files

Fixes issue where Claude Code hooks pointed to non-existent paths,
preventing multi-agent file locking system from functioning.
The setup script configures proper PreToolUse and PostToolUse hooks
for conflict prevention in multi-agent development workflows.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <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.

Claude Code hook configuration broken - multi-agent file locking non-functional

2 participants