Objective
Replace all raw fmt.Fprintf(os.Stderr, ...) verbose debug calls inside if verbose { ... } blocks in pkg/cli/token_usage.go with console.LogVerbose() so they use consistent styled output.
Context
This issue was identified in discussion #39209 (Terminal Stylist analysis). The verbose debug messages are already correctly gated behind a verbose bool parameter, but they use plain fmt.Fprintf instead of console.LogVerbose() which both gates the output AND applies console.FormatVerboseMessage() styling.
Current Problem
// ❌ Current — raw fmt.Fprintf inside verbose check
if verbose {
...
fmt.Fprintf(os.Stderr, " Found token usage file: %s (%d bytes)\n", filepath.Base(filePath), fileInfo.Size())
}
if verbose {
...
fmt.Fprintf(os.Stderr, " Found agent usage file: %s (%d bytes)\n", filepath.Base(agentUsagePath), fileInfo.Size())
}
if verbose {
fmt.Fprintf(os.Stderr, " Found usage JSONL files: %s\n", strings.Join(usageJSONLFiles, ", "))
}
Approach
- Open
pkg/cli/token_usage.go.
- Find all
if verbose { fmt.Fprintf(os.Stderr, ...) } blocks in analyzeTokenUsage, analyzeTokenUsageAICOnly, and any other functions.
- Replace each
if verbose { fmt.Fprintf(os.Stderr, "...", args...) } block with console.LogVerbose(verbose, fmt.Sprintf("...", args...)) — this eliminates the explicit if verbose check since LogVerbose handles it internally.
- Verify that
console is already imported; add it if missing.
- Run
make fmt and make agent-report-progress before committing.
Files to Modify
Acceptance Criteria
Generated by 📋 Plan Command · 151.7 AIC · ⌖ 34.4 AIC · ⊞ 16.1K · ◷
Comment /plan to run again
Objective
Replace all raw
fmt.Fprintf(os.Stderr, ...)verbose debug calls insideif verbose { ... }blocks inpkg/cli/token_usage.gowithconsole.LogVerbose()so they use consistent styled output.Context
This issue was identified in discussion #39209 (Terminal Stylist analysis). The verbose debug messages are already correctly gated behind a
verbose boolparameter, but they use plainfmt.Fprintfinstead ofconsole.LogVerbose()which both gates the output AND appliesconsole.FormatVerboseMessage()styling.Current Problem
Approach
pkg/cli/token_usage.go.if verbose { fmt.Fprintf(os.Stderr, ...) }blocks inanalyzeTokenUsage,analyzeTokenUsageAICOnly, and any other functions.if verbose { fmt.Fprintf(os.Stderr, "...", args...) }block withconsole.LogVerbose(verbose, fmt.Sprintf("...", args...))— this eliminates the explicitif verbosecheck sinceLogVerbosehandles it internally.consoleis already imported; add it if missing.make fmtandmake agent-report-progressbefore committing.Files to Modify
pkg/cli/token_usage.goAcceptance Criteria
fmt.Fprintf(os.Stderr, ...)calls replaced withconsole.LogVerbose(verbose, fmt.Sprintf(...))if verbose { fmt.Fprintf(...) }blocks remain in the fileconsolepackage is importedmake agent-report-progress)make fmtpasses