Create a configuration file for your project. The generated config includes a $schema field so your editor can provide autocomplete and validation.
Most projects don't need a config file. Fallow works out of the box by auto-detecting entry points and frameworks. Only create one if you need custom entry points, rules, or ignore patterns.
Fallow's init command auto-detects your project setup and tailors the generated config accordingly:
tsconfig.json and enables TypeScript-aware defaultsfallow init
| Flag | Description |
|---|---|
--toml | Generate fallow.toml instead of .fallowrc.json |
--agents | Scaffold a starter AGENTS.md guide for coding agents, prefilled from detected project info |
--hooks | Scaffold a pre-commit git hook that runs fallow on changed files. Alias for fallow hooks install --target git |
--branch <REF> | Fallback base branch for the hook when no upstream is set (requires --hooks, default: main) |
--decline | Record that this project deliberately stays unconfigured, so the first-contact setup hint and the setup next-step stop appearing. Writes no config file; idempotent |
fallow init --agents writes a short starter AGENTS.md with project-overview, architecture, command, fallow workflow, and agent-rule prompts, plus a task-to-command matrix that routes common agent intents (deleting "unused" code, committing, prioritizing refactors, consolidating duplication) to the right fallow command. The matrix is the same one exposed as task_matrix in fallow schema. It refuses to overwrite an existing AGENTS.md, and it is guidance for agents, not a readiness score.
When the project shape is reliably detectable, the scaffold prefills:
packageManager field in package.json, or pnpm install when pnpm-workspace.yaml is presenttsc --noEmit when tsconfig.json existsAnything ambiguous stays blank rather than guessed: fallow never sniffs a package manager from lockfiles, leaves the test line empty when several frameworks are installed, and labels the workspace tool only when the packageManager field or pnpm-workspace.yaml proves it. Prefilled command lines carry an HTML provenance comment so you know to confirm them.
fallow init --agents
fallow agent install writes the same guide together with the skill, the MCP registration, and the commit/push gate for every harness it detects.
Use the hooks namespace to scaffold a git hook that runs fallow audit against the base branch before each commit:
fallow hooks install --target git
fallow init --hooks remains available as a project-initialization shortcut.
Fallow detects your hook manager and writes to the right location:
.husky/pre-commitlefthook.yml.git/hooks/pre-commitThe generated hook:
command -v fallow) so commits still work when fallow isn't installedgit merge-base @{upstream} HEAD when an upstream is set, falling back to the configured branch (or main) otherwise. Feature branches forked from a non-default integration branch (next-release / hotfix / LTS) compare against the right base, not against their own remote tracking branchfallow audit --base "$BASE" --quiet, which combines dead-code, complexity, and duplication analysisgate=new-only, so inherited findings on touched files do not block the commit; only findings introduced by the changeset fail the gate. Set [audit] gate = "all" in fallow.toml to fail on every finding in changed filesverdict: "fail" (default audit semantics); no --fail-on-issues is neededgit commit --no-verify as the bypass option in the success messageWant to gate Claude Code or Codex agent commits as well? Use fallow hooks install --target agent for the agent enforcement path. The two hooks are complementary: fallow hooks install --target git catches human commits, fallow hooks install --target agent catches agent commits.
Override the fallback base branch the hook uses when no upstream is set:
fallow hooks install --target git --branch develop
fallow init automatically adds .fallow/ to your project's .gitignore. The .fallow/ directory contains machine-local data (parse cache, regression baselines, snapshots) that should not be committed.
.gitignore exists and already contains .fallow/, nothing changes.gitignore exists without it, the entry is appended.gitignore doesn't exist, it is createdBy default, creates .fallowrc.json:
{
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
"rules": {}
}
With --toml, creates fallow.toml.