dual-brain 4.1.0 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md CHANGED
@@ -1,7 +1,33 @@
1
1
  # Dual-Brain Orchestrator
2
2
 
3
+ > Extension of data-tools by Steve Moraco. Requires replit-tools for full functionality.
4
+
3
5
  This project uses dual-provider orchestration. Config: `.claude/orchestrator.json`.
4
6
 
7
+ ## Ship Captain — Primary Workflow
8
+
9
+ The preferred way to start any task:
10
+
11
+ ```bash
12
+ npx dual-brain do "fix the auth bug and write tests"
13
+ ```
14
+
15
+ Automatically: decomposes goal → selects agents via intent detection → executes →
16
+ runs tests → quality gate → self-heals issues (2 retries) → creates branch → opens PR.
17
+
18
+ **Flags:**
19
+ - `--yolo` — skip confirmations (still runs tests/gate, never auto-merges)
20
+ - `--careful` — confirm every step
21
+ - `--plan-only` — preview the plan without executing
22
+ - `--no-pr` — skip PR creation
23
+
24
+ **Intent detection** routes goals automatically: `fix`/`add` → execute chain, `explore`/`understand` → search-then-execute chain, `review` → dual-brain review chain.
25
+
26
+ **Resume an incomplete run:**
27
+ ```bash
28
+ npx dual-brain resume
29
+ ```
30
+
5
31
  ## Tier Routing
6
32
 
7
33
  Route subagents by task complexity:
@@ -10,56 +36,96 @@ Route subagents by task complexity:
10
36
  - **Execute** (`model: "sonnet"`): Edits, tests, git ops. Return: files changed, tests run, edge cases.
11
37
  - **Think** (main session, Opus): Architecture, review, planning. Return: decision, alternatives, risks.
12
38
 
39
+ The `enforce-tier` hook **blocks** severe mismatches in auto/balanced/quality-first profiles rather than just warning.
40
+
41
+ ## Agent Templates
42
+
43
+ Pre-built specialist agents for common tasks:
44
+
45
+ ```bash
46
+ npx dual-brain agents # list all templates
47
+ ```
48
+
49
+ Templates include `explorer`, `fixer`, `reviewer`, `tester`, and more. Ship Captain selects the right template automatically based on intent detection.
50
+
51
+ ## Agent Chains
52
+
53
+ Multi-step workflows that compose templates:
54
+
55
+ ```bash
56
+ npx dual-brain chains # list all chains
57
+ npx dual-brain do "explore auth then fix" # auto-selects explore-then-fix chain
58
+ ```
59
+
60
+ Built-in chains: `explore-then-fix`, `test-and-fix`, `review-and-apply`.
61
+
13
62
  ## GPT Lane
14
63
 
15
64
  For isolated or parallel work, dispatch to GPT via Codex CLI:
16
65
 
17
- - `node .claude/hooks/gpt-work-dispatcher.mjs --task "..." --model gpt-5.4` — execution tasks
66
+ - `npx dual-brain dispatch --task "..." --model gpt-5.4` — execution tasks
18
67
 
19
68
  ## Dual-Brain Collaboration
20
69
 
21
- Dual-brain is a multi-round conversation between Claude and GPT — not a single-shot dispatch.
70
+ Think and review now auto-complete the full 2-round dialogue by default.
22
71
 
23
72
  **Think flow** (architecture decisions):
24
- 1. Round 1: `node .claude/hooks/dual-brain-think.mjs --question "..."`
25
- → GPT gives independent analysis
26
- 2. You analyze the same question independently
27
- 3. Round 2: `node .claude/hooks/dual-brain-think.mjs --question "..." --round 2 --claude-says "<your analysis>"`
28
- → GPT responds to your points: agreements, pushback, refined recommendation
73
+
74
+ ```bash
75
+ npx dual-brain think --question "should we use Redis?"
76
+ # → GPT Round 1 Claude analysis GPT Round 2 Synthesis
77
+ ```
78
+
79
+ Use `--manual` to step through rounds yourself:
80
+ 1. Round 1: `npx dual-brain think --question "..." --manual`
81
+ 2. You analyze independently
82
+ 3. Round 2: `npx dual-brain think --question "..." --round 2 --claude-says "<your analysis>"`
29
83
  4. You synthesize both rounds into a final decision
