You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,9 @@
68
68
- When a function receives an optional targeting parameter (e.g., `cwd`, `workspace_id`) and the value is provided but invalid, raise an error — do not silently fall back to a default target, as this causes the operation to succeed against the wrong resource
69
69
- When adding new operations in a domain where existing operations already accept a context/targeting parameter (e.g., `cwd` for worktree paths), propagate that parameter through all new operations in the same chain — backend endpoint, frontend service, React Query hook, and UI component
70
70
- When multiple endpoints share the same parameter validation (e.g., token presence check), extract it into a FastAPI dependency that raises on failure and returns the validated value — do not duplicate the check inline in each endpoint
71
+
- Do not extract a shared React hook when callers must add `useCallback`/`useMemo` wrappers that the inline version did not need — the per-call-site ceremony can exceed the duplication it removes
72
+
- When closing, cleaning up, or tearing down multiple independent resources in a loop, use `asyncio.gather(*[...], return_exceptions=True)` instead of sequential awaits — serializing I/O across independent resources wastes time, especially during shutdown or idle cleanup
73
+
- When catching a `ServiceException` subclass at the API boundary to produce an `HTTPException`, use `exc.status_code` from the exception — do not hardcode a status code constant (e.g., `HTTP_500`) that shadows the exception's own classification
- Run Claude Code and Codex from one self-hosted interface
25
+
- Keep each project in its own Docker or host sandbox
26
+
- Work in chat, editor, terminal, diff, secrets, and PR review views side by side
27
+
- Reuse the same workspace context across chats and sub-threads
28
+
- Manage MCP servers, agents, skills, commands, personas, env vars, and marketplace plugins from the app
30
29
31
30
## Core Architecture
32
31
33
32
```text
34
33
React/Vite Frontend
35
34
-> FastAPI Backend
36
-
-> PostgreSQL + Redis (web/docker mode)
35
+
-> PostgreSQL + Redis (web mode)
37
36
-> SQLite + in-memory cache/pubsub (desktop mode)
38
-
-> Sandbox runtime (Docker/Host)
39
-
-> Claude Code CLI + claude-agent-sdk
37
+
-> Workspace sandbox (Docker or Host)
38
+
-> Claude Code ACP / Codex ACP
39
+
-> Claude Code CLI / Codex CLI
40
40
```
41
41
42
-
### Claude Code harness
42
+
The app can launch either:
43
43
44
-
Agentrove runs chats through `claude-agent-sdk`, which drives the Claude Code CLI in the selected sandbox. This keeps Claude Code-native behavior for tools, session flow, permission modes, and MCP orchestration.
45
-
46
-
### Anthropic Bridge for non-Anthropic providers
47
-
48
-
For OpenAI, OpenRouter, and Copilot providers, Agentrove starts `anthropic-bridge` inside the sandbox and routes Claude Code requests through:
49
-
50
-
-`ANTHROPIC_BASE_URL=http://127.0.0.1:3456`
51
-
- provider-specific auth secrets such as `OPENROUTER_API_KEY` and `GITHUB_COPILOT_TOKEN`
52
-
- provider-scoped model IDs like `openai/gpt-5.2-codex`, `openrouter/moonshotai/kimi-k2.5`, `copilot/gpt-5.2-codex`
53
-
54
-
```text
55
-
Agentrove UI
56
-
-> Claude Agent SDK + Claude Code CLI
57
-
-> Anthropic-compatible request shape
58
-
-> Anthropic Bridge (OpenAI/OpenRouter/Copilot)
59
-
-> Target provider model
60
-
```
61
-
62
-
For Anthropic providers, Agentrove uses your Claude auth token directly. For custom providers, Agentrove calls your configured Anthropic-compatible `base_url`.
44
+
-**Claude** via `claude-agent-acp` + Claude Code
45
+
-**Codex** via `codex-acp` + Codex CLI
63
46
64
47
## Key Features
65
48
66
-
- Claude Code-native chat execution through `claude-agent-sdk`
67
-
-Anthropic Bridge provider routing with provider-scoped models (`openai/*`, `openrouter/*`, `copilot/*`)
49
+
- Claude and Codex model selection in the same UI
50
+
-Agent-specific permission modes and reasoning/thinking modes
68
51
- Workspace-based project organization with per-workspace sandboxes
- Streaming architecture with resumable SSE events and explicit cancellation
72
-
- Built-in recurring task scheduler (in-process async, no worker service)
52
+
- Docker and host sandbox providers
53
+
- Built-in editor, terminal, diff, secrets, and PR review panels
54
+
- Git helpers for branches, commits, push/pull, and PR creation
55
+
- Streaming chat sessions with resumable SSE events and explicit cancellation
56
+
- Sub-threads for branching work from an existing chat
57
+
- Extension management for MCP servers, custom agents, skills, slash commands, personas, env vars, and marketplace plugins
58
+
- Web app and macOS desktop app
73
59
74
60
## Workspaces
75
61
76
-
Workspaces are the top-level organizational unit. Each workspace owns a dedicated sandbox and groups all related chats under one project context.
62
+
Workspaces are the top-level project unit. Each workspace owns a sandbox and groups related chats under one project context.
77
63
78
64
### Source types
79
65
80
-
-**Empty** — creates a new empty directory in the sandbox
81
-
-**Git clone** — clones a repository (HTTPS or SSH) into a fresh sandbox
82
-
-**Local folder** — mounts an existing directory from the host filesystem (host sandbox only)
66
+
-**Empty**: create a new empty directory
67
+
-**Git clone**: clone a repository into a fresh sandbox
68
+
-**Local folder**: mount an existing host directory when using the host sandbox
83
69
84
70
### Sandbox isolation
85
71
86
-
Each workspace gets its own sandbox instance (Docker container or host process). Chats within a workspace share the same filesystem, installed tools, and `.claude`configuration. Switching between workspaces switches the entire execution environment.
72
+
Each workspace gets its own sandbox instance. Chats in the same workspace share the same filesystem, installed tools, auth files, and `.claude`/ `.codex` resources.
87
73
88
74
### Per-workspace sandbox provider
89
75
90
-
When creating a workspace you can override the default sandbox provider (Docker or Host). The provider is locked at creation time — all chats in that workspace use the same provider.
0 commit comments