JuliusBrussee/caveman · error · ValueError
File too large to compress safely (max 500KB): {filepath}
Error message
File too large to compress safely (max 500KB): {filepath} What it means
Error "File too large to compress safely (max 500KB): {filepath}" thrown in JuliusBrussee/caveman.
Source
Thrown at plugins/caveman/skills/caveman-compress/scripts/compress.py:284
COMPRESSED (fix this):
{compressed}
Return ONLY the fixed compressed file. No explanation.
"""
# ---------- Core Logic ----------
def compress_file(filepath: Path) -> bool:
# Resolve and validate path
filepath = filepath.resolve()
MAX_FILE_SIZE = 500_000 # 500KB
if not filepath.exists():
raise FileNotFoundError(f"File not found: {filepath}")
if filepath.stat().st_size > MAX_FILE_SIZE:
raise ValueError(f"File too large to compress safely (max 500KB): {filepath}")
# Refuse files that look like they contain secrets or PII. Compressing ships
# the raw bytes to the Anthropic API — a third-party boundary — so we fail
# loudly rather than silently exfiltrate credentials or keys. Override is
# intentional: the user must rename the file if the heuristic is wrong.
if is_sensitive_path(filepath):
raise ValueError(
f"Refusing to compress {filepath}: filename looks sensitive "
"(credentials, keys, secrets, or known private paths). "
"Compression sends file contents to the Anthropic API. "
"Rename the file if this is a false positive."
)
print(f"Processing: {filepath}")
if not should_compress(filepath):
print("Skipping (not natural language)")
return FalseView on GitHub (pinned to 27d5a3981a)
Solutions
- Compress a file of at most 500KB, or split the content first.
When it happens
Trigger: Thrown at plugins/caveman/skills/caveman-compress/scripts/compress.py:284 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/2ffbeac43719d655.
Report an issue: GitHub.