30
84
 
31
85
  **Review flow** (code review):
32
- 1. Round 1: `node .claude/hooks/dual-brain-review.mjs`
33
- → GPT reviews the diff independently
34
- 2. You review the same diff independently
35
- 3. Round 2: `node .claude/hooks/dual-brain-review.mjs --round 2 --claude-review "<your findings>"`
36
- → GPT confirms shared findings, acknowledges misses, disputes false positives
37
- 4. You synthesize into a final review verdict
86
+
87
+ ```bash
88
+ npx dual-brain review
89
+ # → GPT Round 1 Claude review GPT Round 2 Final verdict
90
+ ```
91
+
92
+ Use `--manual` for the old step-by-step flow.
38
93
 
39
94
  ## Routing Rules
40
95
 
41
96
  1. Tasks under 3 min → Claude (Codex startup overhead not worth it)
42
- 2. Isolated tasks over 3 min → check balance: `node .claude/hooks/budget-balancer.mjs`
43
- 3. High-risk decisions → dual-brain think
97
+ 2. Isolated tasks over 3 min → check balance: `npx dual-brain budget`
98
+ 3. High-risk decisions → dual-brain think (auto-triggered by hooks in auto mode)
44
99
  4. When a task spans tiers: think > execute > search
45
100
 
46
101
  ## Quality Gate
47
102
 
48
103
  Before ending a session with code changes:
49
- 1. Run `node .claude/hooks/session-report.mjs`
50
- 2. Run `node .claude/hooks/quality-gate.mjs`
104
+ 1. Run `npx dual-brain report`
105
+ 2. Run `npx dual-brain gate`
51
106
 
52
107
  Gate statuses: `pass` (safe to end), `issues_found` (fix first), `needs_human_review` (GPT unavailable).
53
108
 
109
+ **Self-healing:** When Ship Captain is running, gate issues are automatically fixed and retried up to 2 times. Test failures are also auto-fixed (2 retries) before surfacing to the user.
110
+
111
+ ## Recovery
112
+
113
+ ```bash
114
+ npx dual-brain doctor # check system health and report issues
115
+ npx dual-brain repair # fix corrupt files, stale locks, re-register hooks
116
+ npx dual-brain reset # clear all state files (keeps config/hooks)
117
+ npx dual-brain resume # resume last incomplete Ship Captain run
118
+ ```
119
+
54
120
  ## Profiles
55
121
 
56
122
  Active profile controls routing posture, budgets, and quality gate behavior.
57
123
  Profile persists to `.claude/dual-brain.profile.json` (gitignored).
58
124
 
59
- - **auto** (default): Adapts routing based on task risk, provider health, and outcomes. Uses file-path risk classification and failure-loop detection to auto-escalate when needed.
60
- - **balanced**: Best model per tier, normal budgets, reviews at medium+ risk
61
- - **cost-saver**: Prefer cheaper models, lower budgets, skip GPT for non-critical
62
- - **quality-first**: Dual-brain for medium+ risk, higher budgets, stricter reviews
125
+ - **auto** (default): Adapts routing based on task risk, provider health, and outcomes. Uses file-path risk classification and failure-loop detection to auto-escalate when needed. Blocks major tier mismatches.
126
+ - **balanced**: Best model per tier, normal budgets, reviews at medium+ risk. Blocks major mismatches.
127
+ - **cost-saver**: Prefer cheaper models, lower budgets, skip GPT for non-critical. Warns on major mismatches (does not block).
128
+ - **quality-first**: Dual-brain for medium+ risk, higher budgets, stricter reviews. Blocks minor and major mismatches.
63
129
 
64
130
  Switch profiles: `npx dual-brain mode cost-saver`
