win4r/claude-code-clawdbot-skill/claude-code-clawdbot-skill-2
Claude Code and agent skill by win4r/claude-code-clawdbot-skill
- community
Checking that the SKILL.md file is still in the repository.
Run Claude Code (Anthropic) from this host via the `claude` CLI (Agent SDK) in headless mode (`-p`) for codebase analysis, refactors, test fixing, and structured output. Use when the user asks to use Claude Code, run `claude -p`, use Plan Mode, auto-approve tools with --allowedTools, generate JSON output, or integrate Claude Code into Clawdbot workflows/cron.
Install
npx vskill@latest install win4r/claude-code-clawdbot-skill/claude-code-clawdbot-skill-2SKILL.md
Claude Code (Clawdbot)
Use the locally installed Claude Code CLI reliably.
This skill supports two execution styles:
- Headless mode (non-interactive): best for normal prompts and structured output.
- Interactive mode (tmux): required for slash commands like
/speckit.*(Spec Kit), which can hang or be killed when run via headless-p.
This skill is for driving the Claude Code CLI, not the Claude API directly.
Quick checks
Verify installation:
Run a minimal headless prompt (prints a single response):
Core workflow
1) Run a headless prompt in a repo
2) Allow tools (auto-approve)
Claude Code supports tool allowlists via --allowedTools. Example: allow read/edit + bash:
3) Get structured output
4) Add extra system instructions
Notes (important)
- After correcting Claude Code's mistakes: Always instruct Claude Code to run:
> "Update your CLAUDE.md so you don't make that mistake again."
This ensures Claude Code records lessons learned and avoids repeating the same errors.
- Claude Code sometimes expects a TTY.
- Headless: this wrapper uses
script(1)to force a pseudo-terminal. - Slash commands (e.g.
/speckit.*) are best run in interactive mode; this wrapper can start an interactive Claude Code session in tmux. - Use
--permission-mode planwhen you want read-only planning. - Keep
--allowedToolsnarrow (principle of least privilege), especially in automation.
High‑leverage Claude Code tips (from the official docs)
1) Always give Claude a way to verify (tests/build/screenshots)
Claude performs dramatically better when it can verify its work. Make verification explicit in the prompt, e.g.:
- “Fix the bug and run tests. Done when
npm testpasses.” - “Implement UI change, take a screenshot and compare to this reference.”
2) Explore → Plan → Implement (use Plan Mode)
For multi-step work, start in plan mode to do safe, read-only analysis:
Then switch to execution (acceptEdits) once the plan is approved.
3) Manage context aggressively: /clear and /compact
Long, mixed-topic sessions degrade quality.
- Use
/clearbetween unrelated tasks. - Use
/compact Focus on <X>when nearing limits to preserve the right details.
4) Rewind aggressively: /rewind (checkpoints)
Claude checkpoints before changes. If an approach is wrong, use /rewind (or Esc Esc) to restore:
- conversation only
- code only
- both
This enables “try something risky → rewind if wrong” loops.
5) Prefer CLAUDE.md for durable rules; keep it short
Best practice is a concise CLAUDE.md (global or per-project) for:
- build/test commands Claude should use
- repo etiquette / style rules that differ from defaults
- non-obvious environment quirks
Overlong CLAUDE.md files get ignored.
6) Permissions: deny > ask > allow (and scope matters)
In .claude/settings.json / ~/.claude/settings.json, rules match in order: deny first, then ask, then allow. Use deny rules to block secrets (e.g. .env, secrets/**).
7) Bash env vars don’t persist; use CLAUDE_ENV_FILE for persistence
Each Bash tool call runs in a fresh shell; export FOO=bar won’t persist. If you need persistent env setup, set (before starting Claude Code):
Claude will source it before each Bash command.
8) Hooks beat “please remember” instructions
Use hooks to enforce deterministic actions (format-on-edit, block writes to sensitive dirs, etc.) when you need guarantees.
9) Use subagents for heavy investigation / independent review
Subagents can read many files without polluting the main context. Use them for broad codebase research or post-implementation review.
10) Treat Claude as a Unix utility (headless, pipes, structured output)
Examples:
This is ideal for CI and automation.
Interactive mode (tmux)
If your prompt contains lines starting with / (slash commands), the wrapper defaults to auto → interactive.
Example:
It will print tmux attach/capture commands so you can monitor progress.
Spec Kit end-to-end workflow (tips that prevent hangs)
When you want Claude Code to drive Spec Kit end-to-end via /speckit.*, do not use headless -p for the whole flow. Use interactive tmux mode because:
- Spec Kit runs multiple steps (Bash + file writes + git) and may pause for confirmations.
- Headless runs can appear idle and be killed (SIGKILL) by supervisors.
Prerequisites (important)
1) Initialize Spec Kit (once per repo)
2) Ensure the folder is a real git repo (Spec Kit uses git branches/scripts):
3) Recommended: set an origin remote (can be a local bare repo) so git fetch --all --prune won’t behave oddly:
4) Give Claude Code enough tool permissions for the workflow:
- Spec creation/tasks/implement need file writes, so include Write.
- Implementation often needs Bash.
Recommended:
Run the full Spec Kit pipeline
Monitoring / interacting
The wrapper prints commands like:
tmux ... attach -t <session>to watch in real timetmux ... capture-pane ...to snapshot output
If Claude Code asks a question mid-run (e.g., “Proceed?”), attach and answer.
Operational gotchas (learned in practice)
1) Vite + ngrok: "Blocked request. This host (...) is not allowed"
If you expose a Vite dev server through ngrok, Vite will block unknown Host headers unless configured.
- Vite 7 expects
server.allowedHoststo betrueorstring[]. - ✅ Allow all hosts (quick):
``ts server: { host: true, allowedHosts: true } ``
- ✅ Allow just your ngrok host (safer):
``ts server: { host: true, allowedHosts: ['xxxx.ngrok-free.app'] } ``
- ❌ Do not set
allowedHosts: 'all'(won't work in Vite 7).
After changing vite.config.*, restart the dev server.
2) Don’t accidentally let your shell eat your prompt
When you drive tmux via a shell command (e.g. tmux send-keys ...), avoid unescaped backticks and shell substitutions in the text you pass. They can be interpreted by your shell before the text even reaches Claude Code.
Practical rule:
- Prefer sending prompts from a file, or ensure the wrapper/script quotes prompt text safely.
3) Long-running dev servers should run in a persistent session
In automation environments, backgrounded vite / ngrok processes can get SIGKILL. Prefer running them in a managed background session (Clawdbot exec background) or tmux, and explicitly stop them when done.
OpenSpec workflow (opsx)
OpenSpec is another spec-driven workflow (like Spec Kit) powered by slash commands (e.g. /opsx:*). In practice it has the same reliability constraints:
- Prefer interactive tmux mode for
/opsx:*commands (avoid headless-pfor the whole flow).
Setup (per machine)
Install CLI:
Setup (per project)
Initialize OpenSpec with tool selection (required):
Tip: disable telemetry if desired:
Recommended end-to-end command sequence
Inside Claude Code (interactive): 1) /opsx:onboard 2) /opsx:new <change-name> 3) /opsx:ff (fast-forward: generates proposal/design/specs/tasks) 4) /opsx:apply (implements tasks) 5) /opsx:archive (optional: archive finished change)
If the UI prompts you for project type/stack, answer explicitly (e.g. “Web app (HTML/JS) with localStorage”).
Bundled script
scripts/claude_code_run.py: wrapper that runs the localclaudebinary with a pseudo-terminal and forwards flags.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingSKILL.md
Popularity
- Repository stars
- 86
- Repository forks
- 30
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/win4r/claude-code-clawdbot-skill/claude-code-clawdbot-skill-2)