spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / hooks / classify / rooted-path-of / rooted-path-of.ts
8 lines · 285 BRaw
1/**
2 * A path with exactly one leading `/`, so a directory pattern like `/test/`
3 * matches at the start of a relative path too.
4 *
5 * @param path the repository-relative path
6 * @returns the rooted path
7 */
8export const rootedPathOf = (path: string) => `/${path.replace(/^\/+/, '')}`