src/learn/README.md
See also docs/contributing/TECHNICAL.md for the full architecture overview
Analyzes Claude Code session history to detect recurring CLI mistakes — commands that fail then get corrected by the agent. Powers the rtk learn command, which identifies error patterns (unknown flags, wrong paths, missing args) and can auto-generate .claude/rules/cli-corrections.md to prevent them.
ErrorType — UnknownFlag, CommandNotFound, WrongSyntax, WrongPath, MissingArg, PermissionDenied, Other(String)CorrectionPair — Raw detection: wrong command + right command + error output + confidence scoreCorrectionRule — Deduplicated pattern: wrong pattern + right pattern + occurrence count + base commanddiscover::provider::ClaudeProvider (session file discovery and command extraction), lazy_static/regex (error pattern matching), serde_json (JSON output)src/main.rs (routes rtk learn command)ClaudeProvider--min-confidence and --min-occurrences thresholds