claude-skill
FreeNo executable scriptsNot checkedUse when user asks to leverage claude or claude code to do something (e.g. implement a feature design or review codes, etc). Provides non-interactive…
by majiayu000★ 31 GitHub starsAbout this skill
Claude Code Headless Mode
You are operating in Claude Code headless mode - a non-interactive automation mode for hands-off task execution.
Prerequisites
Before using this skill, ensure Claude Code CLI is installed and configured:
Installation verification:
claude --versionFirst-time setup: If not installed, guide the user to install Claude Code CLI with command
npm install -g @anthropic-ai/claude-code.
References
- For extended usage scenarios, see
references/examples.md.
Core Principles
Autonomous Execution
- Execute tasks from start to finish without seeking approval for each action
- Make confident decisions based on best practices and task requirements
- Only ask questions if critical information is genuinely missing
- Prioritize completing the workflow over explaining every step
Output Behavior
- Stream progress updates as you work
- Provide a clear, structured final summary upon completion
- Focus on actionable results and metrics over lengthy explanations
- Report what was done, not what could have been done
Permission Modes
Claude Code uses permission modes to control what operations are permitted. Set via --permission-mode flag:
| Mode | Description |
|---|---|
default |
Standard behavior - prompts for permission on first use of each tool |
acceptEdits |
Automatically accepts file edit permissions for the session (Default for this skill) |
plan |
Plan Mode - Claude can analyze but not modify files or execute commands |
bypassPermissions |
Skips all permission prompts (requires safe environment - see warning below) |
Accept Edits Mode (--permission-mode acceptEdits) - Default
- Automatically accepts file edits without prompts
- Still requires approval for shell commands
- Recommended for most programming tasks
- This is the default mode for this skill
Default Mode (--permission-mode default)
- Requires approval for file edits and command execution
- Safe for exploration and analysis tasks
Plan Mode (--permission-mode plan)
- Read-only analysis mode
- Claude can explore and analyze but cannot modify files
- Cannot execute commands
- Useful for code review and architecture analysis
Bypass Permissions Mode (--permission-mode bypassPermissions)
- Skips ALL permission prompts
- ⚠️ WARNING: Only use in externally sandboxed environments (containers, VMs)
- NEVER use on your development machine without proper isolation
- Use with
--allowedToolsto restrict specific tools for safety
Claude Code CLI Commands
Note: The following commands are based on the official Claude Code headless mode documentation.
Basic Headless Execution
Use the --print (or -p) flag to run in non-interactive mode:
claude -p "analyze the codebase structure and explain the architecture"
Tool Permissions
Control which tools Claude can use with --allowedTools and --disallowedTools:
# Allow specific tools
claude -p "stage my changes and write commits" \
--allowedTools "Bash,Read" \
--permission-mode acceptEdits
# Allow multiple tools (space-separated)
claude -p "implement the feature" \
--permission-mode acceptEdits \
--allowedTools Bash Read Write Edit
# Allow tools with restrictions (comma-separated string)
claude -p "run tests" \
--permission-mode acceptEdits \
--allowedTools "Bash(npm test),Read"
# Disallow specific tools
claude -p "analyze the code" \
--disallowedTools "Bash,Write"
Using Permission Modes
Control how permissions are handled:
# Accept file edits automatically (recommended for programming)
claude -p "implement the user authentication feature" \
--permission-mode acceptEdits \
--allowedTools "Bash,Read,Write,Edit"
# Combine with allowed tools for safe automation
claude -p "fix the bug in login flow" \
--permission-mode acceptEdits \
--allowedTools "Read,Write,Edit,Bash(npm test)"
Output Formats
Text Output (Default)
claude -p "explain file src/components/Header.tsx"
# Output: Plain text response
JSON Output
Returns structured data including metadata:
claude -p "how does the data layer work?" --output-format json
Response format:
{
"type": "result",
"subtype": "success",
"total_cost_usd": 0.003,
"is_error": false,
"duration_ms": 1234,
"duration_api_ms": 800,
"num_turns": 6,
"result": "The response text here...",
"session_id": "abc123"
}
Streaming JSON Output
Streams each message as it is received:
claude -p "build an application" \
--permission-mode acceptEdits \
--output-format stream-json
Each conversation begins with an initial init system message, followed by user and assistant messages, followed by a final result system message with stats.
Multi-Turn Conversations
For multi-turn conversations, you can resume or continue sessions:
# Continu
Install claude-skill in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the claude-skill skill do?
Use when user asks to leverage claude or claude code to do something (e.g. implement a feature design or review codes, etc). Provides non-interactive automation mode for hands-off task execution without approval prompts.
How do I install the claude-skill skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the claude-skill skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
by Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
by Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
by Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
by Anthropic