65
131
  Check status: `npx dual-brain status`
@@ -81,32 +147,61 @@ Casual natural language → structured work. The vibe coding system translates i
81
147
 
82
148
  **Intent compiler** — decompose multi-task requests:
83
149
  ```bash
84
- node .claude/hooks/vibe-router.mjs "fix the login bug and also update the nav"
150
+ npx dual-brain vibe "fix the login bug and also update the nav"
85
151
  ```
86
152
  Returns structured tasks with tier/risk classification, complexity level, quality gates, and wave strategy.
87
153
 
88
154
  **Plan generator** — Steve-style 3-part markdown plans:
89
155
  ```bash
90
- node .claude/hooks/plan-generator.mjs --utterance "..." [--write]
156
+ npx dual-brain plan --utterance "..." [--write]
91
157
  ```
92
158
  Generates: (1) dependency-ordered task table, (2) user stories + edge cases, (3) questions with suggested answers. Pass `--write` to save to `.claude/plans/`.
93
159
 
94
160
  **Durable memory** — preferences persist across sessions:
95
161
  ```bash
96
- node .claude/hooks/vibe-memory.mjs # show state
97
- node .claude/hooks/vibe-memory.mjs --set preferences.risk_tolerance=careful
98
- node .claude/hooks/vibe-memory.mjs --threads # active work
99
- node .claude/hooks/vibe-memory.mjs --infer # preference suggestions
162
+ npx dual-brain memory # show state
163
+ npx dual-brain memory --set preferences.risk_tolerance=careful
164
+ npx dual-brain memory --threads # active work
165
+ npx dual-brain memory --infer # preference suggestions
100
166
  ```
101
167
  Tracks preferred profile, risk tolerance, active threads, and learns from usage patterns.
102
168
 
103
169
  ## Available Tools
104
170
 
105
- - `node .claude/hooks/vibe-router.mjs "..."` decompose casual requests into structured work
106
- - `node .claude/hooks/plan-generator.mjs --utterance "..."` — generate execution plans
107
- - `node .claude/hooks/vibe-memory.mjs` — persistent preferences and work threads
108
- - `node .claude/hooks/cost-report.mjs` — activity and cost estimates
109
- - `node .claude/hooks/health-check.mjs` — verify system health
110
- - `node .claude/hooks/budget-balancer.mjs` — provider balance status
111
- - `node .claude/hooks/decision-ledger.mjs` — routing outcome insights
112
- - `node .claude/hooks/test-orchestrator.mjs` — run self-tests (40 tests)
171
+ All commands available via `npx dual-brain <command>`:
172
+
173
+ **Primary workflow:**
174
+ - `npx dual-brain do "..."` — Ship Captain: goal → plan → execute → gate → PR
175
+ - `npx dual-brain resume` — resume last incomplete run
176
+
177
+ **Collaboration:**
178
+ - `npx dual-brain think --question "..."` — dual-brain think (auto 2-round; `--manual` for step-by-step)
179
+ - `npx dual-brain review` — dual-brain code review (auto 2-round; `--manual` for step-by-step)
180
+ - `npx dual-brain dispatch --task "..."` — dispatch work to GPT
181
+
182
+ **Vibe coding:**
183
+ - `npx dual-brain vibe "..."` — decompose casual requests into structured work
184
+ - `npx dual-brain plan --utterance "..."` — generate execution plans
185
+ - `npx dual-brain memory` — persistent preferences and work threads
186
+
187
+ **Agents and chains:**
188
+ - `npx dual-brain agents` — list agent templates
189
+ - `npx dual-brain chains` — list agent chains
190
+
191
+ **Quality and reporting:**
192
+ - `npx dual-brain gate` — run quality gate
193
+ - `npx dual-brain report` — generate session report
194
+ - `npx dual-brain cost` — activity and cost estimates
195
+ - `npx dual-brain ledger` — routing outcome insights
196
+
197
+ **Profiles and config:**
198
+ - `npx dual-brain mode <profile>` — switch profile
199
+ - `npx dual-brain status` — current profile and provider health
200
+ - `npx dual-brain budget` — provider balance status
201
+
202
+ **Recovery:**
203
+ - `npx dual-brain doctor` — check system health and report issues
204
+ - `npx dual-brain repair` — fix corrupt files, stale locks, re-register hooks
205
+ - `npx dual-brain reset` — clear all state files (keeps config/hooks)
206
+ - `npx dual-brain health` — verify all hooks and dependencies
207
+ - `npx dual-brain test` — run self-tests (78 tests)
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Dual-Brain Orchestrator
2
2
 
