JuliusBrussee/caveman · error
usage: caveman-proxy learn applied
Error message
usage: caveman-proxy learn applied <sink_id> [--fix-kind <k>] [--note <s>]
What it means
Thrown by runLearn's `applied` branch when the positional sink id is missing: `caveman-proxy learn applied <sink_id> [--fix-kind <k>] [--note <s>]`. This subcommand records that a fix was actually applied for a sink, so RecordAppliedFix needs the sink id to key the record.
Solutions
- Provide the sink id positional: `caveman-proxy learn applied <sink_id> --fix-kind <k> --note <s>`.
- Get valid sink ids from `learn scan` or `learn report --json`.
- In scripts, fail fast if the sink id variable is empty before invoking the CLI.
Example fix
// before caveman-proxy learn applied --fix-kind config --note "trimmed CLAUDE.md" // after caveman-proxy learn applied context-overload-7f3a --fix-kind config --note "trimmed CLAUDE.md"
Defensive patterns
Strategy: validation
Validate before calling
// shell if [ -z "$SINK_ID" ]; then echo "learn applied requires a positional sink_id" >&2; exit 2; fi caveman-proxy learn applied "$SINK_ID" --fix-kind "$KIND" --note "$NOTE"
Prevention
- Pass the sink id as the first positional after the subcommand.
- Don't confuse learn applied (records a fix) with learn apply (materializes a candidate).
- Fail fast in scripts when the sink id variable is empty.
When it happens
Trigger: `caveman-proxy learn applied`, or passing only flags like `--fix-kind note --note "x"` without the bare sink id positional.
Common situations: Recording applied fixes in automation/scripts where the sink id variable was empty; confusing `learn applied` (records a fix) with `learn apply` (materializes a candidate) and omitting the id in both.
Understand the failure class
Background: "no subcommand specified" and "... is required": CLI errors when a required argument is missing — this error's family across 13 libraries.
Related errors
- usage: caveman-proxy learn apply
- usage: caveman-proxy learn simulate
- no trial_id supplied and no trial runs exist
- sink not found in current learn plan
- unknown learn subcommand
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/637737d85eae1ac6.
Report an issue: GitHub.
Appendix: source
Thrown at proxy/cmd/caveman-proxy/main.go:739
savings, err := spend.BuildLearnSavings(cwd, sources, since)
if err != nil {
fatalJSON(logger, err)
}
printJSON(savings)
case "apply":
sinkID := firstPositional(args)
if sinkID == "" {
fatalJSON(logger, fmt.Errorf("usage: caveman-proxy learn apply <sink_id> [--dry-run]"))
}
plan, err := spend.BuildLearnPlan(cwd, sources, since)
if err != nil {
fatalJSON(logger, err)
}
applyLearnSink(logger, home, sinkID, hasArg(args, "--dry-run"), plan)
case "applied":
sinkID := firstPositional(args)
if sinkID == "" {
fatalJSON(logger, fmt.Errorf("usage: caveman-proxy learn applied <sink_id> [--fix-kind <k>] [--note <s>]"))
}
plan, err := spend.BuildLearnPlanFilteredWithRetro(cwd, sources, since, store.RetroOptions{}, repoFilter)
if err != nil {
fatalJSON(logger, err)
}
recorded, err := spend.RecordAppliedFix(plan, sinkID, argFlag(args, "--fix-kind", ""), argFlag(args, "--note", ""))
if err != nil {
fatalJSON(logger, err)
}
printJSON(recorded)
case "simulate":
sinkIDs := learnSinkPositionals(args)
if len(sinkIDs) == 0 {
fatalJSON(logger, fmt.Errorf("usage: caveman-proxy learn simulate <sink_id> [<sink_id>...] [--sources <list>] [--since <window>]"))
}
simulation, err := spend.BuildLearnSimulationFiltered(cwd, sources, since, sinkIDs, repoFilter)
if err != nil {
fatalJSON(logger, err)View on GitHub (pinned to 3ee70a1026)