tc-claude-init
v1.1.0
Published
CLI wizard to generate CLAUDE.md files for your projects
Maintainers
Readme
claude-init
A CLI wizard that generates CLAUDE.md files for your projects — the instruction file that tells Claude Code how to behave in a given codebase.
Usage
No install required:
npx claude-initOr install globally:
npm install -g claude-init
claude-initWhat it does
Walks you through a series of questions about your project, then writes a well-structured CLAUDE.md to your current directory. The file tells Claude Code things like:
- What language and framework you're using
- Your linting, formatting, and naming conventions
- Whether Claude should auto-commit, run tests, add comments, etc.
- Your folder structure and API patterns
Wizard sections
You choose which sections to include at the start. Each section asks a focused set of questions.
| Section | What it covers | |---|---| | Tech Stack | Language, framework, package manager, monorepo tooling | | Code Style | Linter, formatter, TypeScript strictness, file naming, line length | | Claude Rules | Commit behavior, file deletion, test policy, comment style, custom rules | | Architecture | Folder convention, test location, env var pattern, API pattern | | Infrastructure | Cloud provider, serverless, IaC tooling (auto-injected after Tech Stack when Monorepo = Yes) |
Infrastructure (auto-injected)
When Monorepo = Yes is selected in Tech Stack, the wizard automatically continues with infrastructure questions — no need to select it from the section list.
| Cloud Provider | Recommended IaC | Alternatives | |---|---|---| | AWS | AWS CDK | Terraform, AWS SAM, CloudFormation | | Azure | Bicep | Terraform, Pulumi, ARM Templates | | Both | Terraform (cross-cloud) | CDK + Bicep, Pulumi |
Tech Stack branching
Framework options adapt to the selected language:
- TypeScript / JavaScript → Next.js, React (Vite), Vue, Express, Fastify, NestJS
- Python → FastAPI, Django, Flask
- Go → Gin, Echo
Conflict handling
If a CLAUDE.md already exists in the current directory, the wizard offers three options:
- Overwrite — replace the file entirely
- Merge — append new content below a
---separator with a timestamp comment - Cancel — leave the existing file untouched
Company-wide rules
Edit src/config/mandatory-rules.js to add rules that appear in every generated CLAUDE.md, regardless of which sections the user selects:
export const mandatoryRules = [
"Never skip pre-commit hooks (--no-verify)",
"Always confirm with the user before running destructive git commands",
];These are rendered as a ## Company Standards section at the top of the output.
Presets
Add named presets to src/presets/index.js to pre-fill answers for common project setups:
export const presets = new Map([
["nextjs-api", {
techStack: { language: "TypeScript", framework: "Next.js", packageManager: "pnpm", monorepo: false },
codeStyle: { linter: "ESLint", formatter: "Prettier", tsStrictness: "strict", fileNaming: "kebab-case", maxLineLength: "100" },
// ...
}],
]);When presets are present, the wizard offers a "Start from preset?" prompt before asking questions.
Project structure
claude-init/
├── bin/
│ └── cli.js # Entry point
├── src/
│ ├── wizard.js # Flow control
│ ├── generator.js # Renders CLAUDE.md from answers
│ ├── file-handler.js # File read/write/merge
│ ├── config/
│ │ └── mandatory-rules.js # Company-wide rules
│ ├── presets/
│ │ └── index.js # Preset registry
│ └── sections/
│ ├── index.js
│ ├── tech-stack.js
│ ├── code-style.js
│ ├── claude-rules.js
│ ├── architecture.js
│ └── infrastructure.js
└── package.jsonRequirements
- Node.js >= 18
License
MIT
