Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"Write(*.md)",
"Write(*.ts)",
"Edit(*.css)",
"Bash(ls*)"
"Bash(ls*)",
"Bash(ssh*)",
"Bash(curl*)"
],
"deny": []
},
Expand Down
75 changes: 75 additions & 0 deletions .claude/skills/analyze-logs/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
description: Analyze runtime logs, evolve logs, and agent logs to identify error patterns, repeated failures, and evolution opportunities. Use when asked to review logs, diagnose issues, or find improvement areas.
user-invocable: true
argument-hint: "[hours=24] [level=error|warn|all]"
---

# Analyze Logs Skill

Scan all available log sources, identify patterns, and produce an actionable report for self-improvement.

## Log Sources

1. **Runtime Log** (`~/.claude/runtime.log`) — Captured console.error/warn/log from the running process (JSONL format)
2. **Evolve Log** (`~/.claude/evolve-log.jsonl`) — Self-evolution history: what was changed, tsc pass/fail, restart count
3. **Agent Logs** (`~/.claude/tasks/conversations/*.log`) — Background agent execution results
4. **Session History** (`~/.claude/history.jsonl`) — User input history across sessions

## Analysis Steps

### Step 1: Read Runtime Logs
Read `~/.claude/runtime.log` (the main log file). Parse JSONL entries. Focus on:
- **error** level entries: categorize by module, extract patterns
- **warn** level entries: identify recurring warnings
- Count entries by module to find "noisy" components
- Identify time clusters (many errors at once = incident)

### Step 2: Read Evolve Log
Read `~/.claude/evolve-log.jsonl`. Analyze:
- Which modules were modified most frequently (indicates instability)
- tsc failures (what caused them?)
- Patterns in "reason" field — recurring themes

### Step 3: Scan Agent Logs
Grep across `~/.claude/tasks/conversations/*.log` for:
- Errors other than "Task cancelled by user" and "Test error"
- Stack traces
- Timeout patterns
- Empty log files (indicates logging bugs)

### Step 4: Cross-Reference
- Do runtime errors correlate with evolve changes? (regression detection)
- Do agent failures cluster around certain time periods?
- Are there modules that appear in both runtime errors AND evolve log? (unstable modules)

## Output Format

Produce a structured report:

```
## Log Analysis Report (last N hours)

### Runtime Errors Summary
- Total entries: X (errors: Y, warns: Z)
- Top error modules: [Module]: count
- Error patterns: [description]

### Evolution Health
- Total evolves: X (success: Y, tsc fail: Z)
- Most modified modules: [module]: count
- Unstable modules (evolved 3+ times): [list]

### Agent Health
- Total agent tasks: X (completed: Y, failed: Z, cancelled: W)
- Real failures (excluding cancels): [list with details]

### Recommendations
1. [Specific actionable recommendation]
2. [Another recommendation]
```

## Important Notes
- Only do READ operations. Never modify any log files.
- If runtime.log doesn't exist yet, note that the Logger was just installed and skip that section.
- Use Grep with `head_limit` when scanning large directories to avoid timeout.
- Write key findings to the project notebook so they persist across sessions.
133 changes: 133 additions & 0 deletions docs/marketing/discord.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Discord Promotion Posts

## Target Communities

1. Anthropic / Claude Community Discord
2. AI Developer Communities (Cline, Roo Code, Cursor, Windsurf, etc.)
3. Open Source / Coding Communities
4. Your own Discord: https://discord.gg/bNyJKk6PVZ

---

## Post 1: General AI/Dev Communities (English)

### Title / First Line
**I built an open-source Claude Code with a full Web IDE and multi-agent system**

### Body

Hey everyone! I've been working on an open-source AI coding platform called **Claude Code Open** - it started as a reverse-engineering study of Anthropic's Claude Code CLI but evolved into something much bigger.

**What makes it different:**

**Web IDE** - Not just a terminal. It's a full browser-based IDE with Monaco editor, file tree, AI-enhanced code editing, terminal panel, and Git integration. Open `localhost:3456` and start coding.

**Blueprint Multi-Agent System** - Break complex tasks into subtasks and dispatch them across multiple AI agents working in parallel. Smart Planner analyzes requirements, Lead Agent coordinates, Workers execute. Real-time Swarm Console shows everything happening.

**37+ Built-in Tools** - File ops, ripgrep search, shell, Playwright browser automation, database client (PostgreSQL/MySQL/SQLite/Redis/MongoDB), DAP debugger, LSP, scheduled task daemon, and more.

**Self-Evolution** - The AI can modify its own source code, run TypeScript compilation checks, and hot-reload. Full audit log for safety.

**One-Click Install** - Scripts for Windows/macOS/Linux. Docker support too.

Everything runs locally. MIT licensed. No telemetry. Supports Anthropic API / AWS Bedrock / Google Vertex AI.

- GitHub: https://github.com/kill136/claude-code-open
- Live Demo: http://voicegpt.site:3456/
- Website: https://www.chatbi.site
- Discord: https://discord.gg/bNyJKk6PVZ

Would love your feedback!

---

## Post 2: Claude/Anthropic Specific Communities (English)

### Title / First Line
**Open-source Claude Code alternative with Web UI - 37+ tools, multi-agent, runs locally**

### Body

Built an open-source platform that extends what Claude Code can do:

