claude-code-hud 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/package.json +1 -1
- package/tui/hud.tsx +12 -8
package/README.md
CHANGED
|
@@ -50,7 +50,8 @@ tmux split-window -h "npx claude-code-hud"
|
|
|
50
50
|
- Anthropic API 기반 5h / 주간 사용률 — `1h 23m` 형식으로 리셋까지 남은 시간 표시
|
|
51
51
|
- input / output / cache-read / cache-write 토큰 분류
|
|
52
52
|
- 세션 output 통계 (total / avg / peak)
|
|
53
|
-
-
|
|
53
|
+
- **오늘 사용량** — 자정 기준 input / output / cache / 비용 합산
|
|
54
|
+
- `now` — 현재 진행 중인 작업 (직접 입력한 마지막 프롬프트) 한 줄 표시
|
|
54
55
|
|
|
55
56
|
**2 PROJECT 탭 — 인터랙티브 파일 브라우저**
|
|
56
57
|
- 디렉토리 트리 (펼치기/접기)
|
|
@@ -164,7 +165,8 @@ tmux split-window -h "npx claude-code-hud"
|
|
|
164
165
|
- Real 5h / weekly usage from Anthropic OAuth API — not estimates. Reset time shown as `1h 23m`
|
|
165
166
|
- Input / output / cache-read / cache-write breakdown
|
|
166
167
|
- Session output stats: total / avg / peak per hour
|
|
167
|
-
-
|
|
168
|
+
- **Today's usage** — input / output / cache / cost totals since midnight
|
|
169
|
+
- `now` line — last prompt you typed (not tool results)
|
|
168
170
|
|
|
169
171
|
**2 PROJECT tab — interactive file browser**
|
|
170
172
|
- Navigable directory tree with expand/collapse
|
package/package.json
CHANGED
package/tui/hud.tsx
CHANGED
|
@@ -95,14 +95,14 @@ type ProjectInfo = {
|
|
|
95
95
|
dirTree: DirNode;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
async function scanProject(cwd: string): Promise<ProjectInfo> {
|
|
98
|
+
async function scanProject(cwd: string, deep = 8): Promise<ProjectInfo> {
|
|
99
99
|
const { default: fg } = await import('fast-glob');
|
|
100
100
|
|
|
101
101
|
// File counts by extension
|
|
102
|
-
const files: string[] = await fg('**/*', {
|
|
103
|
-
cwd, ignore: ['**/node_modules/**', '**/.git/**', '**/dist/**', '**/build/**'],
|
|
104
|
-
onlyFiles: true, dot: false,
|
|
105
|
-
});
|
|
102
|
+
const files: string[] = (await fg('**/*', {
|
|
103
|
+
cwd, ignore: ['**/node_modules/**', '**/.git/**', '**/dist/**', '**/build/**', '**/__pycache__/**', '**/target/**', '**/.next/**', '**/.nuxt/**'],
|
|
104
|
+
onlyFiles: true, dot: false, deep,
|
|
105
|
+
})).slice(0, 3000);
|
|
106
106
|
|
|
107
107
|
const byExt: Record<string, number> = {};
|
|
108
108
|
for (const f of files) {
|
|
@@ -155,7 +155,7 @@ async function scanProject(cwd: string): Promise<ProjectInfo> {
|
|
|
155
155
|
|
|
156
156
|
// Endpoint detection
|
|
157
157
|
const srcFiles: string[] = await fg('**/*.{ts,tsx,js,jsx,py,java,go}', {
|
|
158
|
-
cwd, ignore: ['**/node_modules/**', '**/.git/**', '**/*.test.*', '**/*.spec.*'], onlyFiles: true,
|
|
158
|
+
cwd, ignore: ['**/node_modules/**', '**/.git/**', '**/*.test.*', '**/*.spec.*'], onlyFiles: true, deep,
|
|
159
159
|
});
|
|
160
160
|
const endpoints: Record<string, number> = { GET: 0, POST: 0, PUT: 0, DELETE: 0, PATCH: 0 };
|
|
161
161
|
const PATTERNS: [string, RegExp][] = [
|
|
@@ -797,7 +797,11 @@ function App() {
|
|
|
797
797
|
|
|
798
798
|
useEffect(() => {
|
|
799
799
|
// Scan project once
|
|
800
|
-
|
|
800
|
+
// Quick shallow scan first → show UI immediately
|
|
801
|
+
scanProject(cwd, 2).then(p => { setProject(p); setLoading(false); })
|
|
802
|
+
.catch(() => { setLoading(false); });
|
|
803
|
+
// Full deep scan in background → update silently
|
|
804
|
+
scanProject(cwd, 8).then(p => { setProject(p); }).catch(() => {});
|
|
801
805
|
// Initial API usage fetch
|
|
802
806
|
getUsage().then(setRateLimits).catch(() => {});
|
|
803
807
|
// Initial timeline load
|
|
@@ -912,7 +916,7 @@ function App() {
|
|
|
912
916
|
refresh();
|
|
913
917
|
setProject(null);
|
|
914
918
|
setSelectedFile(null); setFileLines([]); setFileScroll(0);
|
|
915
|
-
scanProject(cwd).then(p => { setProject(p); setTreeCursor(0); }).catch(() => {});
|
|
919
|
+
scanProject(cwd, 8).then(p => { setProject(p); setTreeCursor(0); }).catch(() => {});
|
|
916
920
|
}
|
|
917
921
|
|
|
918
922
|
if (input === 'j' || input === 'ㅓ' || key.downArrow) {
|