andreibesleaga/gabbe/active-inference
Claude Code and agent skill by andreibesleaga/gabbe
- community
Checking that the SKILL.md file is still in the repository.
Apply Active Inference to minimize prediction error (Surprise). Use when: active inference.
Install
npx vskill@latest install andreibesleaga/gabbe/active-inferenceSKILL.md
The same SKILL.md was published earlier as andreibesleaga/gabbe/active-inference.
Active Inference Skill
Goal
Give an agent one habit: predict what a step will return, run it, compare, and decide whether to probe for information or fix the code. This is a framing for instructions, not a solver.
"Action is the process of changing the world to match your prediction."
1. The Concept (Free Energy Principle)
Standard agents are goal-directed (maximize reward); Active Inference agents are surprise-minimizing (minimize prediction error).
- Goal: not just to "win" but to understand and control.
- Surprise: the gap between expectation and observation.
Implementation note (conceptual framing, not implemented CLI math): the productiongabbe/brain.pyuses epsilon-greedy gene selection plus a monotonicsuccess_ratereward (effectively a bandit over prompt variants); the free-energy / active-inference framing here is conceptual, not implemented math. Use it to shape agent instructions, not as a literal solver — and never claim it "guarantees correctness." Seeguides/ai/self-evolving-skills.mdfor what actually runs.
2. The Feedback Loop
- Predict: "Running
go testwill output PASS." - Act/Sense: run the command, read output.
- Compare: compute prediction error — result "FAIL" → Surprise!
3. Solving the Error
Two ways to minimize surprise:
- Perceptual Inference (change mind): "My model was wrong" → update docs/mental model.
- Active Inference (change world): "The code is wrong" → edit it so the test passes.
4. Epistemic Action (Curiosity)
When surprise is "unknown" (high uncertainty), take an epistemic action (probe/log) to gain information rather than a pragmatic action toward a goal.
5. System Prompt Template
6. Implementation (Pythonic Pseudo-code)
Steps
- Before a command, write the expected result in one line.
- Run it and read the real output.
- If it differs, probe read-only when the cause is unknown; edit the code when the cause is known.
- After 5 failed corrections, stop and escalate (
self-heal.skill).
Constraints
- Probes are read-only.
- Never make a result match a prediction by deleting a test or disabling a check.
- Do not claim the method guarantees correctness.
Output Format
A short trace per step: Expected, Observed, Difference, Action (probe, fix or continue).
Limits and safety
- Probing actions are read-only (
ls,cat,git status,kubectl get); they never write or call external APIs. - On a very large surprise (garbled or binary output where JSON was expected), stop and ask the human instead of acting.
- Never make a result match the prediction by deleting a failing test or source code, or by switching off a check.
- At most 5 correction attempts per failure, then escalate.
- Measure surprise from the real tool output; the agent's own stated confidence is not a measure.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/gabbe-brain/skills/active-inference/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/andreibesleaga/gabbe/active-inference)