Files
claude-mem/plugin/skills/search/operations/by-file.md
T
Alex Newman ca4f046777 feat: Add search skill with progressive disclosure and refactor existing skills
Enhancements:
- Added search skill with 10 HTTP API endpoints for memory queries
- Refactored version-bump and troubleshoot skills using progressive disclosure pattern
- Added operations/ subdirectories for detailed skill documentation
- Updated CLAUDE.md with skill-based search architecture
- Enhanced worker service with search API endpoints
- Updated CHANGELOG.md with v5.4.0 migration details

Technical changes:
- New plugin/skills/search/ directory with SKILL.md
- New .claude/skills/version-bump/operations/ (workflow.md, scenarios.md)
- New plugin/skills/troubleshoot/operations/ (common-issues.md, worker.md)
- Modified src/services/worker-service.ts (added search endpoints)
- Modified plugin/scripts/worker-service.cjs (rebuilt with search API)
- Reduced main skill files by 89% using progressive disclosure
- Token savings: ~2,250 tokens per session start

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:41:53 -05:00

2.0 KiB

Search by File Path

Find all work related to a specific file.

When to Use

  • User asks: "What changes did we make to auth/login.ts?"
  • Understanding the history of a specific file
  • Finding all observations that touched a file

Command

curl -s "http://localhost:37777/api/search/by-file?filePath=auth/login.ts&limit=10&format=index"

Parameters

  • filePath (required): Full or partial file path
    • Examples: "auth/", "login.ts", "src/components/Button.tsx"
  • format: "index" or "full" (default: "full")
  • limit: Number of results per type (default: 10, max: 100)
  • project: Filter by project name (optional)

Response Structure

Returns both observations and sessions that touched the file:

{
  "filePath": "auth/login.ts",
  "count": 5,
  "format": "index",
  "results": {
    "observations": [...],
    "sessions": [...]
  }
}

Use Cases

Full file path:

curl -s "http://localhost:37777/api/search/by-file?filePath=src/auth/login.ts&limit=10"

Partial path (matches all files in directory):

curl -s "http://localhost:37777/api/search/by-file?filePath=auth/&limit=10"

Filename only (matches across directories):

curl -s "http://localhost:37777/api/search/by-file?filePath=login.ts&limit=10"

How to Present Results

Found 5 changes to auth/login.ts:

**Observations:**
1. 🟣 **#1234** Implemented JWT authentication
   > Added token-based auth with refresh tokens
   > Nov 9, 2024

2. 🔴 **#1235** Fixed token expiration edge case
   > Handled race condition in refresh flow
   > Nov 9, 2024

**Sessions:**
1. **Session #123** (Nov 8, 2024)
   > Add user authentication
   > Completed: Implemented JWT auth, added middleware

Tips

  1. Partial paths are powerful for finding all work in a directory
  2. Use this before modifying a file to understand its history
  3. Helps identify who/when/why changes were made
  4. Combine observations + sessions for complete file history