查看命中位置(68)
讀取檔案 · 第172 行claude-code/hud/hooks/register.tsxstat: path => $.fs.stat(path, { resolve: true }),
讀取檔案 · 第173 行claude-code/hud/hooks/register.tsxread: path => $.fs.read(path),
讀取檔案 · 第174 行claude-code/hud/hooks/register.tsxlist: path => $.fs.list(path),
寫入檔案 · 第175 行claude-code/hud/hooks/register.tsxwrite: (path, text) => $.fs.write(path, text),
執行指令 · 第176 行claude-code/hud/hooks/register.tsxrun: (argv, init) => $.process.run(argv, init),
註冊工具 · 第302 行claude-code/hud/hooks/register.tsxawait $.tool.register({
攔截工具呼叫 · 第437 行claude-code/hud/hooks/register.tsxon('tool.call', { tool: /^mcp__hud__hud_debug$/ }, async () => {
攔截工具呼叫 · 第447 行claude-code/hud/hooks/register.tsxon('tool.call', async ($, e, next) => {
執行指令 · 第166 行claude-code/hud/hooks/extras.tsconst ab = /^# branch\.ab \+(\d+) -\d+/.exec(record)
執行指令 · 第21 行claude-code/hud/hooks/hud/render/ansi.tsconst match = ESCAPE_AT.exec(str);
執行指令 · 第143 行claude-code/hud/hooks/hud/render/ansi.tsconst url = /^\x1b\]8;;([^\x07\x1b]*)/.exec(token.text)?.[1];
環境變數 · 第375 行claude-code/hud/hooks/hud/config.ts.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (match, name: string) => process.env[name] ?? match)
讀取檔案 · 第500 行claude-code/hud/hooks/hud/config.tsconst content = fs.readFileSync(fd, 'utf-8');
讀取檔案 · 第90 行claude-code/hud/hooks/shims/fs.tsexport function statSync(p: PathLike, options?: { throwIfNoEntry?: boolean }): Stats {
讀取檔案 · 第105 行claude-code/hud/hooks/shims/fs.tsreturn statSync(fd)
讀取檔案 · 第120 行claude-code/hud/hooks/shims/fs.tsexport function readFileSync(p: PathLike, _options?: unknown): string {
讀取檔案 · 第124 行claude-code/hud/hooks/shims/fs.tsexport function readdirSync(p: string, options?: { withFileTypes?: boolean }): any[] {
寫入檔案 · 第150 行claude-code/hud/hooks/shims/fs.tsexport function writeFileSync(p: PathLike, data: unknown, _options?: unknown): void {
寫入檔案 · 第180 行claude-code/hud/hooks/shims/fs.tsexport function unlinkSync(p: string): void {
寫入檔案 · 第188 行claude-code/hud/hooks/shims/fs.tsexport function mkdirSync(_p: string, _options?: unknown): void {}
環境變數 · 第14 行claude-code/hud/hooks/hud/claude-config-dir.tsconst envConfigDir = process.env.CLAUDE_CONFIG_DIR?.trim();
環境變數 · 第22 行claude-code/hud/hooks/hud/claude-config-dir.tsconst envConfigDir = process.env.CLAUDE_CONFIG_DIR?.trim();
環境變數 · 第2 行claude-code/hud/hooks/hud/debug.tsconst enabled = process.env.DEBUG?.includes('claude-hud') || process.env.DEBUG === '*';
環境變數 · 第12 行claude-code/hud/hooks/hud/utils/terminal.tsreturn columns(process.env.COLUMNS) ?? columns(process.stdout?.columns) ?? columns(process.stderr?.columns);
執行指令 · 第136 行claude-code/hud/hooks/hud/git.tsconst sha = /^detached:([0-9a-f]+)$/.exec(ref)?.[1];
執行指令 · 第171 行claude-code/hud/hooks/hud/git.tsconst match = /^\+(\d+) -(\d+)$/.exec(record.slice('# branch.ab '.length));
環境變數 · 第10 行claude-code/hud/hooks/hud/git-runner.tsexport function createGitEnvironment(base: NodeJS.ProcessEnv = process.env): NodeJS.ProcessEnv {
執行指令 · 第17 行claude-code/hud/hooks/hud/git-runner.tsexecFile('git', [...args], {
執行指令 · 第73 行claude-code/hud/hooks/shims/child_process.tsexport function execFile(
執行指令 · 第90 行claude-code/hud/hooks/shims/child_process.tsexport function exec(command: string, options?: ExecOptions | Callback, callback?: Callback): void {
執行指令 · 第102 行claude-code/hud/hooks/shims/child_process.tsexport function execFileSync(file: string, ...rest: unknown[]): string {
執行指令 · 第111 行claude-code/hud/hooks/shims/child_process.tsexport function spawn(): never {
執行指令 · 第58 行claude-code/hud/hooks/hud/auth.tsconst match = /_(\d+x)$/i.exec(rateLimitTier);
環境變數 · 第66 行claude-code/hud/hooks/hud/auth.tsexport function deriveAuthInfo(claudeJson: unknown, env: NodeJS.ProcessEnv = process.env): AuthInfo {
環境變數 · 第109 行claude-code/hud/hooks/hud/auth.tsif (hasApiKey(process.env)) {
讀取檔案 · 第113 行claude-code/hud/hooks/hud/auth.tsreturn deriveAuthInfo(JSON.parse(fs.readFileSync(getClaudeConfigJsonPath(os.homedir()), 'utf8')));
讀取檔案 · 第66 行claude-code/hud/hooks/hud/daily-cost.tsconst value: unknown = JSON.parse(fs.readFileSync(ledgerPath, 'utf8'));
讀取檔案 · 第93 行claude-code/hud/hooks/hud/daily-cost.tsreturn now - fs.statSync(ledgerPath).mtimeMs <= DAILY_COST_WRITE_THROTTLE_MS;
寫入檔案 · 第102 行claude-code/hud/hooks/hud/daily-cost.tsfs.mkdirSync(path.dirname(ledgerPath), { recursive: true, mode: 0o700 });
寫入檔案 · 第103 行claude-code/hud/hooks/hud/daily-cost.tsfs.writeFileSync(tmpPath, `${JSON.stringify(ledger, null, 2)}\n`, { mode: 0o600, flag: 'wx' });
環境變數 · 第151 行claude-code/hud/hooks/hud/stdin.tsexport function getProviderLabel(stdin: StdinData, env: NodeJS.ProcessEnv = process.env): string | null {
執行指令 · 第70 行claude-code/hud/hooks/hud/transcript.tsconst mcpServer = (toolName: string): string | undefined => name(MCP_TOOL.exec(toolName)?.[1]);
執行指令 · 第158 行claude-code/hud/hooks/hud/transcript.tsconst effort = EFFORT_COMMAND.exec(entry.message.content);
執行指令 · 第172 行claude-code/hud/hooks/hud/transcript.tsconst toolUseId = /<tool-use-id>([^<]+)<\/tool-use-id>/.exec(entry.content)?.[1];
讀取檔案 · 第366 行claude-code/hud/hooks/hud/transcript.tsif (!transcriptPath || !fs.statSync(transcriptPath).isFile()) return emptyTranscript();
執行指令 · 第45 行claude-code/hud/hooks/stdin.tsconst match = /claude-(opus|sonnet|haiku|fable)-(\d+)(?:-(\d{1,2}))?(?:-\d{8})?$/i.exec(bare)
執行指令 · 第46 行claude-code/hud/hooks/stdin.ts?? /claude-(\d+)(?:-(\d+))?-(opus|sonnet|haiku)/i.exec(bare)
執行指令 · 第92 行claude-code/hud/hooks/stdin.tsconst match = /^(?:[a-z+]+:\/\/)?(?:[^@/]+@)?([^/:]+)[:/](?:\d+\/)?([^/]+)\/([^/]+?)(?:\.git)?\/?$/i.exec(remote.trim())
環境變數 · 第23 行claude-code/hud/hooks/hud/index.tsexport function isHudDisabled(env: NodeJS.ProcessEnv = process.env): boolean {
執行指令 · 第15 行claude-code/hud/hooks/hud/memory.tsconst pageSize = /page size of (\d+) bytes/.exec(output)?.[1];
執行指令 · 第16 行claude-code/hud/hooks/hud/memory.tsconst active = /Pages active:\s+(\d+)/.exec(output)?.[1];
執行指令 · 第17 行claude-code/hud/hooks/hud/memory.tsconst wired = /Pages wired down:\s+(\d+)/.exec(output)?.[1];
執行指令 · 第24 行claude-code/hud/hooks/hud/memory.tsconst total = /^MemTotal:\s+(\d+)\s+kB/m.exec(output)?.[1];
執行指令 · 第25 行claude-code/hud/hooks/hud/memory.tsconst available = /^MemAvailable:\s+(\d+)\s+kB/m.exec(output)?.[1];
執行指令 · 第33 行claude-code/hud/hooks/hud/memory.tsexecFile('/usr/bin/vm_stat', { encoding: 'utf8', timeout: VM_STAT_TIMEOUT_MS }, (error, stdout) => {
讀取檔案 · 第44 行claude-code/hud/hooks/hud/memory.tsreturn parseLinuxMeminfo(await readFile('/proc/meminfo', 'utf8')) ?? systemMemory();
讀取檔案 · 第4 行claude-code/hud/hooks/shims/fs_promises.tsexport async function readFile(path: string, _options?: unknown): Promise<string> {
讀取檔案 · 第80 行claude-code/hud/hooks/hud/render/vcs.tsreturn resolved ? fs.statSync(resolved).mtimeMs : 0;
讀取檔案 · 第21 行claude-code/hud/hooks/hud/config-reader.tsconst value: unknown = JSON.parse(fs.readFileSync(filePath, 'utf8'));
讀取檔案 · 第56 行claude-code/hud/hooks/hud/config-reader.tsfor (const entry of fs.readdirSync(root)) {
讀取檔案 · 第60 行claude-code/hud/hooks/hud/config-reader.tsconst stat = fs.statSync(target);
執行指令 · 第28 行claude-code/hud/hooks/hud/jj.tsexecFile(file, [...args], options, (error, stdout) => (error ? reject(error) : resolve({ stdout })));
環境變數 · 第11 行claude-code/hud/hooks/hud/extra-cmd.tsexport function isExtraCmdAllowed(env: NodeJS.ProcessEnv = process.env): boolean {
環境變數 · 第15 行claude-code/hud/hooks/hud/extra-cmd.tsexport function parseExtraCmdArg(argv: string[] = process.argv, env: NodeJS.ProcessEnv = process.env): string | null {
執行指令 · 第42 行claude-code/hud/hooks/hud/extra-cmd.tsexec(cmd, { timeout, maxBuffer: MAX_OUTPUT_BYTES, windowsHide: true }, (error, stdout) => {
讀取檔案 · 第25 行claude-code/hud/hooks/hud/speed.tsconst state = JSON.parse(fs.readFileSync(file, 'utf8')) as Partial<SpeedState>;
寫入檔案 · 第37 行claude-code/hud/hooks/hud/speed.tsfs.mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 });
寫入檔案 · 第39 行claude-code/hud/hooks/hud/speed.tsfs.writeFileSync(tmp, JSON.stringify(state), { mode: 0o600 });