3
+ > **Part of the [data-tools](https://github.com/stevemoraco) ecosystem by Steve Moraco**
4
+ >
5
+ > dual-brain extends data-tools/replit-tools with dual-provider AI orchestration.
6
+ > Best experienced with replit-tools installed for persistent auth, session management, and container survival.
7
+
3
8
  One command. Both brains. Auto-detected. Auto-configured. Default profile: **auto**.
4
9
 
5
10
  Dual-provider orchestration for Claude Code across Claude and OpenAI subscriptions. Routes search to cheap models, execution to mid-tier, thinking to the most capable. Dispatches work to GPT via Codex CLI. Dual-brain analysis for high-risk decisions.
@@ -36,10 +41,10 @@ npx -y dual-brain
36
41
 
37
42
  ## How it works
38
43
 
39
- **Two advisory hooks** are registered in `.claude/settings.json` and fire on each tool use. They detect and recommend — they do not execute actions without user confirmation:
44
+ **Two enforcement hooks** are registered in `.claude/settings.json` and fire on each tool use:
40
45
 
41
- - **enforce-tier.mjs** (PreToolUse on Agent): Classifies tasks, recommends the correct model tier, detects duplicates, suggests cross-provider routing
42
- - **cost-logger.mjs** (PostToolUse on all tools): Logs usage to daily rotated files for cost tracking
46
+ - **enforce-tier.mjs** (PreToolUse on Agent): Classifies tasks, assigns the correct model tier, detects duplicates, suggests cross-provider routing. **Blocks severe mismatches** — in auto/balanced/quality-first profiles, major tier mismatches return a hard block rather than a warning.
47
+ - **cost-logger.mjs** (PostToolUse on all tools): Logs usage to daily rotated files for cost tracking.
43
48
 
44
49
  **Three tiers route work by complexity:**
45
50
 
@@ -49,7 +54,28 @@ npx -y dual-brain
49
54
  | Execute | Sonnet | GPT-5.4 | edits, tests, git ops |
50
55
  | Think | Opus | GPT-5.5 | architecture, review, planning |
51
56
 
52
- **Dual-brain** is recommended automatically for high-risk decisions — hooks detect the risk level and suggest dual-brain analysis, where both providers think on the same problem independently.
57
+ **Dual-brain** is triggered automatically for high-risk decisions — hooks detect the risk level and initiate dual-brain analysis, where both providers think on the same problem independently. Think and review now run the full 2-round dialogue automatically in one command.
58
+
59
+ **Intent detection** — the Ship Captain reads your natural language goal and routes it to the right chain automatically: `fix` → execute, `explore`/`understand` → search-then-execute, `review` → dual-brain review.
60
+
61
+ **Self-healing** — gate issues and test failures are automatically retried up to 2 times before surfacing to the user.
62
+
63
+ ## Ship Captain — Intent to PR
64
+
65
+ One command does everything:
66
+
67
+ ```bash
68
+ npx dual-brain do "fix the auth bug and write tests"
69
+ ```
70
+
71
+ Automatically: decomposes goal → selects agents → executes → runs tests →
72
+ quality gate → self-heals issues (2 retries) → creates branch → opens PR.
73
+
74
+ Flags:
75
+ - `--yolo` — skip confirmations (still tests/gates, never merges)
76
+ - `--careful` — confirm every step
77
+ - `--plan-only` — preview without executing
78
+ - `--no-pr` — skip PR creation
53
79
 
54
80
  ## Vibe Coding
55
81
 
@@ -57,10 +83,10 @@ Speak naturally. The orchestrator handles the structure.
57
83
 
58
84
  ```bash
59
85
  # Decompose a casual request into structured work
60
- node .claude/hooks/vibe-router.mjs "fix the login bug and also update the nav"
86
+ npx dual-brain vibe "fix the login bug and also update the nav"
61
87
 
62
88
  # Generate a Steve-style execution plan
63
- node .claude/hooks/plan-generator.mjs --utterance "refactor the auth flow" --write
89
+ npx dual-brain plan --utterance "refactor the auth flow" --write
64
90
 
65
91
  # Switch profiles with natural language
66
92
  npx dual-brain mode "go aggressive"
@@ -68,40 +94,163 @@ npx dual-brain mode "be careful"
68
94
  npx dual-brain mode "cheap"
69
95
 
70
96
  # Check persistent preferences and work threads
71
- node .claude/hooks/vibe-memory.mjs --threads
97
+ npx dual-brain memory --threads
72
98
  ```
73
99
 
74
100
  The vibe-router splits multi-task requests, classifies risk, assigns tiers, and recommends quality gates. The plan-generator produces 3-part plans (dependency-ordered tasks, user stories, questions with suggested answers). Vibe-memory learns your preferences over time.
75
101
 
102
+ ## Automatic Collaboration
103
+
104
+ Think and review now auto-complete the full 2-round dialogue:
105
+
106
+ ```bash
107
+ npx dual-brain think --question "should we use Redis?"
108
+ # → GPT Round 1 → Claude analysis → GPT Round 2 → Synthesis
109
+ ```
110
+
111
+ Use `--manual` to step through rounds yourself (old behavior).
112
+
113
+ ## Agent Templates and Chains
114
+
115
+ Pre-built specialist agents and opinionated multi-step workflows:
116
+
117
+ ```bash
118
+ npx dual-brain agents # list all templates
119
+ npx dual-brain chains # list all chains
120
+ npx dual-brain do "explore auth then fix bug" # auto-selects explore-then-fix chain
121
+ ```
122
+
123
+ Templates include: `explorer`, `fixer`, `reviewer`, `tester`, and more. Chains compose templates into end-to-end workflows — `explore-then-fix`, `test-and-fix`, `review-and-apply`.
124
+
125
+ ## Commands
126
+
127
+ ### Primary workflow
128
+
129
+ ```bash
130
+ npx dual-brain do "..." # Ship Captain: goal → PR in one command
131
+ npx dual-brain do "..." --yolo # Skip confirmations
132
+ npx dual-brain do "..." --careful # Confirm every step
133
+ npx dual-brain do "..." --plan-only # Preview plan without executing
134
+ npx dual-brain do "..." --no-pr # Skip PR creation
135
+ npx dual-brain resume # Resume last incomplete run
136
+ ```
137
+
138
+ ### Collaboration
139
+
140
+ ```bash
141
+ npx dual-brain think --question "..." # Dual-brain think (auto 2-round)
142
+ npx dual-brain review # Dual-brain code review (auto 2-round)
143
+ npx dual-brain dispatch --task "..." # Dispatch task to GPT
144
+ ```
145
+
146
+ ### Vibe coding
147
+
148
+ ```bash
149
+ npx dual-brain vibe "..." # Decompose casual request
150
+ npx dual-brain plan --utterance "..." # Generate execution plan
151
+ npx dual-brain memory # Show preferences and threads
152
+ ```
153
+
154
+ ### Agents and chains
155
+
156
+ ```bash
157
+ npx dual-brain agents # List agent templates
158
+ npx dual-brain chains # List agent chains
159
+ ```
160
+
161
+ ### Quality and reporting
162
+
163
+ ```bash
164
+ npx dual-brain gate # Run quality gate
165
+ npx dual-brain report # Session report
166
+ npx dual-brain cost # Activity and cost estimates
167
+ npx dual-brain ledger # Routing outcome insights
168
+ ```
169
+
170
+ ### Profiles and config
171
+
172
+ ```bash
173
+ npx dual-brain mode cost-saver # Switch profile
174
+ npx dual-brain status # Current profile and provider health
175
+ npx dual-brain budget # Provider balance status
176
+ ```
177
+
178
+ ### Recovery
179
+
180
+ ```bash
181
+ npx dual-brain doctor # Check system health and report issues
182
+ npx dual-brain repair # Fix corrupt files, stale locks, re-register hooks
183
+ npx dual-brain reset # Clear all state files (keeps config/hooks)
184
+ npx dual-brain health # Verify all hooks and dependencies
185
+ ```
186
+
187
+ ### Install
188
+
189
+ ```bash
190
+ npx -y dual-brain # detect, configure, install
191
+ npx dual-brain --force # overwrite all config
192
+ npx dual-brain --dry-run # detect only, don't write
193
+ npx dual-brain --json # output detection as JSON
194
+ npx dual-brain --help # show help
195
+ npx dual-brain --uninstall # remove hooks and clean state
196
+ ```
197
+
198
+ ## Profiles
199
+
200
+ The active profile controls routing posture, budgets, and quality gate behavior. Default: **auto**.
201
+
202
+ ```bash
203
+ npx dual-brain mode cost-saver # switch profile
204
+ npx dual-brain status # check current profile and provider health
205
+ ```
206
+
207
+ - **auto** (default): Adapts routing based on task risk, provider health, and outcomes. Auto-escalates tier on repeated failures. Blocks major tier mismatches.
208
+ - **balanced**: Best model per tier, normal budgets, reviews at medium+ risk.
209
+ - **cost-saver**: Prefer cheaper models, lower budgets, skip GPT for non-critical work. Warns on major mismatches (does not block).
210
+ - **quality-first**: Dual-brain for medium+ risk, higher budgets, stricter reviews. Blocks both minor and major mismatches.
211
+
212
+ ## Troubleshooting
213
+
214
+ **Hooks not firing** — Run `npx dual-brain doctor`. Check that `.claude/settings.json` has the hook entries. Run `npx dual-brain repair` to re-register.
215
+
216
+ **Codex/GPT features unavailable** — Run `codex --version` and `codex login`. If Codex CLI isn't installed: `npm i -g @openai/codex`. Re-run `npx dual-brain` to detect.
217
+
218
+ **Auth expired** — Run `claude login` for Claude, `codex login` for OpenAI. Re-run `npx dual-brain` to re-detect.
219
+
220
+ **Duplicate warnings every time** — Normal during agent waves (3+ agents in 90s). The system auto-suppresses. If persistent with single agents, check for identical task descriptions.
221
+
222
+ **Budget warnings too aggressive/too lenient** — Switch profile: `npx dual-brain mode cost-saver` or `npx dual-brain mode quality-first`. Or set custom limits with `npx dual-brain budget <session$> [daily$]`.
223
+
224
+ **Corrupt state / weird behavior** — Run `npx dual-brain repair` for automatic fixes, or `npx dual-brain reset --force` to wipe all state files.
225
+
226
+ **Multiple Claude Code sessions** — State files may have brief write conflicts. Each session tracks independently. Use a single session for best results.
227
+
228
+ **Incomplete run** — Use `npx dual-brain resume` to continue where Ship Captain left off.
229
+
230
+ **Uninstall** — `npx dual-brain --uninstall` removes hooks from settings.json and cleans state files.
231
+
76
232
  ## Scripts
77
233
 
78
234
  | Script | Purpose |
79
235
  |--------|---------|
236
+ | `hooks/ship-captain.mjs` | End-to-end executor: goal → plan → execute → gate → PR |
237
+ | `hooks/agent-templates.mjs` | Pre-built specialist agent templates |
238
+ | `hooks/agent-chains.mjs` | Multi-step agent workflows (explore-then-fix, etc.) |
80
239
  | `hooks/vibe-router.mjs` | Decompose casual language into structured work orders |
81
240
  | `hooks/plan-generator.mjs` | Generate Steve-style 3-part execution plans |
82
241
  | `hooks/vibe-memory.mjs` | Persistent preferences, work threads, preference inference |
83
242
  | `hooks/cost-report.mjs` | Activity & cost estimates by model tier |
84
- | `hooks/dual-brain-review.mjs` | Send git diff to GPT for independent review |
85
- | `hooks/dual-brain-think.mjs` | Dual-perspective analysis on architecture decisions |
243
+ | `hooks/dual-brain-review.mjs` | Dual-brain code review (auto 2-round) |
244
+ | `hooks/dual-brain-think.mjs` | Dual-perspective analysis on architecture decisions (auto 2-round) |
86
245
  | `hooks/quality-gate.mjs` | Sensitivity-scored quality gate with review artifacts |
87
246
  | `hooks/budget-balancer.mjs` | Provider balance and routing recommendations |
88
247
  | `hooks/gpt-work-dispatcher.mjs` | Dispatch execution tasks to GPT via Codex CLI |
89
248
  | `hooks/session-report.mjs` | Session-end summary: activity, compliance, quality |
90
249
  | `hooks/health-check.mjs` | Verify all hooks and dependencies are working |
91
- | `hooks/test-orchestrator.mjs` | Self-test harness (40 tests) |
250
+ | `hooks/test-orchestrator.mjs` | Self-test harness (78 tests) |
92
251
  | `hooks/setup-wizard.mjs` | Interactive config (optional — for custom plans) |
93
252
  | `hooks/install-git-hooks.mjs` | Git pre-commit hook for quality gate |
94
253
 
95
- ## CLI options
96
-
97
- ```bash
98
- npx -y dual-brain # detect, configure, install
99
- npx dual-brain --force # overwrite all config
100
- npx dual-brain --dry-run # detect only, don't write
101
- npx dual-brain --json # output detection as JSON
102
- npx dual-brain --help # show help
103
- ```
104
-
105
254
  ## Customize
106
255
 
107
256
  After install, edit these files:
@@ -110,24 +259,20 @@ After install, edit these files:
110
259
  - `review-rules.md` — project-specific rules for GPT code review
111
260
  - `settings.json` — hook registrations (auto-generated, safe to extend)
112
261
 
113
- ## Profiles
114
-
115
- The active profile controls routing posture, budgets, and quality gate behavior. Default: **auto**.
116
-
117
- ```bash
118
- npx dual-brain mode cost-saver # switch profile
119
- npx dual-brain status # check current profile and provider health
120
- ```
121
-
122
- - **auto** (default): Adapts routing based on task risk, provider health, and outcomes. Auto-escalates tier on repeated failures.
123
- - **balanced**: Best model per tier, normal budgets, reviews at medium+ risk.
124
- - **cost-saver**: Prefer cheaper models, lower budgets, skip GPT for non-critical work.
125
- - **quality-first**: Dual-brain for medium+ risk, higher budgets, stricter reviews.
126
-
127
262
  ## Requirements
128
263
 
129
264
  - Node 20+
130
265
  - Claude Code (any subscription tier)
131
266
  - Codex CLI (optional) — `npm i -g @openai/codex && codex login`
267
+ - replit-tools (recommended on Replit) — `npx -y replit-tools` — provides persistent auth, session management, and container survival
132
268
 
133
269
  Works with any subscription combination. Without OpenAI, GPT features gracefully degrade — all work routes through Claude.
270
+ On Replit, replit-tools is strongly recommended — dual-brain's persistent state features depend on it.
271
+
272
+ ## Credits
273
+
274
+ Built as an extension of **data-tools** by [Steve Moraco](https://github.com/stevemoraco).
275
+
276
+ data-tools/replit-tools provides the foundation: persistent state across container restarts,
277
+ multi-terminal session management, auto-updating scripts, and SSH key persistence.
278
+ dual-brain adds dual-provider orchestration on top.