Skip to content
Skills Library
AI & agents · Tool integration

connect-claude-cli

/connect-claude-cli

Connect or troubleshoot local Claude Code with an Anthropic-compatible API gateway: verify real tool artifacts in an isolated environment first, then save a reversible default configuration only with user authorization. Trigger on "connect Claude Code", "switch model gateway", "CLI not responding", "tool calls not executing", or "output truncated" when validating CLI flags and permissions on a new endpoint, auth method, or model. Core discipline: connect first, verify quality second, persist last; a model claiming it wrote a file is not an artifact, read the physical file back; keys are entere

Licence
MIT
Last repository change
25.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
14
Scripts
12
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 12 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/capture_safe.py, scripts/check_capture.py, scripts/check_default.py, scripts/check_modes.py, scripts/check_output_security.py, scripts/check_scope_gate.py, scripts/check_setup.py, scripts/configure_default.py, scripts/probe-recorded.zsh, scripts/safe_output.py, scripts/verify_probe.py, scripts/verify_quality.py

What it does and when to use it

Connect or troubleshoot local Claude Code with an Anthropic-compatible API gateway: verify real tool artifacts in an isolated environment first, then save a reversible default configuration only with user authorization. Trigger on "connect Claude Code", "switch model gateway", "CLI not responding", "tool calls not executing", or "output truncated" when validating CLI flags and permissions on a new endpoint, auth method, or model. Core discipline: connect first, verify quality second, persist last; a model claiming it wrote a file is not an artifact, read the physical file back; keys are entere

Triggers from the description

connect Claude Codeswitch model gatewayCLI not respondingtool calls not executingoutput truncated
Original author description

Connect or troubleshoot local Claude Code with an Anthropic-compatible API gateway: verify real tool artifacts in an isolated environment first, then save a reversible default configuration only with user authorization. Trigger on "connect Claude Code", "switch model gateway", "CLI not responding", "tool calls not executing", or "output truncated" when validating CLI flags and permissions on a new endpoint, auth method, or model. Core discipline: connect first, verify quality second, persist last; a model claiming it wrote a file is not an artifact, read the physical file back; keys are entere

How it works

  1. Choose the interface
  2. Shortest execution path
  3. Verified local scripts
  4. Failure triage and budgets
Original SKILL.md headings · 52 lines, 1,169 words
SKILL.md preview
---
name: connect-claude-cli
description: 'Connect or troubleshoot local Claude Code with an Anthropic-compatible API gateway: verify real tool artifacts in an isolated environment first, then save a reversible default configuration only with user authorization. Trigger on "connect Claude Code", "switch model gateway", "CLI not responding", "tool calls not executing", or "output truncated" when validating CLI flags and permissions on a new endpoint, auth method, or model. Core discipline: connect first, verify quality second, persist last; a model claiming it wrote a file is not an artifact, read the physical file back; keys are entered hidden, stored plaintext at 0600, byte-backed-up, and restorable in one step. No network authorization, no billing promises, no approval bypass.'
license: MIT
compatibility: 'Needs zsh and Python 3 on macOS or Linux with the Claude Code CLI already installed. The bundled scripts never install or update software. Runs in Claude Code, Claude.ai, Codex, Cursor and any SKILL.md-compatible agent with shell access.'
metadata:
  author: zihao0639-netizen
  version: '1.0.0'
  tags:
    - claude-code
    - api-gateway
    - cli-troubleshooting
    - tool-verification
    - safe-configuration
    - rollback
---

# Claude CLI Gateway Connection and Artifact Verification

Connect first, judge work quality second, persist only under explicit user authorization; an already-working path is used as-is, and only a first-time setup or a change in version, endpoint, auth, or tool configuration triggers re-verification. This skill authorizes no network activity, no spending, no persistence, and no approval bypass, and it does not require changing any existing scheduling framework.

## Choose the interface

Use direct API when you only need to review an approach and need precise control over application-layer outbound input; use the CLI when you need real file changes, tool execution, and tests. Never assume that the official API and a third-party compatible gateway share the same authentication, model identifiers, thinking mode, and output parameters. This skill covers the Claude CLI / Anthropic-compatible route only; it is not a general adapter for other protocols. For a new route, check current official/vendor docs and CLI help first; never install or update software as a substitute for troubleshooting.

Third parties receive only the approved minimal low-sensitivity input; sending a full repository, config, chat log, or credentials by default is forbidden. The CLI adds its own protocol/system context even with tools disabled; direct API controls application-layer input, not server-side logs. A model name and client-side cost figures are not proof of upstream identity or actual billing.

## Shortest execution path

1. Freeze endpoint, auth method, model, task, authorization, acceptance criteria, and the retrievable delivery location. Only locate the executable and read `--version/--help`; never scan private configs or sessions.
2. For a new path, use an empty independent directory, an isolated config, and tools disabled to send one approved minimal text; record the real response. Stable paths do not need a ping/API pre-check every time.
3. Only when file capability is needed, use a tool probe: actual Write, then Read, then inspect the physical file. Only after it passes, run the frozen-test synthetic code task; a model saying "written" is not an artifact.
4. Preserve the separate provenance of raw model output and local repairs; read back the same real artifact, verify against the frozen criteria, and deliver the path plus evidence. An isolated process is not an independent reviewer; newly added tests must not be back-dated as pre-implementation freezes.
5. Align long-term usage needs with the temporary key lifecycle up front. Persist only after user authorization; existing configs are never rewritten automatically for tests.

