Skip to main content
skill CX Codex

agentica-claude-proxy — Claude Code skill: Agentica SDK proxy setup

A guide to wiring the Agentica SDK to the Claude CLI through a proxy, so agents can use file tools and you can trace permission errors and hallucinations.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add parcadei/Continuous-Claude-v3 --skill agentica-claude-proxy -a claude-code
Open on GitHub

What agentica-claude-proxy does

Reach for this skill when an Agentica agent needs to write files or run commands through claude -p. It lays out the chain: the agent talks to S_M_BASE_URL at localhost:2345, the Agentica server forwards to a proxy at localhost:8080, and the proxy calls the CLI. The frequent failure is file access: in -p mode the CLI refuses Write and Edit unless you pass --allowedTools Read Write Edit Bash. Skip that flag and the agent reports permission denied.

Responses must stream as SSE, not plain JSON. The proxy emits chunks as data: {…} lines and closes with data: [DONE]. Agents return their result inside a Python block with a return statement, because that is what the Agentica parser reads. There is also a warning template to paste into the system prompt: invoke the tool first, read its output, only then answer. Sandboxes differ on each side. Claude blocks /tmp/ paths, Agentica blocks anything outside the project, so the examples stay in workspace/.

Debugging goes through logs/agent-<N>.log and direct curl calls to localhost:8080/v1/chat/completions. Running it needs uv plus the scripts: the proxy lives in scripts/agentica/claude_proxy.py, the dependency swarm in scripts/agentica/dependency_swarm.py.

What it helps with

  • give Agentica agents working access to CLI file tools
  • find out why an agent keeps hitting permission errors
  • stop agents from claiming success without running a tool
  • fix connection errors caused by a non-SSE response
  • confirm a file was actually written to disk

Example prompts for the agent

  • Start the Agentica proxy on port 8080 and confirm the agent can call Read, Write, Edit and Bash
  • The agent says it created the file but nothing is there — add the anti-hallucination block to the system prompt
  • Send a test request to localhost:8080/v1/chat/completions with curl and show me the response

How to install agentica-claude-proxy

1Skills CLI (Vercel)

npx skills add parcadei/Continuous-Claude-v3 --skill agentica-claude-proxy -a claude-code

2Manually: put the files in place

~/.claude/skills/agentica-claude-proxy/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/agentica-claude-proxy/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about agentica-claude-proxy

How do I install agentica-claude-proxy in Claude Code?

Run npx skills add parcadei/Continuous-Claude-v3 --skill agentica-claude-proxy -a claude-code; the skill lands at ~/.claude/skills/agentica-claude-proxy/SKILL.md.

What does agentica-claude-proxy do?

It documents the proxy link between the Agentica SDK and the Claude CLI, covering the --allowedTools flag, SSE streaming and the return format the parser expects.

Why does the agent get permission denied on Write or Edit?

The CLI limits file operations in -p mode. Add --allowedTools Read Write Edit Bash to the claude -p call so those tools are permitted.

Source text

SKILL.md · MIT
---
name: agentica-claude-proxy
description: Guide for integrating Agentica SDK with Claude Code CLI proxy
allowed-tools: [Read, Bash]
user-invocable: false
---

# 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 |

© parcadei · MIT · parcadei/Continuous-Claude-v3

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set77

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor