-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
Several constants in the codebase use specific values without explaining why those values were chosen.
Evidence
1. parser.go:13
const MaxScannerBuffer = 100 * 1024 * 1024The comment says "10MB per line" but the actual buffer is 100MB. Why 100MB? What scenarios require this much?
2. show.go:70
const FileSizeWarningThreshold = 5 * 1024 * 1024Why specifically 5MB? Is this based on benchmarks, Claude's behavior, or user experience research?
3. conversation.go:303
return (len(text) + 3) / 4 // ~4 chars/tokenThe "4 characters per token" heuristic - is there a source for this? Does it apply to Claude's tokenizer specifically?
Impact
Without documentation, future maintainers might:
- Change values without understanding the implications
- Waste time researching why these values were chosen
- Make incorrect assumptions about system requirements
Suggested Fix
Add comments explaining the reasoning behind each constant:
// MaxScannerBuffer is 100MB to handle conversation files with very long
// tool outputs or base64-encoded images. Based on observed max line lengths
// in production Claude Code sessions. See [link/issue] for discussion.
const MaxScannerBuffer = 100 * 1024 * 1024Files:
internal/jsonl/parser.go:13internal/cli/show.go:70internal/display/conversation.go:303
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels