apify-cli CLAUDE.md

Repository instructions for Apify's command-line tool, which lets developers run and manage Apify programs from a terminal. They cover command entry points, coding conventions, required checks, and documentation updates.

In plain words
What is it for?
Use it when adding or modifying CLI commands, registering commands, changing flags or arguments, building the project, or running its local and API tests.
Why use it?
They make the project's build and release expectations explicit, including its required package manager and the checks to run before pushing code. They also prevent command changes from leaving the generated documentation outdated.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/apify/apify-cli/claude-md
Clone the repo
git clone --depth 1 https://github.com/apify/apify-cli
Per session 708 This file is loaded in full into every session.
When invoked 708 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00708 $0.00708
Opus 5 $0.00354 $0.00354
Sonnet 5 $0.00142 $0.00142
Haiku 4.5 $0.00071 $0.00071

Measured 2d ago against content hash f44548488921, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

apify-cli CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 47 lines

How it starts

The opening of the file, as written. The whole thing — 47 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

Guidance for Claude Code working in this repository. Humans should read README.md and CONTRIBUTING.md first.

Entry points

  • apify CLI — src/entrypoints/apify.ts
  • actor CLI — src/entrypoints/actor.ts

Before you push

Run pnpm run lint && pnpm run format && pnpm run build && pnpm run test:local before pushing. Run pnpm run test:api too if you changed anything that touches the Apify API.

If you modified a command's flags, args, description, or added/removed a command, also run pnpm run update-docs and commit the regenerated docs/ output.

Code conventions

  • Package manager: pnpm 10 (via Corepack). Do not use npm or yarn.
  • Use .js import specifiers for local files (e.g. import { foo } from './foo.js'). The .ts source resolves at build time.
  • Commands extend ApifyCommand from src/lib/command-framework/apify-command.ts. Follow the pattern of existing commands: static override name, static override description, static override flags/args, and an async run() method.
  • New commands must be registered in src/commands/_register.ts (or the parent _index.ts for subcommands).
  • Do not add docstrings, comments, or type annotations to code you did not change. Keep diffs tight.

Install size

The CLI is installed globally by many users and in Actors, so keep the npm install footprint lean. Always look for opportunities to shrink it:

  • Prefer Node.js built-ins over dependencies, and prefer dependencies already in the tree over new ones.
  • Before adding a dependency, check what it drags in: npm install <pkg> in an empty temp dir, then du -sh node_modules. Mention the install-size impact in the PR description.
  • When touching code that uses a dependency, check whether the dependency is still pulling its weight — a single small helper from a large package is a candidate for replacement or removal.
  • To measure the CLI's own footprint, run node scripts/report-install-size.mjs — it packs the current tree and compares tarball, unpacked, and full-install sizes against the latest published version. The release workflows run it and embed the report in the GitHub release notes.

Read the full file on GitHub · 47 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 47 lines · 708 tokens per session scan A f44548488921

Subscribe to this mod's changes

apify-cli CLAUDE.md is an instructions file published in the GitHub repository apify/apify-cli (247 stars, last pushed 4d ago), licensed Apache-2.0. It adds 708 tokens to every session, about $0.0035 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.