## Verified local scripts

Read [CLI version and script boundaries](references/cli-version-boundaries.md) before use. The scripts only call an already-installed CLI and never install software. zsh and an existing Python 3 are required; real invocations need a local TTY; the key is entered hidden and never placed in command arguments, logs, or chat.

```sh
# Help: reads no credentials, calls no model
/bin/zsh -f scripts/probe-recorded.zsh --help
# New path; user confirms RUN before any charge; text is minimal text only
/bin/zsh -f scripts/probe-recorded.zsh text
# Write/Read probe, synthetic code task with 10 frozen checks, then optional user SAVE
/bin/zsh -f scripts/probe-recorded.zsh setup
# Switch to a compatible route with explicit arguments; a new route is never assumed verified
/bin/zsh -f scripts/probe-recorded.zsh setup https://your-gateway.example claude-sonnet-4-5 /path/to/claude /path/to/python3
```

The defaults are placeholders, not endorsements of any provider or model. When an existing default connection already works, use it directly; do not ask for the key again or run setup. `chat` provides an interactive CLI in a synthetic independent directory; the scripts do not prove that any task UI can be embedded in a terminal.

If setup fails, stop; do not auto-retry. The CLI itself may issue multiple HTTP requests. Read/Write lists are not an OS filesystem sandbox; real sensitive tasks depend on host permissions and explicit authorization. `acceptEdits` is only for approved synthetic file verification; use manual for human interaction, never a permission bypass.

probe and quality must each observe exactly one init with the tool list exactly Read/Write; extra, missing, duplicate, or non-string tools, and unlisted tool events, are all rejected. Passing 10 synthetic code cases does not replace CLI tool-scope proof; re-check the quality receipt before saving. Any quality failure ends the CHAT offer. file uses the same tool-list gate and exact physical read-back of probe.txt; existing permissions are preserved and never widened based on unverified Write approvals.

Only `SAVE` modifies the ordinary Claude user settings: key plaintext at 0600, original bytes backed up; unrelated fields preserved, conflicting apiKeyHelper removed, AUTH_TOKEN set and API_KEY cleared. User cancellation writes nothing. `configure_default.py --restore RECEIPT` requires typing `RESTORE`, and refuses to overwrite when the current config has drifted. Never force a rollback or modify global shell config. Authentication field changes are made under user authorization; never silently swap the auth protocol.

## Failure triage and budgets

First find whether the input arrived, what the effective tool list or error was, the actual stop reason, and whether the artifact is complete. A missing tool cannot be recovered via allowedTools; an argument swallowing input is not a capability failure. Only when all of these are normal and the task still fails, run a single-variable control on the same prompt; never generalize from one prompt to overall capability.

Choose the output budget, thinking parameter, and timeout based on the task and actual API/CLI support. Output caps, thinking budgets, context windows, and wait limits are different quantities; never judge a long task with a short diagnostic budget, and never write one 32768-token truncation or a larger cap as the default for all models. Do not auto-disable thinking without evidence; on truncation, record the stop reason and adjust under authorization; on timeout, save the evidence obtained and report, never silently retry. `--max-budget-usd` is a client-side constraint, not a guaranteed hard billing cap upstream.

`capture_safe.py` batch-saves complete stdout (recursive redaction after parsing JSON/JSONL, including escapes, nested JSON strings, and sensitive fields; explicit redaction when necessary) plus SHA256 read-back evidence, and separately stores a compact receipt whose text may stop at 4096 characters and must not be treated as complete output. Batch stderr is structurally parsed and redacted for known credentials first, then saved complete at 0600 and read back; the terminal shows at most the first and last 4096 characters, while the public reason remains in the full diagnostic. URLs reject userinfo, query, fragment, and control characters before printing, and never silently change the real endpoint. Interactive mode wraps stderr only; native stdout is the CLI's own interactive display and its credential redaction is not promised; never claim all host logs are permanently secret-free. Shell tracing/tee and any debug mode that could leak authentication are forbidden.

Recording targets refuse symlinks, use exclusive temp files with atomic replacement, and avoid following stdout/stderr/receipt links to overwrite elsewhere; no claim is made of resisting arbitrary malicious concurrent directory replacement. Values of fields named token/secret/key are also redacted, even when different from the current env key; this is a field policy, not evidence of a real key leak. Synthetic code acceptance has AST and CPU limits and no verified hard memory cap; never call it a sandbox for arbitrary untrusted code execution.
Files in this package (14)
  • SKILL.md 9 KB
  • references/cli-version-boundaries.md 3 KB
  • scripts/capture_safe.py 10 KB
  • scripts/check_capture.py 3 KB
  • scripts/check_default.py 3 KB
  • scripts/check_modes.py 7 KB
  • scripts/check_output_security.py 4 KB
  • scripts/check_scope_gate.py 5 KB
  • scripts/check_setup.py 8 KB
  • scripts/configure_default.py 9 KB
  • scripts/probe-recorded.zsh 8 KB
  • scripts/safe_output.py 5 KB
  • scripts/verify_probe.py 3 KB
  • scripts/verify_quality.py 6 KB

Versions

The database has no other skills named connect-claude-cli.

Database snapshot: 13.11.2026 · package version fb9c1b1ef9a3 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95claude-api
    Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.
  • 100claude-api
    Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.
  • 100claude-api
    Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.
  • 100claude-api
    Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.
  • 100claude-api
    Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.
  • 100claude-api
    Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.