← 返回
未分类

claude-code-noninteractive-in-node

Call Claude Code as a non-interactive coding agent on a remote machine via OpenClaw Node. Use when: (1) Your coding agent is on a separate machine from the G...
Call Claude Code as a non-interactive coding agent on a remote machine via OpenClaw Node. Use when: (1) Your coding agent is on a separate machine from the G...
xxuzzwz xxuzzwz 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 278
下载
💾 0
安装
1
版本
#latest

概述

Claude Code Remote (OpenClaw Node)

通过 OpenClaw Node 在远程机器上以非交互模式调用 Claude Code。

Gateway ──exec host=node──→ Node ──bash -lc──→ claude --bare ──→ AI API

Quick Reference

场景命令模板
---------------
短任务bash -lc 'cd && claude --bare -p "<任务>" --max-turns 10'
长任务流式bash -lc 'cd && claude --bare -p "<任务>" --output-format stream-json --verbose --include-partial-messages --max-turns 30'
全权限bash -lc 'cd && claude --bare -p "<任务>" --dangerously-skip-permissions --output-format stream-json --verbose --include-partial-messages --max-turns 30'
只读分析bash -lc 'cd && claude --bare -p "<任务>" --permission-mode plan --allowedTools "Read,Glob,Grep,LSP" --max-turns 10'

Key Differences from Local

AspectLocalRemote (Node)
------------------------------
Command wrapperDirectbash -lc '...' required
Project pathNativeUse WSL/Linux paths for speed
Env loadingShell-dependentMust be before .bashrc interactive guard
Exec toolStandardhost=node node=

Permission Modes

Same four levels as claude-code-local. See references/permissions.md.

LevelRemote-Specific Note
----------------------------
1 ReadSafe—no filesystem writes
2 Analyzebash -lc may need Node approval
3 EditWrites may trigger Node security policy
4 FullSome Nodes block certain write operations

Node Security Workarounds

  • Multi-line heredocs → Write script to /tmp/ first
  • Inline Python → Same, use script file
  • Write operations → Backup before modifying: cp f f.bak.$(date +%F)

OpenClaw Exec Configuration

{
  "command": "bash -lc 'cd <project> && claude --bare -p \"<task>\" --max-turns 10'",
  "host": "node",
  "node": "<your-node-id>",
  "background": true,
  "timeout": 600
}

Worktree Setup

For projects on slow cross-filesystem mounts (e.g., WSL /mnt/c/):

git worktree add -b work-branch /home/user/project-worktree main

Shares git data, keeps working files on fast native filesystem.

Environment Setup

Ensure API credentials load in non-interactive shells:

# In ~/.bashrc, BEFORE the interactive guard:
export ANTHROPIC_API_KEY=sk-...

# Interactive guard (keep as-is):
case $- in
    *i*) ;;
      *) return;;
esac

Timing & Post-Task

Same as claude-code-local. See its SKILL.md for timing table and checklist.

References

  • references/permissions.md — Detailed permission mode behavior
  • references/troubleshooting.md — Remote-specific failure modes

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-08 03:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 196 📥 67,848
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,768
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 73 📥 182,225