An Autonomous AI Software Engineer
# Add to your Claude Code skills
git clone https://github.com/olasunkanmi-SE/codebuddyRead the DOCS
CodeBuddy is a multi-agent AI software engineer that operates inside VS Code. It plans, writes, debugs, tests, documents, and deploys entire features autonomously -- reading your codebase, running terminal commands, editing files, searching the web, and correcting its own mistakes until the task is done.
It supports 10 AI providers (cloud and local), over 20 built-in tools, 16 bundled skill integrations, a Model Context Protocol gateway for unlimited extensibility, enterprise-grade security controls, and full internationalization in 7 languages.
No comments yet. Be the first to share your thoughts!
CodeBuddy is built on an event-driven, layered architecture designed for extensibility, provider-agnosticism, and real-time streaming.
The Orchestrator is a singleton event bus at the center of the system. Every subsystem communicates exclusively through publish/subscribe events. The Orchestrator never calls services directly -- it emits typed events and listeners react independently. This fully decouples the agent layer, webview layer, and service layer from one another.
User message (webview)
--> BaseWebViewProvider receives via onDidReceiveMessage
--> InputValidator sanitizes input
--> ConcurrencyQueueService gates admission (priority-aware semaphore)
--> MessageHandler routes to CodeBuddyAgentService
--> DeveloperAgent invokes createDeepAgent()
--> LangGraph graph executes (reason -> act -> observe loop)
--> Tools execute (file edit, terminal, search, MCP, etc.)
--> Stream events emitted per token / per tool call
--> AgentSafetyGuard enforces event/tool/duration limits
--> ProviderFailoverService retries on alternate providers
--> Events flow back through Orchestrator
--> WebViewProvider forwards to webview via postMessage
User sees streamed response with real-time tool activity indicators
The extension host and the React webview communicate over a bidirectional postMessage protocol. The webview sends structured commands. The extension responds with typed events.
| Layer | Mechanism | Purpose |
| ---------------------- | --------------------------------------------- | ------------------------------------------------------------- |
| In-memory cache | TTL-based Map (Memory singleton) | Session data, model references, transient state |
| File storage | .codebuddy/ workspace directory | Agent state snapshots, memories, tasks, rules |
| SQLite | sql.js (WASM) with FTS4 full-text search | Codebase analysis, persistent structured data, keyword search |
| LangGraph checkpointer | SqljsCheckpointSaver (SQLite-backed) | Multi-turn conversation threads with resumable state |
| VS Code SecretStorage | Encrypted OS keychain | API keys and credentials |
| Vector store | SqliteVectorStore with pre-normalized vectors | Workspace embeddings for semantic search |
| Credential proxy | In-process HTTP proxy on 127.0.0.1 | Session-token-authenticated credential injection for LLM SDK |
CodeBuddy uses Tree-sitter WASM binaries for accurate AST parsing across 7 languages, powering codebase analysis, symbol extraction, and the code indexing worker thread:
| Language | Binary |
| ---------- | ----------------------------- |
| JavaScript | tree-sitter-javascript.wasm |
| TypeScript | tree-sitter-tsx.wasm |
| Python | tree-sitter-python.wasm |
| Go | tree-sitter-go.wasm |
| Java | tree-sitter-java.wasm |
| Rust | tree-sitter-rust.wasm |
| PHP | tree-sitter-php.wasm |
CodeBuddy uses a multi-agent architecture built on the LangGraph DeepAgents framework. A Developer Agent coordinates the work, with seven specialized subagents that each receive role-specific filtered tools:
| Subagent | Responsibility | | -------------- | ------------------------------------------------------------------------------------- | | Code Analyzer | Deep code review, bug identification, complexity analysis, anti-pattern detection | | Doc Writer | Technical documentation, API references, README generation, tutorials | | Debugger | Error investigation, stack trace analysis, root cause identification, fix proposals | | File Organizer | Directory restructuring, file renaming, project layout optimization | | Architect | System design, pattern selection, architecture decision records, scalability planning | | Reviewer | Code quality enforcement, security review, best practices, style compliance | | Tester | Test strategy, unit/integration test generation, test execution and validation |
When the agent encounters a failure -- a build error, a failed test, an invalid command output -- it does not stop. It reads the error, analyzes the root cause, applies a correction, and retries. This loop continues until the task succeeds or the agent determines the issue requires human intervention.
The AgentSafetyGuard enforces hard limits on every agent stream to prevent runaway execution:
The ProductionSafeguards service provides a circuit breaker with CLOSED/OPEN/HALF_OPEN states and 5 recovery strategies for handling sustained failures.
Destructive operations (such as file deletion) trigger an interrupt that pauses execution and asks for explicit approval. The user can approve, edit, or reject the proposed action before the agent continues.
The CheckpointService saves agent execution state to SQLite, enabling resumable conversations. Before each agent operation, a named checkpoint is created so work can be restored if the session is interrupted.
The ConcurrencyQueueService controls the maximum number of concurrent agent operations. When all slots are occupied, incoming requests are queued in priority-aware FIFO order and drained as slots free up.
AbortSignal or a timeout for cooperative cancellation. Runtime polyfills ensure compatibility across VS Code Electron versions.try/finally in the agent service ensures slots are always returned, even on stream failure or cancellation.Agent Mode -- Full autonomous execution. The agent has access to all tools: file creation and editing, terminal commands, web search, codebase analysis, MCP integrations, and debugger access. File changes go through the diff