naman10parikh/agentgrid / .claude/skills/self-improve
self-improve
VerifiedAnalyze past session logs to find repeated patterns, forgotten rules, and backtracking moments. Auto-update CLAUDE.md, skills, and rules to address gaps. "Correct once, never again."
When to Use
- After several sessions of active development
- When you notice Claude making the same mistakes repeatedly
- Periodically (weekly) as a maintenance task
Process
1. Session Log Analysis
Read session files from ~/.claude/projects/ (JSONL format).
Look for:
- Questions Claude asks repeatedly (→ add answer to CLAUDE.md)
- Rules Claude forgets (→ add to .claude/rules/)
- Information Claude keeps re-discovering (→ promote to bootstrap memory)
- Patterns of backtracking (→ create a skill that prevents it)
- Tool call failures (→ improve error handling in hooks)
2. Signal Classification
- High confidence: Explicit corrections from user → immediately persist
- Medium confidence: Patterns that worked well → persist after confirming
- Low confidence: Observations → queue for review
3. Output
For each finding:
- Identify which file to update (CLAUDE.md, a rule, a skill, settings)
- Make the minimal change needed
- Log the improvement to CONTEXT.md
4. Verification
- Confirm CLAUDE.md is still under 80 lines / 2K tokens
- Confirm no conflicting rules exist
- Confirm skills are still discoverable (short descriptions)
Known Error Pattern Categories (Auto-Updated)
Category 1: Vercel Serverless State Loss
- Pattern: In-memory Maps/globals lost between Lambda invocations
- Files at risk: Any
const map = new Map()at module scope in API routes - Fix: Client-side state (Zustand/localStorage) + reconnect via SDK on every request
- Examples: ptyRegistry (terminal), desktopSessions (e2b-desktop)
Category 2: Race Conditions in E2B Sandbox Boot
- Pattern: Operation attempted before dependency is ready (Chrome, agent, PTY)
- Fix: Retry loop with backoff, never assume ready after fixed sleep
- Examples: Chrome window streaming, agent-runner readiness, CDP port binding
Category 3: SSE/Stream Timeout During Long Operations
- Pattern: Browser/proxy drops connection when no data flows for 10-15s
- Fix: Keepalive pings on all SSE streams
- Examples: Chat route during tool execution, terminal PTY during inactivity
Category 4: Silent Catch Blocks
- Pattern:
catch { }orcatch { /* comment */ }with no logging - Fix: Always
console.warnwith context prefix and error message - RULE: Every catch block must either log or have
// Intentionally silent: [reason]
Category 5: Missing Circuit Breakers
- Pattern: Unlimited retries or cascading failures from flaky dependencies
- Fix: Track failure count, open circuit after N failures, log transitions
- Examples: Anthropic API rate limits, Supabase connectivity, E2B sandbox creation
The Compound Effect
Each improvement makes the next session slightly better. Over weeks, this compounds into a dramatically better development experience. This IS AutoLab applied to our own tooling.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 469k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |