agentica-claude-proxy
Guide for integrating Agentica SDK with Claude Code CLI proxy
Best use case
agentica-claude-proxy is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Guide for integrating Agentica SDK with Claude Code CLI proxy
Teams using agentica-claude-proxy should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/agentica-claude-proxy/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How agentica-claude-proxy Compares
| Feature / Agent | agentica-claude-proxy | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Guide for integrating Agentica SDK with Claude Code CLI proxy
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Agentica-Claude Code Proxy Integration
Use this skill when developing or debugging the Agentica-Claude proxy integration.
## When to Use
- Setting up Agentica agents to use Claude Code tools
- Debugging agent hallucination issues
- Fixing permission errors in file operations
- Understanding the REPL response format
## Architecture Overview
```
Agentica Agent → S_M_BASE_URL → Claude Proxy → claude -p → Claude CLI (with tools)
(localhost:2345) (localhost:8080)
```
## Critical Requirements
### 1. --allowedTools Flag (REQUIRED)
Claude CLI in `-p` mode restricts file operations. You MUST add:
```python
subprocess.run([
"claude", "-p", prompt,
"--append-system-prompt", system_prompt,
"--allowedTools", "Read", "Write", "Edit", "Bash", # REQUIRED
])
```
Without this, agents will report "permission denied" for Write/Edit operations.
### 2. SSE Streaming Format (REQUIRED)
Agentica expects SSE streaming, not plain JSON:
```python
# Response format
yield f"data: {json.dumps(chunk)}\n\n"
yield "data: [DONE]\n\n"
```
### 3. REPL Response Format (REQUIRED)
Agents MUST return results as Python code blocks with a return statement:
```python
return "your result here"
```
Agentica's REPL parser extracts code between \`\`\`python and \`\`\`.
## Anti-Hallucination Prompt Engineering
Agents will hallucinate success without actually using tools unless you explicitly warn them:
```
## 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.
```
## Path Sandboxing
Both Claude Code and Agentica have sandboxes:
- `/tmp/` paths are blocked by Claude Code
- Files outside project directory blocked by Agentica
**Solution:** Use project-relative paths like `workspace/` instead of `/tmp/`
## Debugging
### Check Agent Logs
```bash
cat logs/agent-<N>.log
```
Note: Logs only show final conversational response, not tool invocations.
### Test Proxy Directly
```bash
curl -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}'
```
### Verify File Operations
```bash
# After agent claims to create file
ls -la workspace/test.txt
cat workspace/test.txt
```
## Server Commands
### Start Servers
```bash
# 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 2345
```
### Use Swarm
```bash
S_M_BASE_URL=http://localhost:2345 uv run python your_script.py
```
### Health Checks
```bash
curl http://localhost:8080/health # Proxy
curl http://localhost:2345/health # Agentica
```
## Reference Files
- Proxy implementation: `scripts/agentica/claude_proxy.py`
- REPL_BASELINE prompt: `scripts/agentica/claude_proxy.py:49-155`
- Comprehensive test: `workspace/test_swarm_all_tools.py`
- DependencySwarm: `scripts/agentica/dependency_swarm.py`
## Common Errors
| Error | Cause | Fix |
|-------|-------|-----|
| "Permission denied" | Missing --allowedTools | Add `--allowedTools Read Write Edit Bash` |
| 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 |Related Skills
agentica-spawn
Spawn Agentica multi-agent patterns
agentica-server
Agentica server + Claude proxy setup - architecture, startup sequence, debugging
agentica-sdk
Build Python agents with Agentica SDK - @agentic decorator, spawn(), persistence, MCP integration
agentica-prompts
Write reliable prompts for Agentica/REPL agents that avoid LLM instruction ambiguity
agentica-infrastructure
Reference guide for Agentica multi-agent infrastructure APIs
workflow-router
Goal-based workflow orchestration - routes tasks to specialist agents based on user goals
wiring
Wiring Verification
websocket-patterns
Connection management, room patterns, reconnection strategies, message buffering, and binary protocol design.
visual-verdict
Screenshot comparison QA for frontend development. Takes a screenshot of the current implementation, scores it across multiple visual dimensions, and returns a structured PASS/REVISE/FAIL verdict with concrete fixes. Use when implementing UI from a design reference or verifying visual correctness.
verification-loop
Comprehensive verification system covering build, types, lint, tests, security, and diff review before a PR.
vector-db-patterns
Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.
variant-analysis
Find similar vulnerabilities across a codebase after discovering one instance. Uses pattern matching, AST search, Semgrep/CodeQL queries, and manual tracing to propagate findings. Adapted from Trail of Bits. Use after finding a bug to check if the same pattern exists elsewhere.