Skip to content

Conversation

@technicalpickles
Copy link
Owner

Summary

  • Routes can now be defined in .claude/tool-routes.yaml within a project directory
  • No plugin installation required - just drop a routes file in .claude/
  • Project routes are merged with plugin routes (conflicts still error)

Changes

  • discovery.py: Check for .claude/tool-routes.yaml in project directory
  • test_discovery_new.py: Added 2 tests for project-local discovery
  • Version bump to 0.2.0

Use Case

In a project like ~/gt, define project-specific routing rules:

# ~/gt/.claude/tool-routes.yaml
routes:
  git-worktree-add:
    tool: Bash
    pattern: 'git\s+worktree\s+add'
    message: "Use `pt checkout <repo> <branch>` instead of git worktree add"

These routes are discovered automatically when Claude Code runs in that project.

Test plan

  • pytest tests/test_discovery_new.py - all 5 tests pass
  • Manual test with CLAUDE_PROJECT_ROOT set shows project-local routes

🤖 Generated with Claude Code

Routes can now be defined in `.claude/tool-routes.yaml` within a project
directory, without requiring a full plugin installation.

- discover_all_routes() now checks for project-local routes after plugin
  routes
- Project path comes from CLAUDE_PROJECT_ROOT (set by Claude Code) or cwd
- Added tests for project-local discovery

This enables projects to define routing rules (like suggesting `pt checkout`
instead of `git worktree add`) without creating a plugin.

Bumps version to 0.2.0.

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