Awake
A self-improving autonomous development system — an AI that analyzes its own codebase, decides what to build, ships features, and opens PRs without human input
At a Glance
- Role
- Architecture & System Design
- Timeline
- 1 month
- Tech Stack
- PythonPure stdlibReactGitHub Actions
The Problem
Most AI coding tools are reactive. You tell them what to build, they build it. The human is still the bottleneck — deciding what matters, prioritizing work, writing tickets, reviewing output.
We wanted to flip that. What happens when you give an AI the ability to analyze its own codebase, decide what needs work, build the fix, write tests, and ship a PR — then do it again the next session, learning from what it built last time?
Not a copilot. Not an assistant. An autonomous development system that improves itself.
What We Built
Awake is a self-improving autonomous development system. An AI runs overnight, analyzes the repository, identifies what matters most, ships features, writes tests, and opens a pull request. Then it does it again the next session, reading its own history to decide what comes next.
33 sessions. 57 PRs. 68 modules. 2,496+ tests. 23,000+ lines of Python. Zero human commits.
The Pipeline
Every session follows the same five-step pipeline:
1. Analyze — The system runs health checks, code stats, complexity analysis, coverage reports, and dependency scans across the entire codebase. Every module gets scored.
2. Decide — The Brain engine (a five-dimension scoring model) ranks candidate tasks by urgency, health impact, complexity fit, roadmap alignment, and cross-module synergy. The top-ranked task becomes the session's work.
3. Build — The AI writes code, writes tests, updates the CLI, updates the API. All new functionality follows existing patterns automatically because the system reads its own code before writing.
4. Verify — Full test suite runs. All tests must pass. If they don't, the AI fixes them before proceeding.
5. Ship — Git commit, open PR, append session log to AWAKE_LOG.md. The log becomes the system's memory for the next session.
The Brain
The decision engine is a transparent scoring model. Every module in the codebase gets scored against five independent signals:
| Signal | Weight | What It Measures |
|---|---|---|
| Issue urgency | 35% | Human-priority issues, bug severity, comment count |
| Roadmap alignment | 25% | Whether the task appears in the backlog |
| Health improvement | 20% | Impact on low-scoring health areas |
| Complexity fit | 10% | Neither trivially small nor unreachably large |
| Cross-module synergy | 10% | Touches multiple modules for higher leverage |
The brain produces a ranked task queue with full score breakdowns. The AI doesn't guess what to work on — it computes it.
Metacognition
Session 18 introduced self-reflection. The system can now analyze its own development history.
awake reflect scores every past session for quality, generates a heatmap of productivity patterns, ranks what improved versus what regressed, and forecasts what it should build next.
awake evolve runs gap analysis against the system's growth trajectory and proposes its own evolution — tiered from quick wins to ambitious explorations.
awake insights analyzes the full history of its own creation: velocity trends, streak detection, contribution ratios, anomaly identification. It can tell you things like "Session 5 was the most productive night: 14 PRs in a single session" or "43% of all tasks are code analysis tools."
The system studies itself the same way it studies the code.
What It Built (Itself)
Over 33 sessions, the system autonomously created:
Analysis tools — Code complexity scoring (McCabe), dependency coupling detection, module risk assessment, health trend tracking, anomaly detection (IQR-based statistical analysis across 5 dimensions), blame attribution, churn analysis.
Intelligence — The Brain decision engine, session planner (plans its own next session), coverage tracking, TODO hunting, test quality scoring, maturity assessment, predictive analytics.
Metacognition — Self-reflection engine, evolution proposals, session insights with pattern recognition, growth trajectory analysis.
Infrastructure — 55 CLI commands, 39 REST API endpoints, React dashboard, OpenAPI spec generation, CI gate automation, badge generation, docstring auto-generation, nightly digest reports.
Quality — 2,496+ tests with every feature. Coverage gates that prevent shipping untested code. The system tests its own testing infrastructure.
Zero Dependencies
The entire system runs on Python's standard library. No requests, no click, no pytest runtime deps. Pure stdlib. This was a deliberate constraint — the system had to be self-contained.
Test dependencies (pytest) are dev-only. The production CLI and all modules run without any pip install beyond the project itself.
Technical Details
The Session Log as Memory
AWAKE_LOG.md is the system's long-term memory. Every session appends a structured entry: what was planned, what was built, what the metrics looked like before and after. The AI reads this log at the start of each session to understand where it left off and what the codebase's trajectory looks like.
This is the same pattern used in agent memory systems — markdown as the persistence layer, structured enough for machines to parse, readable enough for humans to audit.
The CLI
55 commands covering every aspect of the system:
awake health # Full codebase health check
awake brain # What should I work on next?
awake status # Comprehensive snapshot
awake reflect # Score and analyze past sessions
awake evolve # Gap analysis + evolution proposals
awake insights # History of the system's own creation
awake anomalies # Statistical anomaly detection
awake complexity # McCabe complexity per module
awake coupling # Dependency analysis
awake predict # Forecast next session metrics
awake docstrings # Auto-generate missing docstrings
awake dashboard # Launch the React UI
Each command is independently useful. A human developer can run awake health on any Python project and get immediate value — the tool isn't limited to self-improvement mode.
The API
39 REST endpoints expose every analysis capability over HTTP. The React dashboard consumes these for visualization, but any tool can call them. Full OpenAPI spec auto-generated from the codebase.
Growth Trajectory
| Session | Modules | Tests | PRs | Key Milestone |
|---|---|---|---|---|
| 0 | 4 | 0 | 1 | Scaffold |
| 5 | 18 | 312 | 15 | Biggest single session (14 PRs) |
| 13 | 45 | 1,200+ | 35 | Coverage gates, health scoring |
| 18 | 55 | 1,800+ | 45 | Metacognition (reflect + evolve) |
| 24 | 63 | 2,200+ | 53 | Self-insights, complexity analysis |
| 33 | 68 | 2,496+ | 57 | Session planner, anomaly detection |
The system's velocity has varied — some sessions ship 14 PRs, others focus on stabilization and maintenance. Session 32 was the first maintenance-only session, where the system chose to fix existing code rather than build new features. That's a sign of maturity.
What We Learned
Transparent decisions matter more than smart ones. The Brain's scoring model is simple (weighted sum of 5 signals). But because every score is decomposable — you can see exactly why a task ranked where it did — the system's choices are auditable. Black-box prioritization would be faster to build but impossible to trust.
Memory format determines capability. AWAKE_LOG.md is both the system's memory and its training signal. Structured entries (tasks completed, metrics before/after, PR numbers) give the metacognition layer something concrete to analyze. If the log were unstructured prose, the reflect and insights commands wouldn't be possible.
Self-improvement has diminishing returns per session. Early sessions shipped massive feature additions. Later sessions increasingly chose maintenance, stabilization, and refinement. This isn't a problem — it's the system correctly recognizing that the marginal value of new features decreases as the codebase matures. A system that always ships new features and never maintains is broken.
Zero dependencies was worth the cost. Building everything on stdlib was slower. But it meant the system never hit dependency conflicts, never had to manage version pinning, and could focus entirely on its own logic. For a system that modifies its own code, external dependencies are attack surface.
This experiment was designed and built by Parallel Studio. We build autonomous AI systems that operate independently with transparent decision-making and human-auditable outputs. Tell us about your project.