self-improve
End-of-session retrospective that identifies improvements to agent config, tests, docs, and code. Use when asked to "self-improve", "reflect on session", "what can we improve", "session retrospective", "end of session review". Creates actionable todos from findings.
Best use case
self-improve is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
End-of-session retrospective that identifies improvements to agent config, tests, docs, and code. Use when asked to "self-improve", "reflect on session", "what can we improve", "session retrospective", "end of session review". Creates actionable todos from findings.
Teams using self-improve should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/self-improve/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How self-improve Compares
| Feature / Agent | self-improve | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
End-of-session retrospective that identifies improvements to agent config, tests, docs, and code. Use when asked to "self-improve", "reflect on session", "what can we improve", "session retrospective", "end of session review". Creates actionable todos from findings.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
SKILL.md Source
# Self-Improve Reflect on the current session, identify concrete improvements, present them for approval, then create todos and execute. ## Step 1: Gather Context Use what's already in the conversation — tool outputs, errors, subagent summaries, dev server logs, test results. You're in the session, so you have the context. Only use the `session-reader` skill if you need to review a subagent's session that isn't summarized in the current conversation. ## Step 2: Analyze Improvement Areas Examine each area below. Skip areas with no findings — only report what's actionable. | Area | What to Look For | |------|-----------------| | **Agent config** | Could AGENTS.md instructions be clearer? Did the agent misunderstand something that better wording would prevent? | | **Subagent behavior** | Did subagents struggle, go off-scope, or need repeated correction? Would better task descriptions or agent definitions help? | | **Agent definitions** | Check `~/.pi/agent/agents/*.md` — are model choices, skills, or system prompts optimal for what was observed? | | **Tests** | Were bugs found that tests should catch? Are existing tests stale or missing coverage for touched code? | | **Documentation** | Are READMEs, inline docs, or references out of date after changes made this session? | | **Scripts** | Did any scripts fail, produce wrong output, or need manual workarounds? | | **Extensions & MCP** | Were MCP servers or extensions used that could be better configured? Were tools missing that would have helped? | | **Skills** | Did any skill produce suboptimal results? Are trigger descriptions accurate? Would a new skill help? | | **Code quality** | Did the session reveal patterns worth refactoring, error handling gaps, or repeated boilerplate? | | **Workflow** | Were there unnecessary back-and-forth cycles, wasted API calls, or inefficient tool usage patterns? | ## Step 3: Determine Scope For each finding, classify its scope: | Scope | Where It Lives | Example | |-------|---------------|---------| | **Global** | `~/.pi/agent/` (AGENTS.md, skills, agents) | "Subagent worker should always run tests before committing" | | **Project** | Project's `.claude/`, CLAUDE.md, or codebase | "Add integration test for the auth endpoint we just fixed" | ## Step 4: Present Suggestions Present findings as a numbered table. Do NOT start working yet — wait for user approval. Format each suggestion as: ``` ## Improvement Suggestions | # | Area | Scope | Suggestion | Reason | Changes | |---|------|-------|------------|--------|---------| | 1 | Tests | Project | Add test for X | Bug was found manually that a test would catch | Create `tests/test_x.py` | | 2 | Agent config | Global | Clarify Y in AGENTS.md | Subagent misunderstood task scope twice | Edit AGENTS.md section Z | | ... | | | | | | ``` After the table, ask: > Which of these should I work on? (all / numbers / none) ## Step 5: Create Todos and Execute For each approved suggestion: 1. Create a todo with the `todo` tool: - **title**: Short actionable summary - **tags**: `["self-improve", "<scope>"]` where scope is `global` or `project` - **body**: Full context — what to change, why, which files 2. Work through each todo: - Claim it - Make the changes - Verify the change works (run tests, validate config, etc.) - Commit using the `commit` skill if changes touch version-controlled files - Mark the todo as done 3. After completing all todos, print a summary: ``` ## Completed Improvements | # | Todo | What Changed | Verified | |---|------|-------------|----------| | 1 | TODO-xxxx | Added test_x.py — passes ✓ | ✓ | | 2 | TODO-yyyy | Updated AGENTS.md worker section | ✓ | ```
Related Skills
write-todos
Write clear, actionable todos that workers can execute without losing architectural intent. Use when "create todos", "write todos", "break into tasks", "plan todos", "make todos", or creating work items from a plan. Ensures each todo has unambiguous expected outcomes, concrete examples, and explicit constraints so workers don't drift from the design.
skill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, planning, writing, registration, and verification.
session-reader
Efficiently read and analyze pi agent session JSONL files. Use when asked to "read a session", "review a session", "analyze a session", "what happened in this session", "load session", "parse session", "session history", "go through sessions", or given a .jsonl session file path.
presentation-creator
Create data-driven presentation slides using React, Vite, and Recharts with Sentry branding. Use when asked to "create a presentation", "build slides", "make a deck", "create a data presentation", "build a Sentry presentation". Scaffolds a complete slide-based app with charts, animations, and single-file HTML output.
learn-codebase
Discover project conventions and surface security concerns. Use when starting work in a new or unfamiliar project, when asked to "learn the codebase", "check project rules", "what are the conventions", "onboard to this project", or "anything shady in this codebase". Scans agent config files (.claude/, .cursor/, CLAUDE.md, etc.) and runs a security/smell sweep for hardcoded secrets, insecure patterns, suspicious dependencies, and dangerous configurations.
iterate-pr
Iterate on a PR until CI passes. Use when you need to fix CI failures, address review feedback, or continuously push fixes until all checks are green. Automates the feedback-fix-push-wait cycle.
github
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
commit
Read this skill before making git commits
code-simplifier
Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Use when asked to "simplify code", "clean up code", "refactor for clarity", "improve readability", or review recently modified code for elegance. Focuses on project-specific best practices.
cmux
Manage terminal sessions and browser surfaces via cmux — spawn workspaces for dev servers, test runners, background tasks, and embedded browsers. Read output, send commands, interact with web pages, and orchestrate multi-terminal workflows.
add-mcp-server
Add an MCP server to pi. Use when asked to "add mcp server", "configure mcp", "add mcp", "new mcp server", "setup mcp", "connect mcp server", or "register mcp server". Handles both global and project-local configurations.