- **Browser-based IDE** instead of terminal-only - Monaco editor, file tree, inline AI code review
- **Multi-agent orchestration** - Blueprint system breaks complex projects across parallel AI agents
- **Database client** - Connect to PostgreSQL, MySQL, SQLite, Redis, MongoDB directly from conversation
- **Scheduled automation** - "Every morning at 9am, review yesterday's commits and notify me"
- **Self-evolution** - AI modifies its own source code with safety checks
- **MCP protocol** support for external tool integration

One-click install for Windows/macOS/Linux. Docker deployment. MIT licensed.

Try the live demo: http://voicegpt.site:3456/
GitHub: https://github.com/kill136/claude-code-open

Star it if you find it useful!

---

## Post 3: Chinese Communities (中文)

### Title / First Line
**开源了一个 Claude Code 替代品:Web IDE + 多智能体 + 37+ 工具,一键安装**

### Body

大家好!分享一个我做的开源项目 **Claude Code Open**,一个完整的 AI 编程平台。

**和官方 Claude Code 的区别:**

1. **有 Web IDE** — 浏览器打开就能用,Monaco 编辑器 + 文件树 + AI 辅助编辑,不需要终端
2. **多智能体协作** — Blueprint 系统把复杂任务拆分给多个 AI Agent 并行处理
3. **37+ 内置工具** — 文件操作、数据库客户端、浏览器自动化、调试器、定时任务等
4. **自我进化** — AI 可以修改自己的源码并热重载
5. **一键安装** — Windows/macOS/Linux 一条命令搞定

MIT 协议,完全开源,数据不出你的机器。

在线体验:http://voicegpt.site:3456/
GitHub:https://github.com/kill136/claude-code-open
Discord:https://discord.gg/bNyJKk6PVZ

欢迎 Star 和反馈!

---

## Post 4: Short Version (for channels with character limits)

**Claude Code Open** - Open-source AI coding platform with Web IDE, multi-agent system, 37+ tools.

Features: Browser IDE, Blueprint multi-agent, database client, scheduled tasks, self-evolution, MCP support.

MIT licensed. One-click install. Runs locally.

GitHub: https://github.com/kill136/claude-code-open
Demo: http://voicegpt.site:3456/

---

## Discord Servers to Post In

### Already posted (from project notebook):
- Cline
- Roo Code
- WeMakeDevs
- Cursor
- Windsurf

### New targets:
1. **Anthropic Community** - discord.gg/anthropic (if exists)
2. **Claude Users** - search for Claude-focused servers
3. **AI Tools / AI Coding** - general AI developer communities
4. **Open Source** - open source project showcase channels
5. **TypeScript / Node.js** - language-specific communities
6. **Vibe Coding** - communities for AI-assisted development
7. **IndieHackers** - indie developer communities
8. **AI Agent Builders** - communities focused on AI agents

### Posting Tips:
- Post in #showcase, #projects, #share-your-work, or #self-promotion channels
- Don't spam - one post per server
- Engage with comments/questions after posting
- Include the live demo link - it's the best proof
- Post during peak hours (US morning / evening)
20 changes: 20 additions & 0 deletions src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ export interface UserProfileResponse {
const AUTH_DIR = path.join(os.homedir(), '.claude');
const AUTH_FILE = path.join(AUTH_DIR, 'auth.json');
const CREDENTIALS_FILE = path.join(AUTH_DIR, 'credentials.json');
// 用户配置文件(Web UI 保存的 apiKey 等配置)
const SETTINGS_FILE = path.join(AUTH_DIR, 'settings.json');
// 官方 Claude Code 的配置文件(存储 primaryApiKey)
const CONFIG_FILE = path.join(AUTH_DIR, 'config.json');
// 官方 Claude Code 的 OAuth 凭据文件(存储 claudeAiOauth)
Expand Down Expand Up @@ -269,6 +271,24 @@ export function initAuth(): AuthConfig | null {
return currentAuth;
}

// 1c. 检查 settings.json 的 apiKey(Web UI 配置)
// 用户在 Web UI 设置页面保存的 API Key,优先级高于 OAuth token 和内置代理
if (fs.existsSync(SETTINGS_FILE)) {
try {
const settings = JSON.parse(fs.readFileSync(SETTINGS_FILE, 'utf-8'));
if (settings.apiKey) {
currentAuth = {
type: 'api_key',
accountType: 'api',
apiKey: settings.apiKey,
};
return currentAuth;
}
} catch (err) {
// 忽略解析错误
}
}

// 2. 检查官方 Claude Code 的 .credentials.json(OAuth token)
//
// 重要发现(通过抓包和测试发现):
Expand Down
2 changes: 1 addition & 1 deletion src/browser/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function killProc(proc: ChildProcessWithoutNullStreams): void {
// Windows: use taskkill for reliable termination
try {
if (proc.pid) {
execSync(`taskkill /pid ${proc.pid} /T /F`, { stdio: 'ignore' });
execSync(`taskkill /pid ${proc.pid} /T /F`, { stdio: 'ignore', windowsHide: true });
}
} catch {
proc.kill();
Expand Down
4 changes: 4 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ import {
FAST_MODE_DISPLAY_NAME,
forcePrefetchPenguinMode,
} from './fast-mode/index.js';
import { logger } from './utils/logger.js';

// 初始化运行时日志系统(CLI 模式)
logger.init({ interceptConsole: true, minLevel: 'info' });

// 工作目录列表
const additionalDirectories: string[] = [];
Expand Down
Loading
Loading