Adaptive Learning

It gets out of your way.

What it learns

Hash watches how you recover from errors. When you fix something, it remembers the pattern.

Pattern extraction

Command: ./deploy.sh
Error: "permission denied"
Exit code: 126
Your fix: chmod +x ./deploy.sh

Hash normalizes this to:

Pattern: {script} → "permission denied" → exit 126
Fix: chmod +x {script}

Next time you get "permission denied" on a script, Hash suggests the fix instantly — no agent call.

Scoring algorithm

Fixes are scored 0–1 based on:

  • Success rate (50% weight) — how often the fix works
  • Recency (30% weight) — recent fixes score higher (decays over 30 days)
  • Frequency (20% weight) — commonly used fixes score higher

Suggestion threshold: 0.7
Hash only suggests fixes that score ≥ 0.7.

Example patterns it learns

Hash recognizes these error types and learns your fixes over time:

Error typeExample fix you might teach it
permission denied on scriptchmod +x
command not foundinstall package, typo correction
no such file or directorymkdir -p the path
connection refusedstart the service

What it doesn't learn

  • Errors you ignore (no fix provided)
  • Fixes with low success rate (below 0.5)

Storage

Patterns stored in SQLite at ~/.local/share/hash/learning.db. No data leaves your machine.

How to reset

Delete the learning database to clear all learned patterns:

rm ~/.local/share/hash/learning.db