agentleFS
gordon1210gordon1210/agent-goodies/skills/claude-cli/SKILL.md

claude-cli

Skill0 starsChanged 4 months agoMITView on GitHub

Use the installed Claude Code CLI through claude -p for a bounded second opinion, source review, consulting, or an exact-session follow-up. Includes a standard-library Python wrapper for stdin prompts, structured results, timeouts, and --resume UUID. Use when the user requests Claude or authorizes Claude as a collaborator. Not for the Claude web app, direct API calls, an Agent SDK, an app server, or multi-agent council orchestration.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the real installed claude executable, only through non-interactive -p.

    line 14
  2. Distinctive:

    Keep the delegated task bounded.

    line 15
  3. Very specific:

    Prefer a UTF-8 prompt file or --stdin, especially for diffs or long/private material.

    line 55
  4. Very specific:

    Default --tools none is a tool-free consultation, not an OS sandbox.

    line 83
  5. Very specific:

    Read the returned session_id, then send just the follow-up needed for normal one-to-one consultation, with --resume and the same --cwd.

    line 91
  6. Distinctive:

    Verify claims and any quoted source locations in the host environment.

    line 104

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Claude CLI

Use the real installed claude executable, only through non-interactive -p. Keep the delegated task bounded. The host remains responsible for verification. For a discussion with Grok, Claude, and the host, use agent-council instead of building another orchestration script.

Before calling

Confirm that sending the selected material to Claude is authorized. An opinion request does not authorize repository edits, shell execution, web access, MCP, or nested delegation. Do not send credentials or unrelated conversation.

Resolve this skill's actual installed directory. Invoke its bundled scripts/ask_claude.py by absolute path; do not assume a particular host's skill installation layout. Run its doctor with the intended project --cwd once per environment, and again after CLI or configuration changes:

python3 /path/to/claude-cli/scripts/ask_claude.py doctor --cwd /absolute/project

Inspect the reported version and help against the CLI contract. Missing advertised flags are reported, not silently removed. Check that applicable managed policies and remaining executable startup behavior are acceptable. The helper never logs in, updates the CLI, edits persistent configuration, changes HOME, or extracts OAuth credentials. Existing CLI authentication and billing configuration remain in force; it does not convert a subscription to an API connection.

Do not use --bare as an isolation shortcut: the reviewed documentation says it skips subscription credentials. The wrapper uses --safe-mode with explicit tool/MCP restrictions instead. Managed policy still applies. If the installed CLI rejects a control flag, stop; do not retry with fewer controls.

Prepare the task packet

Include the objective, relevant facts or source excerpts, applicable repository instructions, constraints, questions, and expected evidence. The wrapper's safe-mode deliberately omits normal project customizations, so pass the relevant rules explicitly. For an independent opinion, do not prime Claude with the host's preferred answer unless comparison is the actual assignment.

Prefer a UTF-8 prompt file or --stdin, especially for diffs or long/private material. The wrapper feeds Claude through stdin, keeping the prompt out of Claude's argument list. --prompt is available for short non-sensitive input, but that input is visible in the wrapper's argv and possibly shell history.

Invoke the bundled wrapper

python3 /path/to/claude-cli/scripts/ask_claude.py ask \
  --cwd /absolute/project \
  --prompt-file /approved/work/claude-question.md \
  --out-dir /approved/work/claude-call-01

The output directory must be new. Without --out-dir, the helper creates and retains a uniquely named temporary directory and prints its location. Stdout contains normalized JSON with text, session_id, usage when reported, and artifact_dir. Stderr contains operational diagnostics. --text prints only the answer; result.json still retains metadata.

NeedWrapper option
Follow up on this exact conversation--resume <returned UUID>
Read source with no shell or edits--tools read enables only Read,Glob,Grep
Override the configured model/effort--model <verified name>, --effort <supported level>
Bound CLI agent loops / wall-clock time--max-turns 4, --timeout 240
Inspect argv without a model call--dry-run

Default --tools none is a tool-free consultation, not an OS sandbox. Even the read profile is not a filesystem allowlist: do not promise that only one named file can be read. No edit, shell, browser, web, MCP, or Agent tool is enabled by this wrapper. For a task requiring those capabilities, stop at the authority boundary; do not improvise broader arguments during consultation.

Continue and verify

Read the returned session_id, then send just the follow-up needed for normal one-to-one consultation, with --resume and the same --cwd. Use a new artifact directory per call. Never use --continue, titles, guessed IDs, or another agent's session. --session-id creates a session; it is not a resume substitute. Serialize calls that target the same native session.

Accept an answer only when the process exits zero and a valid, nonempty, successful terminal result is present. The helper rejects error results, turn caps, permission denials, malformed JSON, and unexpected resume IDs. Retain artifacts on failures; there is no automatic retry or permission escalation. A timed-out invocation may have changed its native session. Inspect it before resuming; fresh, independently authorized consultation is often safer.

Verify claims and any quoted source locations in the host environment. Do not claim that Claude browsed, ran tests, or modified files based on its prose. Report its conclusion, material dissent, session ID when useful, and what the host actually verified. Usage fields are not subscription billing amounts.

See CLI contract and boundaries, recipes, and validation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.