Making Kiro learn from every session
The Problem
A few months into using Kiro and Kiro CLI daily, I wanted to review my week.
What problems did I solve? What approaches worked? What did I learn?
Kiro has conversation persistence: you can resume chats, save and load sessions. That's useful. But it's not what I was looking for.
I didn't want to scroll through old conversations. I wanted the insights extracted. The patterns. The solutions that worked and why.
Tuesday's debugging session taught me something about Terraform state locks. But that lesson was buried in a 200-message conversation. Next time I hit the same issue, would I remember to search for it? Would I even remember it happened?
Kiro gives you great infrastructure: agents, hooks, steering files. But no system for capturing what you learn and surfacing it when relevant.
I started asking: What if I built that layer on top of what Kiro already provides?
The Idea
I found Daniel Miessler's PAI project - Personal AI Infrastructure for Claude. It clicked.
The idea: an AI assistant that learns from your work and applies that knowledge to future tasks.
What if I could build something similar for Kiro? A layer that:
- Captures learnings as they happen
- Knows my projects and priorities
- Follows a consistent problem-solving approach
Not a smarter model. A system that learns.
Kiro already has the building blocks: hooks that run at key moments, steering files for persistent context, agent configurations. I just needed to wire them together.
What I Built
PILOT is an agent for Kiro that adds three things:
1. The Algorithm
Every task follows seven phases:
OBSERVE → THINK → PLAN → BUILD → EXECUTE → VERIFY → LEARN
Not revolutionary. It's how experienced engineers already work. But making it explicit means the AI follows it consistently.
The key insight: Define success criteria before executing. Most people skip this. They try something, vaguely check if it worked, move on.
2. Memory
PILOT captures solutions, but only after verification confirms they work.
~/.pilot/learnings/
├── 2026-01-15_terraform-state-lock-fix.md
├── 2026-01-14_lambda-timeout-optimization.md
└── 2026-01-12_git-merge-conflict-pattern.md
Next time you hit a similar problem, PILOT surfaces the past solution.
For semantic search over learnings, PILOT uses Kiro's /knowledge feature. Without it, PILOT still works but uses keyword matching instead.
Unverified solutions are guesses. Verified solutions are knowledge.
3. Identity
Optional markdown files that give PILOT context about you:
~/.pilot/identity/
├── MISSION.md # What you're building
├── GOALS.md # Current objectives
├── PROJECTS.md # Active work
└── STRATEGIES.md # Approaches that work for you
You don't have to fill these manually. PILOT observes your work and gradually populates them. The more you use it, the more context it captures: projects you work on, challenges you face, strategies that work for you.
Without identity: "Here's how to fix this Lambda timeout"
With identity: "Given your focus on cost optimization, consider this approach you used last month..."
How It Works
PILOT uses four Kiro features: hooks, resources, agents, and the experimental knowledge base.
Resources load context into the agent. Kiro supports three types:
-
file://resources load directly at startup (identity files like MISSION.md, GOALS.md) -
skill://resources load on-demand when relevant (the algorithm, principles) -
knowledgeBaseresources enable semantic search over indexed content
PILOT indexes your learnings folder as a knowledge base. When you ask about something, it can find related past solutions even if the keywords don't match exactly.
This keeps context lean. The agent sees your mission and goals immediately, but only loads the full algorithm documentation when it needs to reference it.
Hooks run scripts at key moments. Kiro provides the trigger points, PILOT provides the scripts:
┌─────────────────────────────────────────────────────────────┐
│ Kiro Session │
│ │
│ Kiro Event PILOT Script │
│ ────────── ──────────── │
│ │
│ agentSpawn → agent-spawn.sh │
│ Load identity, past learnings │
│ │
│ userPromptSubmit → user-prompt-submit.sh │
│ Search relevant patterns │
│ │
│ preToolUse → pre-tool-use.sh │
│ Validate before execution │
│ │
│ [Tool executes] │
│ │
│ postToolUse → post-tool-use.sh │
│ Capture results │
│ │
│ stop → stop.sh │
│ Archive session, save learnings │
│ │
└─────────────────────────────────────────────────────────────┘
Kiro provides: PILOT provides:
• Hook trigger points • Scripts that run at each hook
• Agent system • Learning capture logic
• Steering files • Memory management
• Identity context
Agents tie it together. The pilot.json configuration defines:
- Which hooks to run and when
- Which resources to load
- The system prompt with the algorithm phases
- Tool permissions and safety rules
Hooks must exit 0. A crashed hook breaks the session.
It's all shell scripts. No TypeScript, no build tools, no dependencies.
Why bash? Three reasons:
- No runtime startup cost
- Works on macOS and Linux out of the box
- Plain text scripts - open any file and see exactly what it does
What Changed
Persistent learning compounds.
Early on, the benefit is small: a few captured solutions, some context loaded at startup. But each session adds to the knowledge base. Each verified fix becomes available for next time.
After a few weeks, the difference becomes noticeable. Not because any single feature is transformative, but because the system remembers what you've already figured out.
The Tradeoffs
What works well:
- Learning capture is automatic
- Past solutions surface when relevant
- The algorithm keeps work structured
- Bash is fast and debuggable
What's limited:
- Each project has isolated memory (no cross-project patterns yet)
- Learning detection is keyword-based, not ML
- Semantic search requires enabling Kiro's
/knowledgefeature
What's missing:
- Team collaboration (your learnings stay yours)
- Visual dashboard
- Cross-project pattern sharing
This is an MVP. Try it and see if it fits your workflow.
Try It
git clone https://github.com/requix/pilot
cd pilot
./install.sh
For semantic search over learnings (optional but recommended):
kiro-cli settings chat.enableKnowledge true
Then: kiro-cli --agent pilot
The code is simple. The impact compounds over time.
Questions? Open an issue. The system improves through use.
Top comments (0)