claude-resonance
v1.5.31
Published
π Resonanceβ’ for Claude Code - AI TDD workflow with Opus-Sonnet collaboration
Maintainers
Readme
π Resonanceβ’ for Claude Code
β οΈ IMPORTANT UPDATE (July 10, 2025): Major improvements to command structure. Update with
npm update -g claude-resonanceor usenpx claude-resonancefor the latest version.
Lost context from Auto-Compact? Stuck in endless bug fixing?
Solve it with the systematic Resonanceβ’ workflow.
Opus-Sonnet-and You, 3-person collaboration system.
English | νκ΅μ΄ | Philosophy | Prompt Engineering Guide | Documentation
π₯ The Problem We All Face
Using Claude Code Plan β Act mode? You know these problems:
- π 20k Context Window: Auto-Compact erases initial design details, degrading code quality
- π Test-Fix Loop: Get AI code β Test β Error β Request fix β Repeat...
- π No Work History: Previous work buried in chat history
- π€ AI Guesswork: Dumps code without understanding needs, requiring constant revisions
π‘ What If AI Worked Differently?
β Current Reality
You: "Implement payment API"
AI: "Here's 500 lines of code!"
You: [Test it] "Getting errors..."
AI: "Fixed it!"
You: [Test again] "Different error now..."
AI: "Fixed that too!"
You: [Test again] "Still broken..."
(Infinite loop...)β AI TDD Workflow
You: "Implement payment API"
Opus: "Real money is involved here, we need to be careful.
What happens if the same payment gets processed twice?"
You: "Uh... does that happen?"
Opus: "Often, especially with network retries.
Also, what about refunds and partial cancellations?"
[After gathering sufficient information...]
Opus: "Great, I understand completely now!
Enter 'ultrathink' for detailed design."
You: "ultrathink"
[Phase 2: Deep analysis...]
Opus: "Analysis complete! Here's the design:
π§ͺ Test Scenarios (5)
1. Normal payment flow
2. Duplicate request prevention (idempotency key)
3. Network timeout handling
4. Partial refund validation
5. Webhook failure retry
ποΈ Implementation Strategy
- Abstract with PaymentService interface
- DB transactions for consistency
- Error logging and monitoring
Plan saved to cycles/2025-07-08/1430-payment-api-plan.md!"π Understanding Resonance
For a deeper understanding of the Resonance philosophy and how it fundamentally differs from traditional AI coding, see our Philosophy Documentation.
π The Fundamental Shift
Traditional AI Coding: AI TDD Workflow:
βββββββββββββββββββ βββββββββββββββββββ
β You: "Build X" β β You: "Build X" β
ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β AI: Here's code β β Opus: Let me β
β (no tests) β β understand... β
ββββββββββ¬βββββββββ β - What's X for? β
β β - Edge cases? β
βΌ β - Constraints? β
βββββββββββββββββββ ββββββββββ¬βββββββββ
β You: Test it β β
β "Got errors..." β βΌ
ββββββββββ¬βββββββββ βββββββββββββββββββ
β β You: [answers] β
βΌ ββββββββββ¬βββββββββ
βββββββββββββββββββ β
β AI: "Fixed it" β βΌ
ββββββββββ¬βββββββββ βββββββββββββββββββ
β β Opus: TDD Plan β
βΌ β ultrathink on β
βββββββββββββββββββ ββββββββββ¬βββββββββ
β You: Test again β β
β "Another error" β βΌ
ββββββββββ¬βββββββββ βββββββββββββββββββ
β β Sonnet: Tests β
βΌ β First + Code β
(Infinite loop...) ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Opus: Review β
β together: β
β - Code quality? β
β - Missed cases? β
β - Better way? β
ββββββββββ¬βββββββββ
β
βΌ
Verified & Refined!π What's New in v1.4.0
- Principle-Driven Design: Commands now focus on core principles rather than rigid templates
- Separated Examples: All examples moved to
examples/folders for cleaner, more flexible guidelines - Enhanced Korean Support: Korean version now uses English system prompts for better performance
- Philosophy Documentation: Added PHILOSOPHY.md explaining the core concepts
π Quick Installation
β‘ NPM Package
Option 1: Direct execution (no installation)
# Always run latest version
npx claude-resonance@latest
# Or force cache update
npx --yes claude-resonanceOption 2: Global installation (recommended)
# Install globally
npm install -g claude-resonance
# Run installation
resonanceπ§ Fix npx cache issues:
# Clear npm cache
npm cache clean --force
# Clear npx cache
npx clear-npx-cache
# Reinstall with latest version
npx claude-resonance@latestChoose your language during installation (English/νκ΅μ΄).
npx vs npm -g:
npx: Downloads and runs latest version each time (slower, always up-to-date)npm -g: Installs once, runs faster (need to update manually)
System Requirements:
- macOS only (tested on macOS 15.5+)
- Claude Code installed in standard location (
~/.claude/) - Terminal with npm/npx access
π§ Manual Installation (Alternative)
macOS
# Clone the repository
git clone https://github.com/keepitmello/Resonance--for-Claude-Code.git
cd Resonance--for-Claude-Code
# Install and activate
./activate-simple.shWindows (WSL)
Important: Run all commands inside WSL terminal, not PowerShell or CMD.
# Open WSL terminal (Ubuntu/Debian recommended)
# Clone the repository
git clone https://github.com/keepitmello/Resonance--for-Claude-Code.git
cd Resonance--for-Claude-Code
# Copy command files to Claude Code directory
# For English:
cp commands\(en\)/*.md ~/.claude/commands/
# For Korean:
cp commands\(ko\)/*.md ~/.claude/commands/
# Restart Claude Codeπ¨ Compatibility Notes
- macOS: Full automatic installation support
- Windows: Manual installation only (must use WSL)
- Linux: Manual installation (coming soon)
- Requires Claude Code to be installed in
~/.claude/commands/ - Installation script automatically backs up existing files (macOS only)
π How to Use
π Important: You need to open 2 Claude Code sessions
- Session 1: Opus mode (planning/review)
- Session 2: Sonnet mode (implementation)
π― Auto-open Both Sessions
After installation, automatically open both sessions:
resonance-startOr run without installation using npx:
npx -p claude-resonance resonance-startThis command automatically opens Opus and Sonnet sessions in separate terminals!
π Manual Setup
After installation, you need to open two separate terminals:
Open first terminal and run:
claude --model opusOpen second terminal and run:
claude --model sonnet
Then start the Resonance workflow with these commands:
π /cycle-plan (Opus Session)
Opus session actively communicates with users, asks sufficient questions, analyzes thoroughly, then establishes plans with documentation and creates checkpoints. By designing with Test-Driven Development approach, it induces primarily validated code unlike conventional AI coding.
opus> /cycle-plan "implement payment API"
# Phase 1: Understand requirements through dialogue
# Enter "ultrathink" to proceed to Phase 2
# Phase 2: Deep analysis and TDD planning
# Saves to cycles/YYYY-MM-DD/HHMM-topic-plan.mdπ¨ /cycle-start (Sonnet Session)
Sonnet session, based on Opus's design, develops like a junior developer - filling checkpoints with 'judgments' about why implemented that way, what parts were difficult or ambiguous. Even when Auto-Compact occurs, context is not lost thanks to separate checkpoints.
sonnet> /cycle-start
# Reads plan.md and starts TDD implementation
# Creates/updates checkpoint.json
# Records detailed progress every 20-30 minutesπ /cycle-log (Sonnet Session)
Document what you did, why you made certain decisions, and what you learned as you wrap up implementation work. This log becomes crucial material for the next Opus planning session.
sonnet> /cycle-log
# Document completed work
# Record technical decisions and reasoning
# Share failures and successes
# Saves to cycles/YYYY-MM-DD/HHMM-topic-log.mdβ /cycle-check (Opus Session)
Once work is completed, return to Opus session to review whether it proceeded well according to the initial design and check if any additional work is needed.
opus> /cycle-check
# Reviews Sonnet's implementation
# Critical code quality analysis
# Provides improvement feedbackπ /wrap (Either Session)
Manually wrap up your work session with a comprehensive log and commit all changes together. This command is useful when you want to conclude your work without going through the full cycle workflow.
# In any session (Opus or Sonnet)
> /wrap
# Creates comprehensive work session log
# Documents all accomplishments and changes
# Commits everything in a single clean commit
# Saves to cycles/YYYY-MM-DD/HHMM-topic-wrap.mdUse this when:
- Finishing a work session outside of the cycle workflow
- Need to commit all work with proper documentation
- Want to create a session summary for future reference
π€ Real Collaboration, Not Templates
You: /cycle-plan "Add order book data to real-time trading system"
Opus: "You're managing everything with one MarketDataContext?
Order book updates dozens of times per second - every component will re-render."
You: "So what should I do?"
Opus: "How about splitting contexts?
- MarketDataContext: Prices (less frequent)
- OrderBookContext: Order book (very frequent)
- TradingContext: Risk management (per-user)
Network delays might deliver stale data out of order."
[ultrathink...]
Opus: "OrderBookManager class to validate lastUpdateId sequence,
React.memo for render optimization."Real difference: Simple feature addition β Architecture-level performance optimization
πΈ Real Results
# 4-Hour Work Session
β
6 new files, 2 modified
β
100% test coverage (16 test cases)
β
Commit: 10 files changed, 3,148 insertions
β
Estimated 5 hours β Completed in 4 hours
All progress preserved in cycles/ directory with timestampsπ¨ AI Collaboration in Emergency Situations
Situation: Deposit bug affecting 35 transactions, 19 users impacted
# 2:49 PM - User report: "Fees were deducted from my deposit"
opus> /cycle-plan "Emergency recovery"
Opus: "Checking DB with MCP... Found 35 cases. Pattern shows hourly batch job bug.
Recovery strategy:
1. admin_refund for compensation (preserve originals)
2. Real-time validation during recovery
3. Build prevention system"
sonnet> /cycle-start
β
Created 35 admin_refund records
β
Updated 19 accounts
β
Completed 2,935 KRW refunds
β οΈ Additional report: "Got double refund..."
π Immediate fix: Found duplicate application bug, added correction
opus> /cycle-check
Opus: "Implement prevention immediately"
β
DB trigger blocks deposit+fee combinations
β
Suspicious pattern real-time monitoring
β
Admin action logging systemResult: 100% recovery in 4 hours + prevention system built
Difference: Band-aid β β AnalysisβRecoveryβRoot cause solution β
π Systematic Work History Management
cycles/2025-07-07/
βββ 1449-deposit-bug-plan.md # Opus plan
βββ 1449-deposit-bug-checkpoint.json # Real-time progress
βββ 1449-deposit-bug-log.md # Sonnet implementation
βββ 1449-recovery-execution.sql # Actual recovery scriptKey: When Auto-Compact erases context, checkpoint.json lets you resume exactly:
- Completed and ongoing tasks
- Decisions made and reasoning
- Blockers and attempted solutions
- Next steps and blockers
Result: Work continuity guaranteed without context loss
π Real Results
Before: Context loss β Test-fix infinite loop β Frustration
After 1 Week: Context preserved β TDD completion in one go β Flow state
π Start Now
# Quick start (no installation)
npx claude-resonance
# Or install globally for frequent use
npm install -g claude-resonance
resonanceβ οΈ macOS only | Requires Claude Code in ~/.claude/
In each Claude Code session:
# Session 1 (In Opus session)
/cycle-plan
# Session 2 (In Sonnet session)
/cycle-start
/cycle-log
# Session 1 (Back to Opus session)
/cycle-checkOpus asks questions, understands deeply, and creates plans. Sonnet implements with tests. Rich work logs maintain context.
