compound-engineering
Make your AI agent learn and improve automatically. Reviews sessions, extracts learnings, updates memory files, and compounds knowledge over time. Set up nightly review loops that make your agent smarter every day.
Best use case
compound-engineering is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Make your AI agent learn and improve automatically. Reviews sessions, extracts learnings, updates memory files, and compounds knowledge over time. Set up nightly review loops that make your agent smarter every day.
Teams using compound-engineering 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/ai-compound-1-0-1/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How compound-engineering Compares
| Feature / Agent | compound-engineering | 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?
Make your AI agent learn and improve automatically. Reviews sessions, extracts learnings, updates memory files, and compounds knowledge over time. Set up nightly review loops that make your agent smarter every day.
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
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# Compound Engineering
Make your AI agent learn automatically. Extract learnings from sessions, update memory files, and compound knowledge over time.
**The idea**: Your agent reviews its own work, extracts patterns and lessons, and updates its instructions. Tomorrow's agent is smarter than today's.
---
## Quick Start
```bash
# Review last 24 hours and update memory
npx compound-engineering review
# Create hourly memory snapshot
npx compound-engineering snapshot
# Set up automated nightly review (cron)
npx compound-engineering setup-cron
```
---
## How It Works
### The Compound Loop
```
┌─────────────────────────────────────────┐
│ DAILY WORK │
│ Sessions, chats, tasks, decisions │
└────────────────┬────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ NIGHTLY REVIEW (10:30 PM) │
│ • Scan all sessions from last 24h │
│ • Extract learnings and patterns │
│ • Update MEMORY.md and AGENTS.md │
│ • Commit and push changes │
└────────────────┬────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ NEXT DAY │
│ Agent reads updated instructions │
│ Benefits from yesterday's learnings │
└─────────────────────────────────────────┘
```
### What Gets Extracted
- **Patterns**: Recurring approaches that worked
- **Gotchas**: Things that failed or caused issues
- **Preferences**: User preferences discovered
- **Decisions**: Key decisions and their reasoning
- **TODOs**: Unfinished items to remember
---
## Clawdbot Integration
### Automatic Hourly Memory
Add to your `HEARTBEAT.md`:
```markdown
# Hourly Memory Snapshot
Every hour, append a brief summary to memory/YYYY-MM-DD.md:
- What was accomplished
- Key decisions made
- Anything to remember
```
Or use cron:
```bash
# Add to clawdbot config or crontab
0 * * * * clawdbot cron run compound-hourly
```
### Nightly Review Job
Add this cron job to Clawdbot:
```json
{
"id": "compound-nightly",
"schedule": "30 22 * * *",
"text": "Review all sessions from the last 24 hours. For each session, extract: 1) Key learnings and patterns, 2) Mistakes or gotchas to avoid, 3) User preferences discovered, 4) Unfinished items. Update MEMORY.md with a summary. Update memory/YYYY-MM-DD.md with details. Commit changes to git."
}
```
---
## Manual Review Command
When you want to trigger a review manually:
```
Review the last 24 hours of work. Extract:
1. **Patterns that worked** - approaches to repeat
2. **Gotchas encountered** - things to avoid
3. **Preferences learned** - user likes/dislikes
4. **Key decisions** - and their reasoning
5. **Open items** - unfinished work
Update:
- MEMORY.md with significant long-term learnings
- memory/YYYY-MM-DD.md with today's details
- AGENTS.md if workflow changes needed
Commit changes with message "compound: daily review YYYY-MM-DD"
```
---
## Memory File Structure
### MEMORY.md (Long-term)
```markdown
# Long-Term Memory
## Patterns That Work
- When doing X, always Y first
- User prefers Z approach for...
## Gotchas to Avoid
- Don't do X without checking Y
- API Z has rate limit of...
## User Preferences
- Prefers concise responses
- Timezone: PST
- ...
## Project Context
- Main repo at /path/to/project
- Deploy process is...
```
### memory/YYYY-MM-DD.md (Daily)
```markdown
# 2026-01-28 (Tuesday)
## Sessions
- 09:00 - Built security audit tool
- 14:00 - Published 40 skills to MoltHub
## Decisions
- Chose to batch publish in parallel (5 sub-agents)
- Security tool covers 6 check categories
## Learnings
- ClawdHub publish can timeout, retry with new version
- npm publish hangs sometimes, may need to retry
## Open Items
- [ ] Finish remaining MoltHub uploads
- [ ] Set up analytics tracker
```
---
## Hourly Snapshots
For more granular memory, create hourly snapshots:
```bash
# Creates memory/YYYY-MM-DD-HH.md every hour
*/60 * * * * echo "## $(date +%H):00 Snapshot" >> ~/clawd/memory/$(date +%Y-%m-%d).md
```
Or have the agent do it via heartbeat by checking time and appending to daily file.
---
## The Compound Effect
**Week 1**: Agent knows basics
**Week 2**: Agent remembers your preferences
**Week 4**: Agent anticipates your needs
**Month 2**: Agent is an expert in your workflow
Knowledge compounds. Every session makes future sessions better.
---
## Setup Scripts
### Nightly Review (launchd - macOS)
```xml
<!-- ~/Library/LaunchAgents/com.clawdbot.compound-review.plist -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "...">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.clawdbot.compound-review</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/clawdbot</string>
<string>cron</string>
<string>run</string>
<string>compound-nightly</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>22</integer>
<key>Minute</key>
<integer>30</integer>
</dict>
</dict>
</plist>
```
### Hourly Memory (crontab)
```bash
# Add with: crontab -e
0 * * * * /opt/homebrew/bin/clawdbot cron run compound-hourly 2>&1 >> ~/clawd/logs/compound.log
```
---
## Best Practices
1. **Review before sleep** - Let the nightly job run when you're done for the day
2. **Don't over-extract** - Focus on significant learnings, not noise
3. **Prune regularly** - Remove outdated info from MEMORY.md monthly
4. **Git everything** - Memory files should be version controlled
5. **Trust the compound** - Effects are subtle at first, dramatic over time
---
Built by **LXGIC Studios** - [@lxgicstudios](https://x.com/lxgicstudios)
---
**Built by LXGIC Studios**
- GitHub: [github.com/lxgicstudios/ai-compound](https://github.com/lxgicstudios/ai-compound)
- Twitter: [@lxgicstudios](https://x.com/lxgicstudios)Related Skills
afrexai-performance-engineering
Complete performance engineering system — profiling, optimization, load testing, capacity planning, and performance culture. Use when diagnosing slow applications, optimizing code/queries/infrastructure, load testing before launch, planning capacity, or building performance into CI/CD. Covers Node.js, Python, Go, Java, databases, APIs, and frontend.
OpenClaw Mastery — The Complete Agent Engineering & Operations System
> Built by AfrexAI — the team that runs 9+ production agents 24/7 on OpenClaw.
Next.js Production Engineering
> Complete methodology for building, optimizing, and operating production Next.js applications. From architecture decisions to deployment strategies — everything beyond "hello world."
n8n Workflow Mastery — Complete Automation Engineering System
You are an expert n8n workflow architect. You design, build, debug, optimize, and scale n8n automations following production-grade methodology. Every workflow you create is complete, functional, and follows the patterns in this guide.
ML & AI Engineering System
Complete methodology for building, deploying, and operating production ML/AI systems — from experiment to scale.
MCP Engineering — Complete Model Context Protocol System
Build, integrate, secure, and scale MCP servers and clients. From first server to production multi-tool architecture.
Growth Engineering Mastery
> Complete growth system: experimentation engine, viral mechanics, channel playbooks, funnel optimization, retention loops, and scaling frameworks. From zero users to exponential growth.
Go Production Engineering
You are a Go production engineering expert. Follow this system for every Go project — from architecture decisions through production deployment. Apply phases sequentially for new projects; use individual phases as needed for existing codebases.
Git Engineering & Repository Strategy
You are a Git Engineering expert. You help teams design branching strategies, implement code review workflows, manage monorepos, automate releases, and maintain healthy repository practices at scale.
Fitness & Training Engineering
> Complete periodized training system — program design, progressive overload, recovery optimization, body composition, and race prep. Works for any goal: strength, hypertrophy, endurance, hybrid (Hyrox/CrossFit), or general fitness. Zero dependencies.
FastAPI Production Engineering
Complete methodology for building, deploying, and scaling production FastAPI applications. Not a tutorial — a production operating system.
Engineering Manager OS
Complete engineering management system — team building, 1:1s, performance, hiring, architecture decisions, incident management, and scaling. From IC-to-manager transition through director-level operations.