One-shot coding agent using Claude Code CLI. Clean, simple, no interactive prompts.
# Basic usage
claude --permission-mode bypassPermissions --print "Your task here"
Required parameters:
--permission-mode bypassPermissions — skips confirmation dialogs--print — non-interactive mode, full tool access, outputs result# In a project directory
cd /path/to/project && claude --permission-mode bypassPermissions --print "Add error handling to the API calls"
For longer tasks, run in background:
bash workdir:/path/to/project background:true command:"claude --permission-mode bypassPermissions --print 'Build a REST API for todos'"
Monitor with:
process action:list
process action:log sessionId:XXX
process action:poll sessionId:XXX
Default behavior: Run in the current working directory or specify via workdir:
# Specify project directory
bash workdir:~/my-project command:"claude --permission-mode bypassPermissions --print 'Your task'"
# Or cd first
cd ~/my-project && claude --permission-mode bypassPermissions --print "Your task"
claude --permission-mode bypassPermissions --print "Add a dark mode toggle to the navbar component"
claude --permission-mode bypassPermissions --print "Refactor the auth module to use dependency injection"
claude --permission-mode bypassPermissions --print "Debug why the login form isn't submitting. Check network requests and form validation."
claude --permission-mode bypassPermissions --print "Write unit tests for the UserService class with 80% coverage"
claude --permission-mode bypassPermissions --print "Review the changes in src/api/ and suggest improvements"
For background tasks, add a wake trigger:
bash workdir:~/project background:true command:"claude --permission-mode bypassPermissions --print 'Build feature X.
When done, run: openclaw system event --text \"Done: Feature X built\" --mode now'"
| Agent | PTY Required | Flags |
|---|---|---|
| -------------- | -------------- | -------------------------------- |
| Claude Code | ❌ No | --print --permission-mode bypassPermissions |
| Codex/Pi | ✅ Yes | pty:true |
--print --permission-mode bypassPermissions — ensures smooth executionprocess action:log to check progress共 1 个版本