π The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
Checkpoint: File edits
rUved4c4da7b5b3
diff --git a/README.md b/README.mdindex 5d5876eb55..e3e9a43fdf 100644--- a/README.md+++ b/README.md@@ -260,6 +260,124 @@ Smart routing skips expensive LLM calls when possible. Simple edits use WASM (fr</details>+<details>+<summary>β‘ <strong>Agent Booster (WASM)</strong> β 352x faster code transforms, skip LLM entirely</summary>++Agent Booster uses WebAssembly to handle simple code transformations without calling the LLM at all. When the hooks system detects a simple task, it routes directly to Agent Booster for instant results.++**Supported Transform Intents:**++| Intent | What It Does | Example |+|--------|--------------|---------|+| `var-to-const` | Convert var/let to const | `var x = 1` β `const x = 1` |+| `add-types` | Add TypeScript type annotations | `function foo(x)` β `function foo(x: string)` |+| `add-error-handling` | Wrap in try/catch | Adds proper error handling |+| `async-await` | Convert promises to async/await | `.then()` chains β `await` |+| `add-logging` | Add console.log statements | Adds debug logging |+| `remove-console` | Strip console.* calls | Removes all console statements |++**Hook Signals:**++When you see these in hook output, the system is telling you how to optimize:++```bash+# Agent Booster available - skip LLM entirely+[AGENT_BOOSTER_AVAILABLE] Intent: var-to-const+β Use Edit tool directly, 352x faster than LLM++# Model recommendation for Task tool+[TASK_MODEL_RECOMMENDATION] Use model="haiku"+β Pass model="haiku" to Task tool for cost savings+```++**Performance:**++| Metric | Agent Booster | LLM Call |+|--------|---------------|----------|+| Latency | <1ms | 2-5s |+| Cost | $0 | $0.0002-$0.015 |+| Speedup | **352x faster** | baseline |++</details>++<details>+<summary>π° <strong>Token Optimizer</strong> β 30-50% token reduction</summary>++The Token Optimizer integrates agentic-flow optimizations to reduce API costs by compressing context and caching results.++**Savings Breakdown:**++| Optimization | Token Savings | How It Works |+|--------------|---------------|--------------|+| ReasoningBank retrieval | -32% | Fetches relevant patterns instead of full context |+| Agent Booster edits | -15% | Simple edits skip LLM entirely |+| Cache (95% hit rate) | -10% | Reuses embeddings and patterns |+| Optimal batch size | -20% | Groups related operations |+| **Combined** | **30-50%** | Stacks multiplicatively |++**Usage:**++```typescript+import { getTokenOptimizer } from '@claude-flow/integration';+const optimizer = await getTokenOptimizer();++// Get compact context (32% fewer tokens)+const ctx = await optimizer.getCompactContext("auth patterns");++// Optimized edit (352x faster for simple transforms)+await optimizer.optimizedEdit(file, oldStr, newStr, "typescript");++// Optimal config for swarm (100% success rate)+const config = optimizer.getOptimalConfig(agentCount);+```++</details>++<details>+<summary>π‘οΈ <strong>Anti-Drift Swarm Configuration</strong> β Prevent goal drift in multi-agent work</summary>++Complex swarms can drift from their original goals. Claude-Flow V3 includes anti-drift defaults that prevent agents from going off-task.++**Recommended Configuration:**++```javascript+// Anti-drift defaults (ALWAYS use for coding tasks)+swarm_init({+ topology: "hierarchical", // Single coordinator enforces alignment+ maxAgents: 8, // Smaller team = less drift surface+ strategy: "specialized" // Clear roles reduce ambiguity+})+```++**Why This Prevents Drift:**++| Setting | Anti-Drift Benefit |+|---------|-------------------|+| `hierarchical` | Coordinator validates each output against goal, catches divergence early |+| `maxAgents: 6-8` | Fewer agents = less coordination overhead, easier alignment |+| `specialized` | Clear boundaries - each agent knows exactly what to do, no overlap |+| `raft` consensus | Leader maintains authoritative state, no conflicting decisions |++**Additional Anti-Drift Measures:**++- Frequent checkpoints via `post-task` hooks+- Shared memory namespace for all agents+- Short task cycles with verification gates+- Hierarchical coordinator reviews all outputs++**Task β Agent Routing (Anti-Drift):**++| Code | Task Type | Recommended Agents |+|------|-----------|-------------------|+| 1 | Bug Fix | coordinator, researcher, coder, tester |+| 3 | Feature | coordinator, architect, coder, tester, reviewer |+| 5 | Refactor | coordinator, architect, coder, reviewer |+| 7 | Performance | coordinator, perf-engineer, coder |+| 9 | Security | coordinator, security-architect, auditor |+| 11 | Memory | coordinator, memory-specialist, perf-engineer |++</details>+### Claude Code: With vs Without Claude-Flow| Capability | Claude Code Alone | Claude Code + Claude-Flow |