Multi-node clustering is optional (Redis Streams). Third-party gateways such as OpenClaw are optional integrations, not requirements: see docs/deployment/openclaw-mesh.md.
εη: https://github.com/NO-CHATBOT-REVOLUTION/full-self-coding
Run many AI coding agents in parallel on one codebase, each in an isolated worktree, with scope contracts to keep their changes from colliding.
Scale: defaults to 5 concurrent agents; merging is serial. With mock agents on one machine, 1000 independent tasks ran to completion in 7.7 minutes, and orchestration should not limit you below roughly 200 simultaneous agents. Real-agent memory, model rate limits and cost, and large repositories are not measured. Details and caveats: docs/reports/scale-bench.md (issue #10).
Status: the TypeScript implementation in
packages/is the current release. The core is being rewritten as a pure-Rust single binary (crates/, tracked in #2);fsc-scope(scope contracts, drift scoring, co-change coupling) is done and is checked against the TypeScript reference with golden tests. Module boundaries and import rules: MODULE_STRUCTURE.md.
Full Self Coding (FSC) is a sophisticated framework designed to automate software engineering tasks by running multiple AI coding agents (Claude Code, Gemini CLI, Codex, Cursor, and others) in parallel, each in an isolated git worktree or Docker container. It provides intelligent codebase analysis, task decomposition, automated code modification, and comprehensive reporting capabilities.
- π€ Multi-Agent Support: Integration with Claude Code, Gemini CLI, and extensible agent architecture
- π¦ Containerized Execution: Secure, isolated Docker-based task execution
- π Intelligent Analysis: Automated codebase analysis and task identification
- βοΈ Flexible Configuration: Hierarchical configuration system with environment variable support
- π Comprehensive Reporting: Detailed execution reports with git diff tracking
- π Parallel Processing: Multi-container parallel task execution with resource management
- π‘οΈ Robust Error Handling: Comprehensive error recovery and graceful degradation
| Shape | Needs | How |
|---|---|---|
| Single machine | Bun, git (Docker optional) | executionMode: "bare" (git worktree) or Docker |
| Multi-node | Redis | DistributedScheduler over Redis Streams; set FSC_REDIS_URL |
| Mesh with a gateway (optional) | OpenClaw, WireGuard | see docs/deployment/openclaw-mesh.md |
| Agent Type | Description | Container Image | Key Features |
|---|---|---|---|
| CLAUDE_CODE | Anthropic Claude Code integration | node:latest |
Advanced code analysis, natural language processing |
| GEMINI_CLI | Google Gemini CLI integration | node:latest |
Google's AI model integration, fast response |
| CODEX | OpenAI Codex integration (planned) | - | OpenAI GPT-based code completion |
FSC runs agents as native processes by default. Docker is an optional isolation mode, not a requirement.
| Mode | Isolation | Overhead | Best For |
|---|---|---|---|
| worktree (default) | One native git worktree per task, agent runs as a normal process | ~0 | Everyday use, many parallel agents |
| bare | Fresh git clone + spawned process | disk only | When worktrees are not suitable |
| docker (optional) | Full container isolation | ~200MB/agent | Untrusted code |
Select with --mode, the FSC_EXECUTION_MODE environment variable, or .fsc/config.json:
{
"executionMode": "worktree"
}The Agent Daemon is a long-running process that replaces the old per-task worker model. It manages a pool of agents, handles heartbeats, and exposes a local HTTP API.
Agent Daemon (port 18791)
βββ Agent Pool (pre-warmed agents, auto-scaling)
βββ Heartbeat + Resource Reporting
βββ Bubblewrap Sandbox (lightweight alternative to Docker)
βββ HTTP API (health, status, task submission)
Environment Variables:
| Variable | Default | Description |
|---|---|---|
AGENT_ID |
auto | Unique agent identifier |
MAX_AGENTS |
10 |
Maximum agents in pool |
MIN_AGENTS |
2 |
Minimum pre-warmed agents |
REDIS_URL |
redis://127.0.0.1:6379 |
Redis connection for distributed scheduling |
WORKSPACE |
. |
Working directory |
SANDBOX |
bubblewrap |
Sandbox backend (bubblewrap or docker) |
API_PORT |
18791 |
Local management API port |
Agents are expensive to create and destroy. The Agent Pool pre-warms N agents and reuses them across tasks β similar to how CUDA Streaming Multiprocessors reuse warps.
- Auto-scaling: Scales between
MIN_AGENTSandMAX_AGENTSbased on queue depth - Health checks: 30s interval, auto-recycles unhealthy agents
- Expiry: Idle agents are reclaimed after configurable TTL
For multi-node deployments, the DistributedScheduler uses Redis Streams for reliable task distribution:
Task Submit β Redis Stream (fsc:tasks) β Consumer Group β Node pulls β Execute β ACK
- Supports multiple consumer groups (one per node)
- At-least-once delivery with automatic retry on failure
- JSON task payloads with priority ordering
The CodeCommitter integrates governance hooks for automated quality control:
- QualityGateHook: Evaluates commits before merge β
APPROVE/REVIEW/REJECT - TrustUpdateHook: Updates agent trust score after task completion (feeds back into scheduling priority)
const committer = new CodeCommitter({
qualityGate: async (diff) => ({ decision: 'APPROVE', score: 0.95 }),
trustUpdate: async (agentId, result) => { /* update trust factor */ }
});Built-in health monitoring for multi-node deployments:
- Node connectivity (WireGuard + SSH fallback)
- Redis reachability
- Agent pool utilization per node
- Automatic alerting on node failures
- Bun (v1.0.0 or higher)
- Git (for repository operations and the default worktree execution mode)
- Docker (optional: only for
executionMode: "docker") - Redis (optional: only for multi-node scheduling)
- Rust stable (optional: only to build or test the
crates/workspace)
-
Install bun.js on your machine
curl -fsSL https://bun.sh/install | bash -
Clone and setup the project
git clone https://github.com/NO-CHATBOT-REVOLUTION/full-self-coding.git cd full-self-coding bun install -
Run on a repository
# Run CLI from source bun run start # Or run on a specific repository full-self-coding
The project is structured as a monorepo with two main packages:
- @full-self-coding/core: Core library for code analysis and task execution
- @full-self-coding/cli: Command-line interface
npm install @full-self-coding/corenpm install -g @full-self-coding/cli
# Then run:
full-self-coding-cliFull Self Coding uses a hierarchical configuration system with the following precedence (highest to lowest):
- Environment Variables (
FSC_*) - Project-level Configuration (
.fsc/config.json) - User Configuration (
~/.config/full-self-coding/config.json) - Default Values
| Field | Type | Default | Description |
|---|---|---|---|
agentType |
SWEAgentType |
CLAUDE_CODE |
AI agent to use (claude-code, gemini-cli) |
maxDockerContainers |
number |
10 |
Maximum Docker containers allowed |
maxParallelDockerContainers |
number |
3 |
Maximum parallel container execution |
dockerTimeoutSeconds |
number |
600 |
Docker command timeout in seconds |
dockerMemoryMB |
number |
1024 |
Docker container memory limit in MB |
dockerCpuCores |
number |
2 |
Docker container CPU core limit |
dockerImageRef |
string |
"node:latest" |
Docker image reference for containers |
maxTasks |
number |
100 |
Maximum tasks to generate during analysis |
minTasks |
number |
1 |
Minimum tasks to generate during analysis |
workStyle |
WorkStyle |
DEFAULT |
Work style (default, bold_genius, careful, etc.) |
customizedWorkStyle |
string |
- | Custom work style description |
codingStyleLevel |
number |
5 |
Coding style level (0-10) |
customizedCodingStyle |
string |
- | Custom coding style description |
anthropicAPIKey |
string |
- | Anthropic API key |
anthropicAPIBaseUrl |
string |
- | Custom Anthropic API base URL |
anthropicAPIKeyExportNeeded |
boolean |
true |
Whether to export Anthropic API key |
googleGeminiApiKey |
string |
- | Google Gemini API key |
googleGeminiAPIKeyExportNeeded |
boolean |
true |
Whether to export Gemini API key |
openAICodexApiKey |
string |
- | OpenAI Codex API key |
openAICodexAPIKeyExportNeeded |
boolean |
true |
Whether to export OpenAI API key |
{
"agentType": "claude-code",
"anthropicAPIKey": "sk-ant-api03-...",
"maxDockerContainers": 8,
"maxParallelDockerContainers": 4,
"dockerTimeoutSeconds": 600,
"dockerMemoryMB": 2048,
"workStyle": "bold_genius",
"customizedWorkStyle": "Focus on rapid prototyping and innovation"
}{
"agentType": "gemini-cli",
"googleGeminiApiKey": "AIzaSy...",
"maxTasks": 50,
"minTasks": 5,
"codingStyleLevel": 8,
"customizedCodingStyle": "Follow enterprise coding standards with comprehensive documentation"
}# API Keys
export FSC_ANTHROPIC_API_KEY="sk-ant-api03-..."
export FSC_GOOGLE_GEMINI_API_KEY="AIzaSy..."
export FSC_OPENAI_CODEX_API_KEY="sk-..."
# Docker Settings
export FSC_MAX_DOCKER_CONTAINERS=15
export FSC_DOCKER_TIMEOUT_SECONDS=900
export FSC_DOCKER_MEMORY_MB=4096
# Agent Configuration
export FSC_AGENT_TYPE="claude-code"
export FSC_WORK_STYLE="bold_genius"
export FSC_CODING_STYLE_LEVEL=9The CLI provides various options for configuration and execution:
full-self-coding-cli run [options]| Option | Short | Type | Description |
|---|---|---|---|
--agent-type |
-a |
string |
AI agent type (claude-code, gemini-cli) |
--config |
-c |
string |
Path to configuration file |
--help |
-h |
- | Show help information |
--version |
-V |
- | Show version information |
# Analyze current repository with default settings
full-self-coding-cli run
# Analyze with custom config
full-self-coding-cli run --config ./my-config.jsonimport { analyzeCodebase, TaskSolverManager, createConfig } from '@full-self-coding/core';
// Create configuration
const config = createConfig({
agentType: 'claude-code',
anthropicAPIKey: 'your-api-key'
});
// Analyze repository
const tasks = await analyzeCodebase(config, 'https://github.com/user/repo.git');
// Execute tasks
const taskSolver = new TaskSolverManager(config, 'https://github.com/user/repo.git');
for (const task of tasks) {
taskSolver.addTask(task);
}
await taskSolver.start();Manages configuration loading, validation, and merging.
import { ConfigReader, readConfigWithEnv } from '@full-self-coding/core';
// Read configuration with environment variable support
const config = readConfigWithEnv();
// Create custom configuration
import { createConfig } from '@full-self-coding/core';
const customConfig = createConfig({
agentType: 'claude-code',
anthropicAPIKey: 'your-api-key'
});Methods
readConfigWithEnv(): Config- Read config with environment variablescreateConfig(userConfig: Partial<Config>): Config- Create configuration from user configgetGitRemoteUrls(useSSH?: boolean): Promise<{fetchUrl: string, pushUrl: string}>- Get git remote URLs
Manages Docker container lifecycle and operations.
import { DockerInstance, DockerRunStatus } from '@full-self-coding/core';
const docker = new DockerInstance();
// Start container
const containerName = await docker.startContainer('node:latest', 'my-task');
// Run commands
const result = await docker.runCommands(['npm', 'install']);
// Copy files
await docker.copyFileToContainer('local.txt', '/app/remote.txt');
await docker.copyFilesToContainer('./src', '/app/src');
// Copy files from container
const content = await docker.copyFileFromContainer('/app/output.txt');
// Shutdown
await docker.shutdownContainer();Methods
startContainer(imageRef: string, taskName?: string): Promise<string>- Start new containerrunCommands(commands: string[], timeout?: number): Promise<DockerRunResult>- Execute commandscopyFileToContainer(localPath: string, containerPath: string): Promise<void>- Copy single filecopyFilesToContainer(localPath: string, containerPath: string): Promise<void>- Copy recursivelycopyFileFromContainer(containerPath: string): Promise<string>- Copy file from containershutdownContainer(): Promise<void>- Stop and remove container
Executes individual tasks within Docker containers.
import { TaskSolver, SWEAgentType } from '@full-self-coding/core';
const taskSolver = new TaskSolver(
config,
task,
SWEAgentType.CLAUDE_CODE,
'https://github.com/user/repo.git'
);
// Solve the task
await taskSolver.solve();
// Get results
const result = taskSolver.getResult();Methods
solve(shutdown?: boolean): Promise<void>- Execute the taskgetResult(): TaskResult- Get task execution result
Analyzes codebases and generates task lists.
import { analyzeCodebase } from '@full-self-coding/core';
// Analyze a repository
const tasks = await analyzeCodebase(
config,
'https://github.com/user/repo.git'
);interface Config {
agentType: SWEAgentType;
maxDockerContainers: number;
maxParallelDockerContainers: number;
dockerTimeoutSeconds: number;
dockerMemoryMB: number;
dockerCpuCores: number;
dockerImageRef: string;
maxTasks: number;
minTasks: number;
workStyle: WorkStyle;
customizedWorkStyle?: string;
codingStyleLevel: number;
customizedCodingStyle?: string;
anthropicAPIKey?: string;
anthropicAPIBaseUrl?: string;
anthropicAPIKeyExportNeeded: boolean;
googleGeminiApiKey?: string;
googleGeminiAPIKeyExportNeeded: boolean;
openAICodexApiKey?: string;
openAICodexAPIKeyExportNeeded: boolean;
}
enum SWEAgentType {
CLAUDE_CODE = 'claude-code',
GEMINI_CLI = 'gemini-cli',
CODEX = 'codex'
}
enum WorkStyle {
DEFAULT = 'default',
BOLDGENIUS = 'bold_genius',
CAREFUL = 'careful',
AGILE = 'agile',
RESEARCH = 'research'
}# Run all tests from project root
bun run test
# Or run from core package
cd packages/core
bun test
# Run with timeout
bun test --timeout 30000packages/core/test/
βββ dockerInstance.test.ts # Docker functionality tests
βββ configReaderSupplementary.test.ts # Configuration system tests
βββ taskSolverClaudeCode.test.ts # Claude Code task solver tests
βββ taskSolverGemini.test.ts # Gemini task solver tests
βββ integration/ # Integration tests
βββ full-workflow.test.ts # End-to-end workflow tests
βββ multi-agent.test.ts # Multi-agent integration tests
import { expect, test, describe, beforeAll, afterAll } from 'bun:test';
import { DockerInstance } from '@full-self-coding/core';
describe('DockerInstance', () => {
let docker: DockerInstance;
let containerName: string;
beforeAll(async () => {
docker = new DockerInstance();
containerName = await docker.startContainer('node:latest', 'test-container');
});
afterAll(async () => {
await docker.shutdownContainer();
});
test('should run simple commands', async () => {
const result = await docker.runCommands(['echo', 'hello']);
expect(result.status).toBe(DockerRunStatus.SUCCESS);
expect(result.output).toContain('hello');
});
});FSC creates isolated Docker containers for each task execution, ensuring:
- Security: Complete isolation from host system
- Consistency: Reproducible execution environments
- Parallelism: Multiple tasks can run simultaneously
- Resource Management: Controlled CPU and memory usage
- File copying (both directions)
- Command execution with timeout protection
- Real-time output streaming
- Resource monitoring
- Graceful shutdown
You can use custom Docker images:
{
"dockerImageRef": "custom/node:18-alpine",
"dockerMemoryMB": 1536,
"dockerCpuCores": 3
}# Check Docker daemon
docker --version
docker info
# Test container creation
docker run --rm hello-world# Add user to docker group (Linux)
sudo usermod -aG docker $USER
newgrp docker# Verify API key format
echo $FSC_ANTHROPIC_API_KEY | head -c 20
# Test API connectivity
curl -H "x-api-key: $FSC_ANTHROPIC_API_KEY" \
https://api.anthropic.com/v1/messages \
-d '{"model":"claude-3-sonnet-20240229","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}'Enable debug logging:
export DEBUG=fsc:*
node dist/main.js --debug https://github.com/user/repo.git{
"maxParallelDockerContainers": 2,
"dockerTimeoutSeconds": 900,
"dockerMemoryMB": 2048
}{
"maxTasks": 50,
"minTasks": 5
}-
Fork and clone
git clone https://github.com/NO-CHATBOT-REVOLUTION/full-self-coding.git cd full-self-coding -
Install development dependencies
bun install
- TypeScript: Strict mode enabled
- Pure TypeScript: No build step required
- Bun: Fast JavaScript runtime
# Run tests
bun run test
# Run development server
bun run dev
# Start CLI
bun run start- Coverage: Minimum 90% coverage required
- Unit Tests: All public methods must have tests
- Integration Tests: Critical workflows must be tested
# Run tests
bun run test
# Run tests with timeout
bun run test --timeout 30000-
Create feature branch
git checkout -b feature/new-feature
-
Make changes and test
bun run test -
Commit and push
git commit -m "feat: add new feature" git push origin feature/new-feature -
Create pull request
- Include comprehensive description
- Reference related issues
- Include test results
To add a new agent type:
-
Define enum value
// src/config.ts export enum SWEAgentType { CLAUDE_CODE = 'claude-code', GEMINI_CLI = 'gemini-cli', CODEX = 'codex', CUSTOM_AGENT = 'custom-agent' }
-
Implement agent commands
// src/SWEAgent/customAgentCommands.ts export function customAgentCommands( config: Config, task: Task, gitUrl: string ): string[] { // Implementation }
-
Update command builder
// src/SWEAgent/SWEAgentTaskSolverCommands.ts switch (agentType) { case SWEAgentType.CUSTOM_AGENT: return customAgentCommands(config, task, gitUrl); }
Define custom work styles by extending the WorkStyle enum and implementing corresponding prompt generation logic.
FSC supports integration with monitoring systems:
// Add custom metrics
import { MetricsCollector } from './src/metrics';
const metrics = new MetricsCollector();
metrics.recordTaskExecution(task, duration, success);
metrics.recordResourceUsage(containerId, cpu, memory);Configure logging levels and outputs:
import { Logger } from './src/logger';
const logger = new Logger({
level: 'debug',
output: 'file',
filename: 'fsc.log'
});- API Key Management: Use environment variables or secure vault
- Container Isolation: Containers run with limited privileges
- Network Access: Control container network access
- File System: Limit file system access within containers
This project is licensed under the MIT License. See the LICENSE file for details.
- Anthropic - For Claude Code integration
- Google - For Gemini CLI integration
- Docker - For containerization platform
- Bun - For fast JavaScript runtime
- GitHub Issues: Report bugs and request features
- Discussions: Community discussions and Q&A
- Documentation: Full documentation site (Coming Soon)
Built with β€οΈ by the Full Self Coding team