AG

agentica-claude-proxy

Integration reference for connecting Agentica agents to Claude Code CLI with proper tool permissions.

Install

mkdir -p .claude/skills/agentica-claude-proxy && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3775" && unzip -o skill.zip -d .claude/skills/agentica-claude-proxy && rm skill.zip

Installs to .claude/skills/agentica-claude-proxy

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Guide for integrating Agentica SDK with Claude Code CLI proxy
61 charsno explicit “when” trigger
Advanced

Key capabilities

  • Inject system prompts for Claude Code CLI
  • Force use of required tools via --allowedTools
  • Format agent responses as SSE streams
  • Extract responses from Python code blocks
  • Implement anti-hallucination warning prompts

How it works

It mediates traffic through a proxy layer that enforces strict tool usage flags and parses REPL code blocks to ensure agent execution matches tool operations.

Inputs & outputs

You give it
Sub-process call to claude with specific system prompt
You get back
SSE stream with JSON formatted chunks or final REPL return

When to use agentica-claude-proxy

  • Setting up Claude Code CLI proxies
  • Debugging agent permission issues
  • Configuring agent response parsing
  • Preventing tool invocation hallucinations

About this skill

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:

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:

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

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

cat logs/agent-<N>.log

Note: Logs only show final conversational response, not tool invocations.

Test Proxy Directly

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

# After agent claims to create file
ls -la workspace/test.txt
cat workspace/test.txt

Server Commands

Start Servers

# 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

S_M_BASE_URL=http://localhost:2345 uv run python your_script.py

Health Checks

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

ErrorCauseFix
"Permission denied"Missing --allowedToolsAdd --allowedTools Read Write Edit Bash
Agent claims success but file not createdHallucinationAdd anti-hallucination prompt section
"Cannot access /tmp/..."Sandbox restrictionUse project-relative paths
"APIConnectionError"Wrong response formatUse SSE streaming (data: {...}\n\n)
"NameError: view_file"Agent using REPL functionsAdd REPL_BASELINE with native tool examples

When not to use it

  • Direct interactions with Claude Code CLI that don't involve the Agentica SDK
  • Environment where permissions are unrestricted

Prerequisites

Claude CLI installedAccess to localhost:2345/8080

Limitations

  • Restricted by Claude Code sandbox boundaries
  • Requires specific Python code block formatting in outputs

How it compares

It treats the AI as a restricted process that must provide explicit evidence of tool usage instead of claiming success based on intent.

Compared to similar skills

agentica-claude-proxy side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
agentica-claude-proxy (this skill)17moReviewAdvanced
telegram-bot-builder1066moReviewIntermediate
reddit-api34moReviewIntermediate
hugging-face-tool-builder76moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

reddit-api

alinaqi

Reddit API with PRAW (Python) and Snoowrap (Node.js)

334

hugging-face-tool-builder

patchy631

Use this skill when the user wants to build tool/scripts or achieve a task where using data from the Hugging Face API would help. This is especially useful when chaining or combining API calls or the task will be repeated/automated. This Skill creates a reusable script to fetch, enrich or process data.

714

klingai-rate-limits

jeremylongshore

Handle Kling AI rate limits with proper backoff strategies. Use when experiencing 429 errors or building high-throughput systems. Trigger with phrases like 'klingai rate limit', 'kling ai 429', 'klingai throttle', 'klingai backoff'.

29

juicebox-install-auth

jeremylongshore

Install and configure Juicebox SDK/CLI authentication. Use when setting up a new Juicebox integration, configuring API keys, or initializing Juicebox in your project. Trigger with phrases like "install juicebox", "setup juicebox", "juicebox auth", "configure juicebox API key".

28

superpowers-python-automation

anthonylee991

Implements reliable automations in Python for REST APIs: httpx/requests patterns, retries, timeouts, pagination, typing, config, logging, and tests. Use when writing Python scripts/services that call external APIs.

36

Search skills

Search the agent skills registry