Agent Skillsparcadei/Continuous-Claude-v3 › agentica-claude-proxy

agentica-claude-proxy

GitHub

指导集成 Agentica SDK 与 Claude Code CLI 代理,涵盖架构、关键配置(工具权限、SSE流、REPL格式)、防幻觉提示工程及调试方法。

.claude/skills/agentica-claude-proxy/SKILL.md parcadei/Continuous-Claude-v3

Trigger Scenarios

开发或调试 Agentica-Claude 代理集成 设置 Agentica 使用 Claude 工具 解决文件操作权限错误

Install

npx skills add parcadei/Continuous-Claude-v3 --skill agentica-claude-proxy -g -y
More Options

Non-standard path

npx skills add https://github.com/parcadei/Continuous-Claude-v3/tree/main/.claude/skills/agentica-claude-proxy -g -y

Use without installing

npx skills use parcadei/Continuous-Claude-v3@agentica-claude-proxy

指定 Agent (Claude Code)

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

安装 repo 全部 skill

npx skills add parcadei/Continuous-Claude-v3 --all -g -y

预览 repo 内 skill

npx skills add parcadei/Continuous-Claude-v3 --list

SKILL.md

Frontmatter
{
    "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:

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

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

Version History

  • d07ff4b Current 2026-08-20 12:45

Same Skill Collection

.claude/plugins/braintrust-tracing/skills/trace-claude-code/SKILL.md
.claude/skills/agentica-infrastructure/SKILL.md
.claude/skills/agentica-prompts/SKILL.md
.claude/skills/agentica-sdk/SKILL.md
.claude/skills/agentica-server/SKILL.md
.claude/skills/archive/leann-search/SKILL.md
.claude/skills/ast-grep-find/SKILL.md
.claude/skills/braintrust-tracing/SKILL.md
.claude/skills/cli-reference/SKILL.md
.claude/skills/commit/SKILL.md
.claude/skills/compound-learnings/SKILL.md
.claude/skills/continuity_ledger/SKILL.md
.claude/skills/create_handoff/SKILL.md
.claude/skills/dead-code/SKILL.md
.claude/skills/debug-hooks/SKILL.md
.claude/skills/debug/SKILL.md
.claude/skills/describe_pr/SKILL.md
.claude/skills/discovery-interview/SKILL.md
.claude/skills/explore/SKILL.md
.claude/skills/firecrawl-scrape/SKILL.md
.claude/skills/fix/SKILL.md
.claude/skills/github-search/SKILL.md
.claude/skills/help/SKILL.md
.claude/skills/hook-developer/SKILL.md
.claude/skills/implement_plan_micro/SKILL.md
.claude/skills/implement_plan/SKILL.md
.claude/skills/implement_task/SKILL.md
.claude/skills/loogle-search/SKILL.md
.claude/skills/math-help/SKILL.md
.claude/skills/math-router/SKILL.md
.claude/skills/math-unified/SKILL.md
.claude/skills/math/abstract-algebra/fields/SKILL.md
.claude/skills/math/abstract-algebra/groups/SKILL.md
.claude/skills/math/abstract-algebra/rings/SKILL.md
.claude/skills/math/category-theory/categories-functors/SKILL.md
.claude/skills/math/category-theory/limits-colimits/SKILL.md
.claude/skills/math/category-theory/natural-transformations/SKILL.md
.claude/skills/math/complex-analysis/analytic-functions/SKILL.md
.claude/skills/math/complex-analysis/contour-integrals/SKILL.md
.claude/skills/math/complex-analysis/residues/SKILL.md
.claude/skills/math/functional-analysis/banach-spaces/SKILL.md
.claude/skills/math/functional-analysis/hilbert-spaces/SKILL.md
.claude/skills/math/functional-analysis/operator-theory/SKILL.md
.claude/skills/math/graph-number-theory/graph-algorithms/SKILL.md
.claude/skills/math/graph-number-theory/modular-arithmetic/SKILL.md
.claude/skills/math/graph-number-theory/prime-numbers/SKILL.md
.claude/skills/math/information-theory/channel-capacity/SKILL.md
.claude/skills/math/information-theory/entropy/SKILL.md
.claude/skills/math/information-theory/source-coding/SKILL.md

Metadata

Files
0
Version
d07ff4b
Hash
4e754f40
Indexed
2026-08-20 12:45

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 06:52
浙ICP备14020137号-1 $Гость$