Loading...
Loading...
Guide for integrating Agentica SDK with Claude Code CLI proxy
npx skill4agent add parcadei/continuous-claude-v3 agentica-claude-proxyAgentica Agent → S_M_BASE_URL → Claude Proxy → claude -p → Claude CLI (with tools)
(localhost:2345) (localhost:8080)-psubprocess.run([
"claude", "-p", prompt,
"--append-system-prompt", system_prompt,
"--allowedTools", "Read", "Write", "Edit", "Bash", # REQUIRED
])# Response format
yield f"data: {json.dumps(chunk)}\n\n"
yield "data: [DONE]\n\n"return "your result here"## ANTI-HALLUCINATION WARNING
**STOP AND READ THIS CAREFULLY:**
You have access to these tools: Read, Write, Edit, Bash
When the task asks you to create/modify/run something:
1. FIRST: Actually invoke the tool (Read, Write, Edit, or Bash)
2. SECOND: Wait for the tool result
3. THIRD: Then return your answer based on what actually happened
**DO NOT** skip the tool invocation and just claim success!
If you didn't invoke a tool, you CANNOT claim the action succeeded./tmp/workspace//tmp/cat logs/agent-<N>.logcurl -s http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "claude", "messages": [{"role": "user", "content": "Create file at workspace/test.txt"}], "stream": false}'# After agent claims to create file
ls -la workspace/test.txt
cat workspace/test.txt# Terminal 1: Proxy
uv run python scripts/agentica/claude_proxy.py --port 8080
# Terminal 2: Agentica Server
cd workspace/agentica-research/agentica-server
INFERENCE_ENDPOINT_URL=http://localhost:8080/v1/chat/completions uv run agentica-server --port 2345S_M_BASE_URL=http://localhost:2345 uv run python your_script.pycurl http://localhost:8080/health # Proxy
curl http://localhost:2345/health # Agenticascripts/agentica/claude_proxy.pyscripts/agentica/claude_proxy.py:49-155workspace/test_swarm_all_tools.pyscripts/agentica/dependency_swarm.py| Error | Cause | Fix |
|---|---|---|
| "Permission denied" | Missing --allowedTools | Add |
| Agent claims success but file not created | Hallucination | Add anti-hallucination prompt section |
| "Cannot access /tmp/..." | Sandbox restriction | Use project-relative paths |
| "APIConnectionError" | Wrong response format | Use SSE streaming (data: {...}\n\n) |
| "NameError: view_file" | Agent using REPL functions | Add REPL_BASELINE with native tool examples |