claude-code
Original:🇺🇸 English
Translated
[Hyper] Use when the user explicitly wants Anthropic Claude Code CLI (`claude`) for an isolated session, non-interactive (`-p`) run, session resume by ID or name, or a CI-friendly `--bare` invocation. Trigger phrases: "use claude code", "ask claude", "run claude", "continue the last claude session", "resume the auth-refactor claude session", or "use Anthropic's CLI to inspect or fix this repo".
2installs
Sourcealpoxdev/hypercore
Added on
NPX Install
npx skill4agent add alpoxdev/hypercore claude-codeTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →@rules/routing.md
Claude Code Skill
Source of truth: https://code.claude.com/docs/en/cli-reference.
Defaults
| Parameter | Default |
|---|---|
| Model selection | Use Claude Code CLI default unless the user explicitly asks for |
| Effort | Use CLI default unless the user explicitly asks for |
| Permission mode | |
| Headless mode | |
| CI / scripted run | Add |
| Resume target | |
Do NOT ask the user for model or effort unless explicitly requested.
Routing
Use this skill when the request actually needs the CLI or a separate Claude Code session.
claude- Read rules/routing.md before building a command when the request might be out of scope.
- Route away to direct editing or another skill when the user wants generic writing, documentation cleanup, or local edits without needing the CLI itself.
claude
Examples
Positive triggers:
- "Use Claude Code to review this repository and summarize the risks."
- "Run in print mode and analyze this architecture."
claude - "Continue the last Claude Code session and ask it to finish the patch."
- "Resume the claude session and apply the next fix."
auth-refactor - "Use so this CI step does not pick up local hooks."
claude --bare -p
Negative triggers:
- "Rewrite this runbook for readability."
- "Create a new skill for our repo."
Boundary trigger:
- "Research Claude Code permissions and tell me what they do."
Use this skill only if the user wants the CLI involved; otherwise route to research or direct documentation work.
claude
Critical: Print Mode
Always use / for non-interactive Claude Code runs. Positional prompts without start the interactive REPL instead, so a script that omits will hang waiting for a TTY.
-p--print-p-pbash
# Non-interactive (headless / SDK)
claude --permission-mode default -p "your prompt here"
# Interactive REPL (initial prompt only — does NOT exit)
claude "your prompt here"-p-pBare Mode for CI and Scripts
Add for any scripted or CI invocation. It skips auto-discovery of hooks, skills, plugins, MCP servers, auto memory, and CLAUDE.md so the call returns the same result on every machine. Bare mode also skips the OAuth keychain, so it requires , , or an passed through .
--bareANTHROPIC_API_KEYANTHROPIC_AUTH_TOKENapiKeyHelper--settingsbash
ANTHROPIC_API_KEY=$KEY claude --bare -p "Summarize the diff" --allowedTools "Read"For pipelines that need a long-lived OAuth token instead of an API key, generate one with and export it as (note: bare mode does NOT read — use or when is set).
claude setup-tokenCLAUDE_CODE_OAUTH_TOKENCLAUDE_CODE_OAUTH_TOKENANTHROPIC_API_KEYapiKeyHelper--bareRunning a Task
Read references/recipes.md for concrete command recipes before changing permission modes, resuming a session, restricting tools, or adding extra directories.
Permission Mode Selection
Six modes are supported. Pick the loosest mode the task safely allows.
| Flag | When to use |
|---|---|
| General Claude Code usage with normal approval prompts |
| Read-only analysis or planning with no file changes or shell execution |
| The user explicitly wants Claude Code to write files (also auto-approves common filesystem commands like |
| Long autonomous tasks where prompt fatigue matters; a server-side classifier blocks risky actions but does not replace review |
| Locked-down CI: only |
| Containers / VMs only — equivalent to |
Auto mode requires Claude Code v2.1.83+ and is gated by plan, admin policy, model, and provider; if the CLI reports it as unavailable, do not retry.
Command Discipline
- Start from .
claude --permission-mode default -p "your prompt here" - Add or
--model <model>only when the user explicitly asks.--effort <level> - Use only when the user wants something other than
--output-format. Supported values:text(default),text,json.stream-json - For schema-validated structured output, pair with
--output-format json.--json-schema '<JSON Schema>' - Add and/or
--max-turns <N>for autonomous print-mode runs that must not loop forever.--max-budget-usd <dollars> - Use in print mode when a graceful degrade beats a hard failure on overload.
--fallback-model <name> - Use when the task needs files outside the launch directory. (
--add-dir <path>grants file access; it does NOT load--add-dirconfiguration from the added directory, except for.claude/.).claude/skills/ - Restrict tools with ,
--allowedTools, or--disallowedTools(use--toolsto disable all built-ins,--tools ""for all, or a comma list like--tools "default")."Bash,Edit,Read" - Add to / replace the system prompt with ,
--append-system-prompt,--append-system-prompt-file, or--system-prompt.--system-prompt-file - Load MCP servers with ; add
--mcp-config <file-or-json>to ignore every other MCP source.--strict-mcp-config - Ask before using . Prefer
--dangerously-skip-permissionsfor normal file edits.--permission-mode acceptEdits
Resuming a Session
bash
# Latest session in the current directory
claude --continue -p "continue the previous task" # short: claude -c -p "..."
# Specific session by ID or by display name
claude --resume "auth-refactor" -p "continue with this follow-up" # short: -r
claude --resume <session-id> -p "continue with this follow-up"
# Pin a UUID so a script always reuses the same session
claude --session-id 550e8400-e29b-41d4-a716-446655440000 -p "..." # must be a valid UUID
# Resume sessions linked to a pull request
claude --from-pr 123 -p "address review comments"Use for the latest conversation in the current directory.
Use for a specific session by ID or by display name (set with / , or by mid-session).
Use only with a real UUID — the CLI rejects other strings.
When resuming, keep the existing session's behavior unless the user explicitly asks to change the model, effort, or permission mode.
Add only when the user wants to branch from the existing session instead of reusing it.
--continue--resume--name-n/rename--session-id--fork-sessionAfter Completion
- Summarize the result, including any warnings or partial output.
- Tell the user they can resume with (
claude --continue),-c(claude --resume <id-or-name>), or-r.claude --from-pr <pr> - Ask whether to continue, adjust the prompt, or switch back to direct work.
Critical Evaluation
Treat Claude Code as a colleague, not an authority.
- Trust your own grounded knowledge when you are confident.
- Verify disagreements with current docs or primary sources before accepting a claim.
- Remember that a separate Claude Code session can still be wrong or stale.
- Let the user decide when there is genuine ambiguity.
Authentication
The CLI reads credentials in this precedence order: cloud provider env vars ( / / ) → → → → → subscription OAuth from .
CLAUDE_CODE_USE_BEDROCK_VERTEX_FOUNDRYANTHROPIC_AUTH_TOKENANTHROPIC_API_KEYapiKeyHelperCLAUDE_CODE_OAUTH_TOKEN/login- Browser login: run once and follow the prompt, or
claude(useclaude auth loginfor Console billing,--consoleto force SSO).--sso - Inspect / sign out: or
claude auth statusfrom inside a session;/statusorclaude auth logoutto clear credentials./logout - Long-lived OAuth for CI: prints a token; export it as
claude setup-token(not read byCLAUDE_CODE_OAUTH_TOKEN).--bare - Direct API: set for
ANTHROPIC_API_KEY,X-Api-KeyforANTHROPIC_AUTH_TOKENthrough a gateway.Authorization: Bearer
Error Handling
- : tell the user Claude Code CLI is not installed; they can run
command not found: claudeafter setup.claude install stable - Auth errors: confirm precedence above (e.g. an unset may be needed when a subscription is active), then re-run
unset ANTHROPIC_API_KEYorclaude auth loginto confirm.claude auth status - Permission blocks: retry with an appropriate (
--permission-modefor read-only,planfor file edits) or adjustacceptEdits/--allowedTools. Do not escalate to--disallowedToolswithout explicit user approval.--dangerously-skip-permissions - Session not found: run without an argument to pick from a list, or switch to
claude --resumefor the current directory;claude --continuerequires a UUID.--session-id - Auto-mode unavailable: this is gated by plan, admin policy, model, and provider — it is not a transient outage; fall back to or
default.acceptEdits - Invalid flag or model errors: check , then re-run with supported options.
claude --helpdoes not list every flag — consult the CLI reference for the full list.claude --help