By daniswhoiam
Bayesian learning engine that extracts patterns from your coding sessions and makes Claude Code progressively smarter in your codebase
A Bayesian learning engine that makes Claude Code progressively smarter in your codebase.
Every coding session is a data point. bayesian-it silently captures episodes from your Claude Code sessions, then uses counterfactual reasoning to extract patterns correlated with success and anti-patterns correlated with failure. These are stored in a Markdown playbook with Bayesian confidence scores that update as more evidence accumulates. High-confidence patterns are automatically injected into new sessions, so Claude's advice gets sharper the more you use it.
Claude Code Session
|
v
+--------------+ hooks (PostToolUse / Stop)
| Episode |<---- silently captures every tool call
| Capture | and session outcome
+------+-------+
|
v
+--------------+ on-demand via /bayesian:analyze
| Scribe |<---- LLM-powered analysis with
| Analysis | counterfactual reasoning
+------+-------+
|
v
+--------------+ .bayesian/playbook/*.md
| Playbook |<---- human-readable Markdown patterns
| Store | with YAML frontmatter + confidence
+------+-------+
|
v
+--------------+ auto-injected at session start
| Claude |<---- high-confidence patterns surfaced
| Context | automatically + on-demand via commands
+--------------+
| Feature | Description |
|---|---|
| Bayesian Confidence | Wilson score interval calculations with observation-count thresholds (low -> very_high) |
| Counterfactual Reasoning | The Scribe classifies causation as causal, likely_causal, correlational, or spurious -- spurious patterns are auto-filtered |
| Cold Start Mitigation | 12 pre-seeded language-agnostic patterns across testing, debugging, refactoring, and error handling |
| Source Provenance | Every pattern tagged as pre-seeded or learned so you know what came from evidence |
| Silent Hooks | Episode capture never blocks Claude Code -- errors are swallowed, exit code is always 0 |
| Markdown Playbook | Patterns stored as .md files with YAML frontmatter -- human-readable, git-diffable, versionable |
| Auto-Injection | High-confidence patterns automatically included in session context at startup |
| Slash Commands | 5 built-in commands for interacting with the playbook without leaving your flow |
Installs hooks, MCP server, and commands into your global Claude Code configuration. Works across all projects.
npx claude-bayesian-playbook --global
Installs into the current project only.
npx claude-bayesian-playbook --local
Start a Claude Code session and run:
/bayesian:status
You should see episode counts, pattern stats, and confidence distribution.
| Command | What it does |
|---|---|
/bayesian:status | Dashboard -- episode count, pattern stats, confidence distribution, recent Scribe runs |
/bayesian:query | Query the playbook for patterns relevant to a task or context type |
/bayesian:analyze | Trigger Scribe analysis and see a before/after summary |
/bayesian:explain | Deep-dive into a pattern -- Wilson score math, causation assessment, full evidence |
/bayesian:review | Batch review workflow -- approve, reject, or skip patterns one by one |
npx claude-bayesian-playbook --uninstall
Removes all bayesian-it entries from settings.json, .mcp.json, and CLAUDE.md without affecting other plugins. Episode data in .bayesian/ is preserved.
Confidence is calculated using the Wilson score interval lower bound:
lower = (p + z^2/2n - z*sqrt((p(1-p) + z^2/4n) / n)) / (1 + z^2/n)
Where z = 1.96 (95% CI), p = success_rate, n = total_observations.
| Level | Score Threshold | Min Observations |
|---|---|---|
very_high | >= 0.75 | 10 |
high | >= 0.55 | 5 |
medium | >= 0.35 | 3 |
low | below thresholds | -- |
For anti-patterns, the failure rate is used instead of the success rate.
MIT
Matches all tools
Hooks run on every tool call, not just specific ones
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub daniswhoiam/bayesian-itSelf-improving Claude Code plugin — learns from corrections across sessions via reflexio
Continuous learning hooks for gladiator MCP (observe patterns, reflect on them)
Self-learning system for Claude Code that captures corrections and updates CLAUDE.md automatically
Automatic context engineering — observes your coding sessions and generates rules, suggestions, skills, and hooks so Claude gets smarter on your codebase over time
Analyze Claude Code agent session transcripts to identify inefficiencies, anti-patterns, repeated mistakes, missing tooling opportunities, and user frustration signals for continuous improvement
I (Claude) act as you - Build knowledge base from your notes.