agentica-claude-proxy by parcadei/continuous-claude-v3
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill agentica-claude-proxy在开发或调试 Agentica-Claude 代理集成时使用此技能。
Agentica 智能体 → S_M_BASE_URL → Claude 代理 → claude -p → Claude CLI (带工具)
(localhost:2345) (localhost:8080)
Claude CLI 在 -p 模式下会限制文件操作。你必须添加:
subprocess.run([
"claude", "-p", prompt,
"--append-system-prompt", system_prompt,
"--allowedTools", "Read", "Write", "Edit", "Bash", # 必需
])
如果没有此标志,智能体在执行写入/编辑操作时会报告"权限被拒绝"。
Agentica 期望 SSE 流式传输,而非纯 JSON:
# 响应格式
yield f"data: {json.dumps(chunk)}\n\n"
yield "data: [DONE]\n\n"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
智能体必须将结果以带有 return 语句的 Python 代码块形式返回:
return "your result here"
Agentica 的 REPL 解析器会提取 python 和 之间的代码。
除非你明确警告,否则智能体会在未实际使用工具的情况下幻觉成功:
## 反幻觉警告
**立即停止并仔细阅读此内容:**
你可以访问以下工具:Read, Write, Edit, Bash
当任务要求你创建/修改/运行某些内容时:
1. 首先:实际调用工具 (Read, Write, Edit 或 Bash)
2. 其次:等待工具结果
3. 最后:然后根据实际发生的情况返回你的答案
**切勿**跳过工具调用就直接声称成功!
如果你没有调用工具,你就不能声称操作成功。
Claude Code 和 Agentica 都有沙箱:
/tmp/ 路径被 Claude Code 阻止解决方案: 使用项目相对路径,如 workspace/,而不是 /tmp/
cat logs/agent-<N>.log
注意:日志仅显示最终的对话响应,不显示工具调用。
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}'
# 在智能体声称创建文件后
ls -la workspace/test.txt
cat workspace/test.txt
# 终端 1:代理
uv run python scripts/agentica/claude_proxy.py --port 8080
# 终端 2:Agentica 服务器
cd workspace/agentica-research/agentica-server
INFERENCE_ENDPOINT_URL=http://localhost:8080/v1/chat/completions uv run agentica-server --port 2345
S_M_BASE_URL=http://localhost:2345 uv run python your_script.py
curl http://localhost:8080/health # 代理
curl http://localhost:2345/health # Agentica
scripts/agentica/claude_proxy.pyscripts/agentica/claude_proxy.py:49-155workspace/test_swarm_all_tools.pyscripts/agentica/dependency_swarm.py| 错误 | 原因 | 修复方法 |
|---|---|---|
| "权限被拒绝" | 缺少 --allowedTools | 添加 --allowedTools Read Write Edit Bash |
| 智能体声称成功但文件未创建 | 幻觉 | 添加反幻觉提示部分 |
| "无法访问 /tmp/..." | 沙箱限制 | 使用项目相对路径 |
| "APIConnectionError" | 响应格式错误 | 使用 SSE 流式传输 (data: {...}\n\n) |
| "NameError: view_file" | 智能体使用 REPL 函数 | 添加包含原生工具示例的 REPL_BASELINE |
每周安装量
194
代码仓库
GitHub 星标数
3.6K
首次出现
2026年1月22日
安全审计
安装于
opencode188
codex187
cursor185
gemini-cli185
github-copilot182
amp178
Use this skill when developing or debugging the Agentica-Claude proxy integration.
Agentica Agent → S_M_BASE_URL → Claude Proxy → claude -p → Claude CLI (with tools)
(localhost:2345) (localhost:8080)
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.
Agentica expects SSE streaming, not plain JSON:
# Response format
yield f"data: {json.dumps(chunk)}\n\n"
yield "data: [DONE]\n\n"
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 .
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.
Both Claude Code and Agentica have sandboxes:
/tmp/ paths are blocked by Claude CodeSolution: Use project-relative paths like workspace/ instead of /tmp/
cat logs/agent-<N>.log
Note: Logs only show final conversational response, not tool invocations.
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}'
# 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 2345
S_M_BASE_URL=http://localhost:2345 uv run python your_script.py
curl http://localhost:8080/health # Proxy
curl http://localhost:2345/health # Agentica
scripts/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 --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 |
Weekly Installs
194
Repository
GitHub Stars
3.6K
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
opencode188
codex187
cursor185
gemini-cli185
github-copilot182
amp178
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
62,200 周安装
Base技能:Bankrbot/Clawdbot-Skill核心基础功能,GitHub星标984+的开发者工具
1 周安装
Bankr Signals - Base区块链交易信号验证与复制工具,提升交易绩效
1 周安装
Vue.js 官方文档与最佳实践指南 - 从入门到精通,涵盖响应式、TypeScript、组件等核心主题
1 周安装
SQLAlchemy 2.0 中文文档与参考指南 - Python ORM 数据库工具完整技能
1 周安装
Python类型注解模式指南:现代类型提示与Typing最佳实践
24 周安装
Web应用安全模式指南:OWASP Top 10防护、输入验证、身份认证与授权最佳实践
25 周安装