# CLAUDE.md Generator from Repo (`ianymu/claudemd-generator`) Actor

Generate a draft CLAUDE.md for any public GitHub repo. Detects stack (JS/Python/Rust/Go), test/build commands, and top-level structure — saves hours of bootstrapping Claude Code in a new codebase.

- **URL**: https://apify.com/ianymu/claudemd-generator.md
- **Developed by:** [Yanlong Mu](https://apify.com/ianymu) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## CLAUDE.md Generator from Repo

> **Generate a high-quality draft `CLAUDE.md` for any public GitHub repo in under 30 seconds. Detects stack, common commands, conventions, and structure — no more staring at an empty file when you onboard Claude Code to a new codebase.**

### What does CLAUDE.md Generator do?

When you start using [Claude Code](https://www.anthropic.com/claude-code) in a new repository, the first thing you should do is write a `CLAUDE.md` — the project's instruction sheet for the agent. A good `CLAUDE.md` covers commands, structure, conventions, and "what NOT to do" rules. A bad one (or a missing one) means Claude wastes tokens rediscovering the project on every session.

This Actor:

1. Fetches a public GitHub repo's metadata, README, and manifest files (`package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`)
2. Detects the tech stack — languages and frameworks (Next.js, React, Django, FastAPI, etc.)
3. Extracts existing test/build/lint commands from `scripts` or known tool configs
4. Lists top-level directories so Claude knows where to search
5. Produces a fully-formatted draft `CLAUDE.md` (saved to the run's key-value store + summary in dataset)
6. Flags if a `CLAUDE.md` already exists in the repo, so you merge instead of overwrite

The result is a ~70% complete `CLAUDE.md` that you only need to lightly edit before committing — a 30-minute task compressed to one click.

### Why use this Actor?

- **Onboard Claude Code to any repo in seconds**, not hours
- **Standardize team conventions**: run this on every project so every `CLAUDE.md` has the same structure
- **Audit your existing repos**: see at a glance which projects lack a `CLAUDE.md`
- **Faster contractor / open-source contribution**: drop into a new codebase and immediately have the AI agent oriented
- **Open-source maintainers**: ship a great `CLAUDE.md` so contributors using Claude Code don't ask repeated "how do I run tests?" questions

### How to use CLAUDE.md Generator

1. Enter a public GitHub repo in the form `owner/repo` (e.g. `vercel/next.js`)
2. Click **Start**
3. Wait ~10–30 seconds (depending on repo size)
4. Open the **Storage** tab → **Key-value store** → download `CLAUDE.md`
5. Drop it into the root of your local copy of the repo, edit lightly, and commit

### Input

- **`githubRepo`** *(required)* — A public GitHub repository in the form `owner/repo`. Examples: `vercel/next.js`, `fastapi/fastapi`, `tokio-rs/tokio`.

### Output

The Actor saves two outputs per run:

#### 1. Key-value store: `CLAUDE.md`

The generated draft (Markdown, ~1–3 KB). Sections include:

- Project overview (derived from repo description + README)
- Tech stack (auto-detected)
- Common commands (`npm test`, `cargo build`, `pytest`, etc.)
- Repository structure (top-level dirs)
- Conventions and gotchas (placeholders to fill in)
- What NOT to do (sensible defaults: no `npm install` without confirming, no commit to `main`, no claims of "tests pass" without running them)
- Recommended hooks (e.g. [`verify-before-stop`](https://github.com/ianymu/claude-verify-before-stop) for blocking false-completion regressions)

#### 2. Dataset summary

```json
{
  "repo": "vercel/next.js",
  "stars": 128000,
  "primary_language": "JavaScript",
  "detected_stack": {
    "languages": ["JavaScript/TypeScript"],
    "frameworks": ["Next.js", "React"],
    "testCommands": ["npm test  ## or: jest"],
    "buildCommands": ["npm run build  ## next build"]
  },
  "existing_claudemd": false,
  "draft_size_bytes": 2148
}
````

### Pricing

Pay-per-event model:

- **Per-repo generation**: $0.05 per draft (~6 GitHub API calls per run — well under the anonymous rate limit)
- **Bulk plan**: $5 for 200 drafts (run on every repo in your org in one batch)
- **Custom**: contact for white-label / on-prem versions

### Tips

- The Actor uses **anonymous GitHub API** (60 req/hour ceiling). For high-throughput org-wide audits, run in small batches or upgrade Apify proxy.
- Generated drafts are **a starting point, not a final spec**. Review before committing — especially the "conventions and gotchas" section, which is mostly placeholders.
- For repos with an **existing `CLAUDE.md`**, the Actor flags it in the output. Merge selectively rather than overwriting.
- For repos missing manifest files, the stack detection falls back to the repo's `primary_language` field — less precise but still useful.

### FAQ

#### Does this work on private repos?

Not in the public version. The Actor uses anonymous GitHub API. For private-repo support, contact for a custom version that accepts a GitHub token via Apify secrets.

#### What if the repo uses a stack I haven't listed?

The Actor detects JS/TS, Python, Rust, and Go. If your repo uses another language (PHP, Ruby, Elixir, etc.), the stack section will be blank and you'll need to fill it in. PRs to the source repo welcome.

#### Is the generated `CLAUDE.md` good enough to commit as-is?

No — it's a draft. Plan for 5–10 minutes of editing per repo: fill in the conventions, gotchas, and "what NOT to do" sections specific to your codebase. The Actor does the boring 70%; you do the high-value 30%.

#### How does this compare to writing `CLAUDE.md` from scratch?

Same final quality if you spend the same time editing. The difference is the floor — without this Actor, most repos end up with no `CLAUDE.md` at all because the activation energy is too high. With this Actor, every repo gets at least a baseline.

### Support

Issues / feature requests: open in the **Issues** tab on the Apify console.

Built by Ian Mu — [github.com/ianymu](https://github.com/ianymu) — author of [`verify-before-stop`](https://github.com/ianymu/claude-verify-before-stop), the Stop hook that blocks Claude Code session-end if files changed but no verification log exists.

# Actor input Schema

## `githubRepo` (type: `string`):

Public GitHub repository in the form 'owner/repo' (e.g. 'vercel/next.js'). The Actor will fetch package.json / pyproject.toml / Cargo.toml / go.mod, top-level directory listing, and README to generate a draft CLAUDE.md.

## Actor input object example

```json
{
  "githubRepo": "vercel/next.js"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "githubRepo": "vercel/next.js"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ianymu/claudemd-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "githubRepo": "vercel/next.js" }

# Run the Actor and wait for it to finish
run = client.actor("ianymu/claudemd-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "githubRepo": "vercel/next.js"
}' |
apify call ianymu/claudemd-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ianymu/claudemd-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CLAUDE.md Generator from Repo",
        "description": "Generate a draft CLAUDE.md for any public GitHub repo. Detects stack (JS/Python/Rust/Go), test/build commands, and top-level structure — saves hours of bootstrapping Claude Code in a new codebase.",
        "version": "0.1",
        "x-build-id": "qwX3k8cKH1Bjxurmz"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ianymu~claudemd-generator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ianymu-claudemd-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/ianymu~claudemd-generator/runs": {
            "post": {
                "operationId": "runs-sync-ianymu-claudemd-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/ianymu~claudemd-generator/run-sync": {
            "post": {
                "operationId": "run-sync-ianymu-claudemd-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "githubRepo"
                ],
                "properties": {
                    "githubRepo": {
                        "title": "GitHub repository (owner/repo)",
                        "pattern": "^[^/\\s]+/[^/\\s]+$",
                        "type": "string",
                        "description": "Public GitHub repository in the form 'owner/repo' (e.g. 'vercel/next.js'). The Actor will fetch package.json / pyproject.toml / Cargo.toml / go.mod, top-level directory listing, and README to generate a draft CLAUDE.md."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
