claude-power-setup 1.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shyam Sridhar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,275 @@
1
+ <p align="center">
2
+ <img src="assets/banner.svg" alt="Claude Power Setup banner" width="100%">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License"></a>
7
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node.js-18%2B-green.svg" alt="Node.js 18+"></a>
8
+ <a href="https://docs.anthropic.com/en/docs/claude-code"><img src="https://img.shields.io/badge/Claude%20Code-Extension-purple.svg" alt="Claude Code"></a>
9
+ <a href="https://www.npmjs.com/package/claude-power-setup"><img src="https://img.shields.io/npm/v/claude-power-setup.svg" alt="npm version"></a>
10
+ </p>
11
+
12
+ <p align="center">
13
+ <strong>Multi-agent orchestration, automation pipelines, and recursive self-improvement for <a href="https://docs.anthropic.com/en/docs/claude-code">Claude Code</a>.</strong>
14
+ </p>
15
+
16
+ ---
17
+
18
+ Layers on top of [ECC (Everything Claude Code)](https://github.com/affaan-m/everything-claude-code). One command to install:
19
+
20
+ ```bash
21
+ npm install -g claude-power-setup
22
+ claude-power-setup
23
+ ```
24
+
25
+ <video src="https://github.com/shyamsridhar123/claude-power-setup/releases/download/v1.0.0/feature-video.mp4" width="100%" autoplay loop muted playsinline controls></video>
26
+
27
+ ---
28
+
29
+ ## Why This Exists
30
+
31
+ ### The Problem
32
+
33
+ Claude Code is powerful out of the box, but using it at maximum efficiency requires expertise most developers don't have time to build. You end up with:
34
+
35
+ - **One mode for everything** — The same approach for research, implementation, review, and debugging. Each of these is a fundamentally different cognitive task, but you're using the same prompt posture for all of them.
36
+ - **Serial execution** — Waiting for one agent to finish before starting the next, even when the work is independent. Your 8-core machine is doing one thing at a time.
37
+ - **No memory between sessions** — Every session starts from zero. The hard-won lesson from Tuesday's debugging marathon? Gone by Wednesday. The pattern you discovered for your project's test setup? You'll rediscover it next month.
38
+ - **Manual quality control** — Remembering to run tests, check security, clean up slop, and review code. Humans forget. Agents don't — if you tell them to.
39
+
40
+ ### The Philosophy
41
+
42
+ This setup is built on three beliefs about AI-assisted development:
43
+
44
+ **1. Mode switching is not optional — it's fundamental.**
45
+
46
+ A developer reviewing code should think differently than a developer writing code. When you're in research mode, you should be read-only and methodical. When you're orchestrating a team, you should decompose and delegate, not implement. Claude Code doesn't enforce this separation. We do — with four purpose-built context profiles that prime the agent for the task at hand.
47
+
48
+ **2. The agent should get smarter over time, not just the developer.**
49
+
50
+ Most AI coding tools are stateless. They make the same mistakes on day 100 that they made on day 1. The Continuous Learning system changes this: every tool use is observed, patterns are detected, instincts are created with confidence scores, and high-confidence instincts are promoted from project-scoped to global. Your Claude gets better at *your* codebases, with *your* preferences, automatically.
51
+
52
+ **3. Orchestration beats implementation.**
53
+
54
+ The highest-leverage thing a developer can do with AI agents is not write code through them — it's *orchestrate multiple agents in parallel*. One agent researches. Another implements. A third writes tests. A fourth reviews. They work in isolated worktrees with independent context windows, communicate through a shared task board, and produce work that no single agent session could match. This is swarm engineering, and it's the default mode for complex tasks.
55
+
56
+ ### What Makes This Different
57
+
58
+ This isn't a collection of dotfiles or a prompt library. It's an **operating system layer** for Claude Code:
59
+
60
+ - **Automation pipelines** (`cpipeline`, `crouted`, `claude-loop`) replace manual multi-step workflows with deterministic, quality-gated sequences
61
+ - **Model routing** sends research to Opus and implementation to Sonnet — the right model for the right job
62
+ - **Instinct-based learning** means the system evolves from observations, not from you manually curating prompts
63
+ - **Safe packaging** — the installer is idempotent, the uninstaller is surgical, and nothing touches your existing ECC setup unless you ask
64
+
65
+ The result: you spend less time managing the AI and more time thinking about the problem.
66
+
67
+ ---
68
+
69
+ ## Prerequisites
70
+
71
+ | Requirement | Required | Notes |
72
+ |-------------|----------|-------|
73
+ | **Node.js** 18+ | Yes | Hooks and scripts depend on it |
74
+ | **Claude Code CLI** | Yes | `npm install -g @anthropic-ai/claude-code` |
75
+ | **Git** | Recommended | Worktrees, session save, loop runner |
76
+ | **ECC** | Recommended | This setup extends ECC's hooks and skills |
77
+
78
+ ## Quick Install
79
+
80
+ ### npm (recommended — any platform)
81
+
82
+ ```bash
83
+ npm install -g claude-power-setup
84
+ claude-power-setup
85
+ ```
86
+
87
+ ### Linux / macOS / Git Bash (Windows)
88
+
89
+ ```bash
90
+ git clone https://github.com/shyamsridhar123/claude-power-setup.git
91
+ cd claude-power-setup
92
+ bash install.sh
93
+ ```
94
+
95
+ ### Windows (PowerShell)
96
+
97
+ ```powershell
98
+ git clone https://github.com/shyamsridhar123/claude-power-setup.git
99
+ cd claude-power-setup
100
+ powershell -ExecutionPolicy Bypass -File install.ps1
101
+ ```
102
+
103
+ ### Options
104
+
105
+ ```
106
+ --dry-run Show what would be installed without writing files
107
+ --force Overwrite existing files instead of skipping
108
+ --skip-shell Don't modify shell profile (.bashrc/.zshrc)
109
+ --skip-ecc Don't check for ECC installation
110
+ ```
111
+
112
+ ## What's Included
113
+
114
+ ### Context Profiles (Mode Switching)
115
+
116
+ Switch between purpose-built Claude modes. Each profile primes the agent with different priorities, allowed tools, and quality gates:
117
+
118
+ ```bash
119
+ source ~/.claude/bin/claude-aliases.sh
120
+
121
+ cdev # Development mode — TDD, quality gates, strategic compaction
122
+ corchestrate # Team lead mode — decompose, delegate, synthesize
123
+ creview # Code review mode — security-first, dual-model review
124
+ cresearch # Research mode — read-only investigation, document findings
125
+ ```
126
+
127
+ ### Automation Pipelines
128
+
129
+ Replace multi-step manual workflows with deterministic, scriptable pipelines:
130
+
131
+ ```bash
132
+ # Sequential: implement -> de-slop -> verify -> commit
133
+ cpipeline "Implement OAuth2 login in src/auth/"
134
+
135
+ # Model-routed: Opus research -> Sonnet implement -> Opus review
136
+ crouted "Add caching layer to API endpoints"
137
+
138
+ # Continuous loop with safety controls
139
+ ~/.claude/bin/claude-loop.sh "Add tests for untested functions" --max-runs 8
140
+
141
+ # Quick commands
142
+ cfix # Build + lint + test + fix failures
143
+ cclean # Remove slop from uncommitted changes
144
+ ccommit # Auto-commit with conventional message
145
+ caudit # Security scan + harness audit
146
+ ```
147
+
148
+ ### Agent Teams (Swarm Mode)
149
+
150
+ Enabled via `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`. Just ask naturally:
151
+
152
+ ```
153
+ > Build a REST API with auth, rate limiting, and tests.
154
+ > Please use a team of specialists for this.
155
+ ```
156
+
157
+ Claude spawns teammates in isolated worktrees — each with fresh context, self-organizing via a shared task board. Up to 5 specialists working in parallel: architect, backend, frontend, tester, reviewer, docs.
158
+
159
+ ### Learned Instincts
160
+
161
+ Four battle-tested patterns extracted from real development sessions. These load automatically and improve agent behavior without prompt engineering:
162
+
163
+ | Instinct | Confidence | What It Does |
164
+ |----------|------------|--------------|
165
+ | Parallel agents for independent files | 0.8 | Spawn parallel agents when 3+ files don't depend on each other |
166
+ | De-sloppify as separate pass | 0.85 | Always clean up with a different agent than the one that wrote the code |
167
+ | Dual-review catches more | 0.9 | Two independent reviewers find ~45% more issues than one |
168
+ | uuid ESM incompatibility | 0.95 | Use `crypto.randomUUID()` instead of uuid package in Jest/CJS projects |
169
+
170
+ ### Continuous Learning Observer
171
+
172
+ The system watches every tool use, detects patterns in your workflow, and creates new instincts automatically:
173
+
174
+ ```
175
+ Observe (every tool use) -> Detect (patterns emerge) -> Learn (create instincts)
176
+ -> Promote (project -> global) -> Evolve (instincts -> skills/agents)
177
+ ```
178
+
179
+ Instincts have confidence scores (0.3 tentative to 0.95 certain) that evolve as evidence accumulates. High-confidence instincts are promoted from project scope to global scope automatically.
180
+
181
+ ## Architecture
182
+
183
+ ```
184
+ YOU (developer)
185
+ |
186
+ +-- Mode Selection: cdev | corchestrate | creview | cresearch
187
+ |
188
+ +-- Orchestration: Agent Teams | Swarm Mode | Santa Loop | Multi-Model
189
+ |
190
+ +-- Loop Engine: Sequential Pipeline | Continuous Loop | Model-Routed
191
+ |
192
+ +-- Quality Layer: TDD Guide | Verify Loop | De-Slop Pass
193
+ |
194
+ +-- Memory & Learning: Session Save/Resume | Instincts (v2.1) | Strategic Compact
195
+ |
196
+ +-- Security & Hooks: PreToolUse | PostToolUse | Stop/Session hooks
197
+ ```
198
+
199
+ See `~/.claude/contexts/ORCHESTRATION-REFERENCE.md` for the full reference with architecture diagrams, decision matrices, and workflow examples.
200
+
201
+ ## File Layout
202
+
203
+ ```
204
+ claude-power-setup/
205
+ ├── install.sh # Main installer (bash, cross-platform)
206
+ ├── install.ps1 # Windows PowerShell wrapper
207
+ ├── uninstall.sh # Safe removal (only touches what it installed)
208
+ ├── cli.js # npm entry point (npx claude-power-setup)
209
+ ├── package.json # npm package config
210
+ ├── README.md # This file
211
+ ├── LICENSE # MIT
212
+ ├── assets/ # README assets
213
+ │ └── banner.svg # Terminal-style banner in Anthropic colors
214
+ ├── contexts/ # Mode profiles
215
+ │ ├── dev.md
216
+ │ ├── orchestrate.md
217
+ │ ├── review.md
218
+ │ └── research.md
219
+ ├── bin/ # Automation scripts
220
+ │ ├── claude-aliases.sh # Mode aliases + pipeline functions
221
+ │ ├── claude-loop.sh # Continuous loop with quality gates
222
+ │ └── claude-session-save.sh # Cross-session memory persistence
223
+ ├── instincts/ # Learned patterns with confidence scores
224
+ │ ├── parallel-agents-for-independent-files.md
225
+ │ ├── de-sloppify-separate-pass.md
226
+ │ ├── dual-review-catches-more.md
227
+ │ └── uuid-esm-incompatibility-jest.md
228
+ ├── config/ # Settings templates
229
+ │ ├── env-settings.json # Agent Teams, cost tracking, hook profile
230
+ │ └── observer-config.json # Continuous learning observer config
231
+ ├── reference/ # Documentation
232
+ │ └── ORCHESTRATION-REFERENCE.md
233
+ └── video/ # Remotion source for feature video
234
+ ├── index.ts
235
+ ├── Root.tsx
236
+ └── scenes/
237
+ └── FeatureVideo.tsx
238
+ ```
239
+
240
+ ## Uninstall
241
+
242
+ ```bash
243
+ bash uninstall.sh # Interactive removal
244
+ bash uninstall.sh --dry-run # Preview what would be removed
245
+ ```
246
+
247
+ The uninstaller only removes files it installed. It never touches ECC hooks, plugins, session data, user-created instincts, or user-modified settings. Env settings are only reverted if their values still match what was installed (user modifications are preserved).
248
+
249
+ ## Key Slash Commands
250
+
251
+ After installation, these slash commands become available in Claude Code:
252
+
253
+ | Command | Purpose |
254
+ |---------|---------|
255
+ | `/plan` | Plan before coding (wait for confirmation) |
256
+ | `/tdd` | Test-driven development workflow |
257
+ | `/verify` | Full verification loop (build + lint + test + security) |
258
+ | `/code-review` | Comprehensive quality review |
259
+ | `/santa-loop` | Dual-model adversarial review (both must approve) |
260
+ | `/team-builder` | Compose and dispatch agent teams |
261
+ | `/learn` | Extract reusable patterns from current session |
262
+ | `/instinct-status` | View all learned instincts with confidence |
263
+ | `/save-session` | Persist session state for later resumption |
264
+ | `/resume-session` | Load previous session and continue |
265
+ | `/promote` | Move project instincts to global scope |
266
+ | `/evolve` | Cluster instincts into skills/agents |
267
+ | `/security-scan` | Scan configuration for vulnerabilities |
268
+
269
+ ## Contributing
270
+
271
+ Contributions welcome. If you've discovered patterns that make Claude Code more effective, consider adding them as instincts with evidence and confidence scores.
272
+
273
+ ## License
274
+
275
+ [MIT](LICENSE)
@@ -0,0 +1,96 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 460" fill="none" role="img" aria-labelledby="title desc">
2
+ <title id="title">Claude Power Setup banner</title>
3
+ <desc id="desc">A clean dark banner with the Claude Power Setup title, installation command, and a diagram representing agents, pipelines, memory, and review workflows.</desc>
4
+
5
+ <defs>
6
+ <linearGradient id="canvas" x1="160" y1="24" x2="1044" y2="436" gradientUnits="userSpaceOnUse">
7
+ <stop offset="0%" stop-color="#171210"/>
8
+ <stop offset="55%" stop-color="#100D0C"/>
9
+ <stop offset="100%" stop-color="#0C0908"/>
10
+ </linearGradient>
11
+ <linearGradient id="frame" x1="24" y1="22" x2="1176" y2="438" gradientUnits="userSpaceOnUse">
12
+ <stop offset="0%" stop-color="#3A2C26"/>
13
+ <stop offset="100%" stop-color="#211915"/>
14
+ </linearGradient>
15
+ <linearGradient id="accent" x1="72" y1="0" x2="248" y2="0" gradientUnits="userSpaceOnUse">
16
+ <stop offset="0%" stop-color="#F4B08E"/>
17
+ <stop offset="50%" stop-color="#E58A61"/>
18
+ <stop offset="100%" stop-color="#C4623C"/>
19
+ </linearGradient>
20
+ <radialGradient id="glowLeft" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(248 72) rotate(25) scale(360 250)">
21
+ <stop offset="0%" stop-color="#D87453" stop-opacity="0.18"/>
22
+ <stop offset="100%" stop-color="#D87453" stop-opacity="0"/>
23
+ </radialGradient>
24
+ <radialGradient id="glowRight" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(1018 240) rotate(-18) scale(280 220)">
25
+ <stop offset="0%" stop-color="#E89A73" stop-opacity="0.22"/>
26
+ <stop offset="100%" stop-color="#E89A73" stop-opacity="0"/>
27
+ </radialGradient>
28
+ <filter id="panelShadow" x="-10%" y="-20%" width="140%" height="160%">
29
+ <feDropShadow dx="0" dy="20" stdDeviation="24" flood-color="#000000" flood-opacity="0.28"/>
30
+ </filter>
31
+ </defs>
32
+
33
+ <rect width="1200" height="460" rx="28" fill="#090807"/>
34
+ <rect width="1200" height="460" rx="28" fill="url(#canvas)"/>
35
+ <ellipse cx="248" cy="72" rx="360" ry="250" fill="url(#glowLeft)"/>
36
+ <ellipse cx="1018" cy="240" rx="280" ry="220" fill="url(#glowRight)"/>
37
+
38
+ <rect x="24" y="22" width="1152" height="416" rx="24" fill="#110E0C" stroke="url(#frame)" filter="url(#panelShadow)"/>
39
+
40
+ <circle cx="56" cy="52" r="6" fill="#FF5F57"/>
41
+ <circle cx="76" cy="52" r="6" fill="#FEBC2E"/>
42
+ <circle cx="96" cy="52" r="6" fill="#28C840"/>
43
+ <text x="600" y="57" text-anchor="middle" fill="#8F8378" font-family="ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace" font-size="13">claude-power-setup — orchestration toolkit</text>
44
+ <line x1="24" y1="74" x2="1176" y2="74" stroke="#241C18"/>
45
+
46
+ <rect x="72" y="100" width="264" height="30" rx="15" fill="#181311" stroke="#342823"/>
47
+ <circle cx="93" cy="115" r="4" fill="#EB9168"/>
48
+ <text x="109" y="120" fill="#CBBCAF" font-family="ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace" font-size="13" letter-spacing="1.4">CLAUDE CODE POWER LAYER</text>
49
+
50
+ <text x="72" y="184" fill="#F8F1EA" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="64" font-weight="700" letter-spacing="-1.8">Claude</text>
51
+ <text x="72" y="242" fill="#F8F1EA" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="60" font-weight="700" letter-spacing="-1.6">Power Setup</text>
52
+ <rect x="72" y="262" width="176" height="8" rx="4" fill="url(#accent)"/>
53
+
54
+ <text x="72" y="306" fill="#BFAEA1" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="21" font-weight="500">
55
+ <tspan x="72">Multi-agent orchestration, automation pipelines,</tspan>
56
+ <tspan x="72" dy="28">and recursive self-improvement for Claude Code.</tspan>
57
+ </text>
58
+
59
+ <rect x="72" y="364" width="352" height="40" rx="14" fill="#15110F" stroke="#3A2D27"/>
60
+ <text x="92" y="389" fill="#F0B08C" font-family="ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace" font-size="18">$</text>
61
+ <text x="116" y="389" fill="#EEE3DA" font-family="ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace" font-size="18">npx claude-power-setup</text>
62
+
63
+ <g>
64
+ <rect x="652" y="110" width="214" height="86" rx="22" fill="#16110F" stroke="#362923"/>
65
+ <text x="759" y="142" text-anchor="middle" fill="#F8EFE8" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="19" font-weight="700">Agents</text>
66
+ <text x="759" y="168" text-anchor="middle" fill="#A59286" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="14">Parallel specialists for</text>
67
+ <text x="759" y="188" text-anchor="middle" fill="#A59286" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="14">research, build, and docs</text>
68
+ </g>
69
+
70
+ <g>
71
+ <rect x="936" y="110" width="214" height="86" rx="22" fill="#16110F" stroke="#362923"/>
72
+ <text x="1043" y="142" text-anchor="middle" fill="#F8EFE8" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="19" font-weight="700">Pipelines</text>
73
+ <text x="1043" y="168" text-anchor="middle" fill="#A59286" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="14">Deterministic flows</text>
74
+ <text x="1043" y="188" text-anchor="middle" fill="#A59286" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="14">with quality gates</text>
75
+ </g>
76
+
77
+ <g>
78
+ <rect x="652" y="302" width="214" height="86" rx="22" fill="#16110F" stroke="#362923"/>
79
+ <text x="759" y="334" text-anchor="middle" fill="#F8EFE8" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="19" font-weight="700">Memory</text>
80
+ <text x="759" y="360" text-anchor="middle" fill="#A59286" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="14">Promote instincts from</text>
81
+ <text x="759" y="380" text-anchor="middle" fill="#A59286" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="14">project scope to global</text>
82
+ </g>
83
+
84
+ <g>
85
+ <rect x="936" y="302" width="214" height="86" rx="22" fill="#16110F" stroke="#362923"/>
86
+ <text x="1043" y="334" text-anchor="middle" fill="#F8EFE8" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="19" font-weight="700">Review</text>
87
+ <text x="1043" y="360" text-anchor="middle" fill="#A59286" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="14">Security, verification,</text>
88
+ <text x="1043" y="380" text-anchor="middle" fill="#A59286" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="14">and de-slop passes</text>
89
+ </g>
90
+
91
+ <g>
92
+ <rect x="816" y="214" width="170" height="72" rx="22" fill="#201511" stroke="#6B422F"/>
93
+ <text x="901" y="242" text-anchor="middle" fill="#F5C6AC" font-family="ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace" font-size="15" font-weight="600" letter-spacing="1.2">ORCHESTRATE</text>
94
+ <text x="901" y="264" text-anchor="middle" fill="#C8B4A7" font-family="Inter, Segoe UI, Helvetica Neue, Arial, sans-serif" font-size="13">modes • teams • loops</text>
95
+ </g>
96
+ </svg>
@@ -0,0 +1,71 @@
1
+ #!/bin/bash
2
+ # ~/.claude/bin/claude-aliases.sh
3
+ # Source this in your .bashrc or .bash_profile:
4
+ # source ~/.claude/bin/claude-aliases.sh
5
+
6
+ # ── Mode-Switched Claude Sessions ──────────────────────────
7
+ alias c='claude'
8
+ alias cdev='claude --system-prompt "$(cat ~/.claude/contexts/dev.md)"'
9
+ alias corchestrate='claude --system-prompt "$(cat ~/.claude/contexts/orchestrate.md)"'
10
+ alias creview='claude --system-prompt "$(cat ~/.claude/contexts/review.md)"'
11
+ alias cresearch='claude --system-prompt "$(cat ~/.claude/contexts/research.md)"'
12
+
13
+ # ── Quick Non-Interactive Pipelines ────────────────────────
14
+ alias cfix='claude -p "Run build + lint + tests. Fix any failures. Do not add features."'
15
+ alias cclean='claude -p "Review all uncommitted changes. Remove console.logs, dead code, commented-out code, test slop. Run tests after cleanup."'
16
+ alias ccommit='claude -p "Create a conventional commit for all staged changes. Summarize what changed in 1-2 sentences."'
17
+ alias caudit='claude -p "Run /security-scan and /harness-audit. Report findings."'
18
+
19
+ # ── Sequential Pipeline ───────────────────────────────────
20
+ # Usage: cpipeline "Implement OAuth2 login in src/auth/"
21
+ cpipeline() {
22
+ local spec="$1"
23
+ echo "=== Step 1: Implement ==="
24
+ claude -p "Read the codebase. ${spec}. Write tests first (TDD). Do NOT create documentation files."
25
+ echo "=== Step 2: De-sloppify ==="
26
+ claude -p "Review all uncommitted changes. Remove tests that verify language behavior, redundant type checks, console.logs, commented code. Keep business logic tests. Run test suite."
27
+ echo "=== Step 3: Verify ==="
28
+ claude -p "Run full build, lint, type check, tests. Fix any failures. Do not add features."
29
+ echo "=== Step 4: Commit ==="
30
+ claude -p "Create a conventional commit for all changes. Use a clear, descriptive message."
31
+ echo "=== Pipeline complete ==="
32
+ }
33
+
34
+ # ── Model-Routed Pipeline ─────────────────────────────────
35
+ # Usage: crouted "Add caching layer to API endpoints"
36
+ crouted() {
37
+ local spec="$1"
38
+ echo "=== Research (Opus) ==="
39
+ claude -p --model opus "Analyze the codebase architecture. Plan how to: ${spec}. Write plan to .claude/plans/current.md"
40
+ echo "=== Implement (Sonnet) ==="
41
+ claude -p "Read .claude/plans/current.md. Implement the plan with TDD."
42
+ echo "=== De-sloppify ==="
43
+ claude -p "Cleanup pass on all uncommitted changes. Remove slop, run tests."
44
+ echo "=== Review (Opus) ==="
45
+ claude -p --model opus "Review all uncommitted changes for security, correctness, performance. Write findings to .claude/plans/review.md"
46
+ echo "=== Fix + Commit ==="
47
+ claude -p "Read .claude/plans/review.md. Fix all critical/high issues. Run tests. Commit."
48
+ }
49
+
50
+ # ── Worktree Helpers ──────────────────────────────────────
51
+ # Usage: cwt feature-auth "Implement JWT authentication"
52
+ cwt() {
53
+ local name="$1"
54
+ local task="$2"
55
+ git worktree add -b "feat/${name}" "../${PWD##*/}-${name}" HEAD
56
+ echo "Worktree created: ../$(basename $PWD)-${name}"
57
+ echo "Run: cd ../$(basename $PWD)-${name} && claude"
58
+ if [ -n "$task" ]; then
59
+ (cd "../${PWD##*/}-${name}" && claude -p "$task")
60
+ fi
61
+ }
62
+
63
+ # Clean up worktree after merge
64
+ cwt-clean() {
65
+ local name="$1"
66
+ git worktree remove "../${PWD##*/}-${name}" 2>/dev/null
67
+ git branch -d "feat/${name}" 2>/dev/null
68
+ echo "Cleaned: ${name}"
69
+ }
70
+
71
+ echo "[claude-aliases] Loaded: cdev, corchestrate, creview, cresearch, cpipeline, crouted, cwt"
@@ -0,0 +1,84 @@
1
+ #!/bin/bash
2
+ # ~/.claude/bin/claude-loop.sh
3
+ # Continuous development loop with safety controls
4
+ #
5
+ # Usage:
6
+ # claude-loop "Add tests for untested functions" --max-runs 5
7
+ # claude-loop "Fix all linter errors" --max-runs 10 --mode fast
8
+ # claude-loop "Improve coverage to 80%" --max-runs 8 --model sonnet
9
+
10
+ set -euo pipefail
11
+
12
+ PROMPT="${1:?Usage: claude-loop \"prompt\" [--max-runs N] [--mode safe|fast] [--model MODEL]}"
13
+ shift
14
+
15
+ MAX_RUNS=5
16
+ MODE="safe"
17
+ MODEL=""
18
+ NOTES_FILE="SHARED_TASK_NOTES.md"
19
+
20
+ while [[ $# -gt 0 ]]; do
21
+ case "$1" in
22
+ --max-runs) MAX_RUNS="$2"; shift 2 ;;
23
+ --mode) MODE="$2"; shift 2 ;;
24
+ --model) MODEL="--model $2"; shift 2 ;;
25
+ *) echo "Unknown flag: $1"; exit 1 ;;
26
+ esac
27
+ done
28
+
29
+ echo "=== Claude Loop ==="
30
+ echo "Prompt: ${PROMPT}"
31
+ echo "Max runs: ${MAX_RUNS}"
32
+ echo "Mode: ${MODE}"
33
+ echo "Model: ${MODEL:-default}"
34
+ echo ""
35
+
36
+ # Initialize shared notes
37
+ if [ ! -f "$NOTES_FILE" ]; then
38
+ cat > "$NOTES_FILE" << 'EOF'
39
+ ## Progress
40
+ (auto-updated by loop)
41
+
42
+ ## Next Steps
43
+ (auto-updated by loop)
44
+
45
+ ## Issues Found
46
+ (auto-updated by loop)
47
+ EOF
48
+ fi
49
+
50
+ QUALITY_GATE=""
51
+ if [ "$MODE" = "safe" ]; then
52
+ QUALITY_GATE='After implementation, run the full build + lint + test suite. Fix any failures before completing.'
53
+ fi
54
+
55
+ for i in $(seq 1 "$MAX_RUNS"); do
56
+ echo ""
57
+ echo "━━━ Iteration ${i}/${MAX_RUNS} ━━━"
58
+
59
+ ITERATION_PROMPT="You are on iteration ${i} of ${MAX_RUNS} of a continuous development loop.
60
+
61
+ Read ${NOTES_FILE} for context from previous iterations.
62
+
63
+ TASK: ${PROMPT}
64
+
65
+ ${QUALITY_GATE}
66
+
67
+ After completing your work:
68
+ 1. Update ${NOTES_FILE} with what you accomplished and what's left
69
+ 2. If the task is fully complete, include the line: LOOP_COMPLETE
70
+ 3. Commit your changes with a conventional commit message"
71
+
72
+ claude -p $MODEL "$ITERATION_PROMPT"
73
+
74
+ # Check for completion signal
75
+ if grep -q "LOOP_COMPLETE" "$NOTES_FILE" 2>/dev/null; then
76
+ echo ""
77
+ echo "=== Loop completed at iteration ${i} (task signaled complete) ==="
78
+ break
79
+ fi
80
+ done
81
+
82
+ echo ""
83
+ echo "=== Loop finished after ${i} iterations ==="
84
+ echo "Notes: $(cat "$NOTES_FILE" | head -20)"
@@ -0,0 +1,61 @@
1
+ #!/bin/bash
2
+ # ~/.claude/bin/claude-session-save.sh
3
+ # Save current session state for cross-session continuity
4
+ # Called automatically by Stop hook, or manually via /save-session
5
+ #
6
+ # Saves to: ~/.claude/session-data/YYYY-MM-DD-HHMMSS-{project}.md
7
+
8
+ set -euo pipefail
9
+
10
+ PROJECT_NAME="${1:-$(basename "$(pwd)")}"
11
+ TIMESTAMP="$(date +%Y-%m-%d-%H%M%S)"
12
+ SESSION_DIR="$HOME/.claude/session-data"
13
+ SESSION_FILE="${SESSION_DIR}/${TIMESTAMP}-${PROJECT_NAME}.md"
14
+
15
+ mkdir -p "$SESSION_DIR"
16
+
17
+ # Get git context
18
+ BRANCH="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'no-git')"
19
+ LAST_COMMITS="$(git log --oneline -5 2>/dev/null || echo 'none')"
20
+ UNCOMMITTED="$(git diff --stat HEAD 2>/dev/null || echo 'none')"
21
+ UNTRACKED="$(git ls-files --others --exclude-standard 2>/dev/null | head -10 || echo 'none')"
22
+
23
+ cat > "$SESSION_FILE" << EOF
24
+ # Session: ${PROJECT_NAME}
25
+ **Date:** ${TIMESTAMP}
26
+ **Branch:** ${BRANCH}
27
+ **Working Directory:** $(pwd)
28
+
29
+ ## Last 5 Commits
30
+ \`\`\`
31
+ ${LAST_COMMITS}
32
+ \`\`\`
33
+
34
+ ## Uncommitted Changes
35
+ \`\`\`
36
+ ${UNCOMMITTED}
37
+ \`\`\`
38
+
39
+ ## Untracked Files
40
+ \`\`\`
41
+ ${UNTRACKED}
42
+ \`\`\`
43
+
44
+ ## What Was Accomplished
45
+ <!-- Fill in or let Claude update -->
46
+
47
+ ## What's Left To Do
48
+ <!-- Fill in or let Claude update -->
49
+
50
+ ## Approaches That Worked
51
+ <!-- Fill in with evidence -->
52
+
53
+ ## Approaches That Failed
54
+ <!-- Fill in so we don't repeat them -->
55
+
56
+ ## Key Files Modified
57
+ <!-- List the important files touched this session -->
58
+
59
+ EOF
60
+
61
+ echo "Session saved: ${SESSION_FILE}"