Setting Fletcher up
Install the GitHub App, then tune what Fletcher looks at with a
.fletcher.json file in your repository.
Get started
- Sign in with GitHub.
- Install the Fletcher GitHub App on your account or organization, then pick the repositories it can see.
- Back in onboarding, choose which repositories get reviews. Every repository you gave the App starts with reviews on; an admin can turn them off.
- Open a pull request. Each workspace gets 5 free reviews on Fletcher's key. After that, an admin adds a Gemini key in the workspace settings or subscribes to the paid plan (see pricing).
No .fletcher.json is needed. Without one, Fletcher uses the
defaults below.
When Fletcher reviews
- When a pull request is opened or reopened, or when new commits are pushed to it. On a new push, Fletcher remembers what he said last time.
- Only when the pull request's author is an owner, member, or collaborator on the repository. Pull requests from anyone else, such as outside contributors' forks, aren't reviewed on their own.
-
On demand: an owner, member, or collaborator comments
/fletcher againon the pull request. Fletcher reviews the latest commit if it hasn't been reviewed yet (for example, an outside contributor's pull request), or retries a review that failed. Admins and owners can also press Retry review on a failed review's page in the dashboard, which does the same.
Fletcher reviews each commit once. /fletcher again on a
commit that already has a review doesn't start another one; push a new
commit to get a new review.
How Fletcher answers /fletcher again
Fletcher answers every /fletcher again from an owner,
member, or collaborator, so you can tell it was heard:
| What's happening | Fletcher's answer |
|---|---|
| A review starts now, or the commit's review is already queued or running | 👀 reaction on your comment |
| The latest commit already has a finished review | 👍 reaction; nothing new to review |
| The account hit its limit of 50 reviews in 24 hours | A reply asking you to try again later |
| Reviews are off for this repository | No answer |
Comments from anyone else are ignored without an answer.
Reviews are posted as comments. Fletcher never approves or blocks a pull request, so branch protection rules don't change.
.fletcher.json
Put .fletcher.json at the root of the repository. Fletcher
reads it from the default branch, never from the pull
request, so a pull request can't turn its own review off or hide files.
Changes to the file take effect once they're merged.
Every field is optional. A typical file:
{
"severityThreshold": "warning",
"intensity": "carnegie",
"ignore": [
"*.md",
"**/*.md",
"**/__generated__/**",
"fixtures/**"
]
}
| Field | Values | Default | What it does |
|---|---|---|---|
enabled |
true, false | true |
false skips reviews for this repository. The
dashboard shows them as skipped. |
severityThreshold |
critical, warning, suggestion | "suggestion" |
The lowest severity that gets posted.
"warning" posts critical and warning findings;
"critical" posts only critical ones. The verdict
isn't affected. |
intensity |
sectional, studio_band, carnegie | "studio_band" |
How hard Fletcher looks. sectional is terse and
businesslike. carnegie holds the change to the
highest standard: naming, edge cases, and tests. |
tone |
standard, ruthless | "standard" |
How Fletcher words things. It never changes which findings are raised. A tone set on the repository's dashboard page wins over this field. |
ignore |
array of globs | [] |
Files left out of the review. See Ignoring files. |
guidelines |
array of paths or globs, null | null |
The files that hold your review rules, read from the default
branch. null uses the usual places. See
What Fletcher reads. |
The defaults, written out in full:
{
"enabled": true,
"severityThreshold": "suggestion",
"intensity": "studio_band",
"tone": "standard",
"ignore": [],
"guidelines": null
}
To turn reviews off for a repository:
{ "enabled": false }
Ignoring files
Each glob is matched against the file's full path from the repository
root, with no leading / or ./:
/docs/** matches nothing.
-
*and?stay inside one folder:*.mdmatchesREADME.mdbut notdocs/guide.md. -
**crosses folders:docs/**matches everything underdocs/. -
**/*.mdneeds at least one folder, so it doesn't matchREADME.mdat the root. To match a file type everywhere, list both*.mdand**/*.md. -
Braces (
{a,b}), character classes ([ab]), and negation (!) aren't supported and match literally.
These are always ignored, with or without a config file:
-
Lockfiles:
pnpm-lock.yaml,package-lock.json,yarn.lock,bun.lock,bun.lockb - Minified files:
*.min.js,*.min.css -
Images, PDFs, and web fonts (
png,jpg,jpeg,gif,webp,ico,pdf,woff,woff2) - Test snapshots (
*.snap) -
.sqlfiles andmeta/inside anydrizzle/folder, andworker-configuration.d.ts
Nothing else is ignored by default, including other ecosystems'
lockfiles (Cargo.lock, go.sum,
poetry.lock) and SVGs. Add those to ignore
if you don't want them reviewed.
What Fletcher reads
Besides the diff, each review gets:
-
Your rules.
AGENTS.md,CLAUDE.md,CONTRIBUTING.md,.github/CONTRIBUTING.md,docs/CONTRIBUTING.md, and.github/copilot-instructions.md, plus anyAGENTS.mdorCLAUDE.mdin a folder the pull request changes. They're read from the default branch, so a pull request can't rewrite the rules it's reviewed against. Up to 8 files and 40 KB in total. Setguidelinesto pick the files yourself, for example["docs/style/**"]. -
Your dependencies. The root manifest
(
package.json,go.mod,pyproject.toml,Cargo.toml, and the like) and the nearest one to each changed file, so library versions newer than the model's training aren't flagged as mistakes. - The changed files in full, as they are in the pull request, so code just outside the diff counts. Up to 25 files and 150 KB, most-changed first; files over 60 KB are reviewed from the diff only.
Findings that cite a rule quote it and name its file. Fletcher still comments only on lines the pull request adds, and these files don't count toward the 300 KB diff limit or your credits.
Reviews on your Claude subscription
A repository can review on your own Claude Pro, Max or Ultra plan instead of a review key or plan credits. Its GitHub Actions run Claude Code, Anthropic's official CLI, with your token, and send Fletcher the review to post. Fletcher never sees the token, and these reviews use no credits.
- On the repository's page in the dashboard, set Where reviews run to your Claude subscription.
-
On your machine, run
claude setup-tokenand approve it on claude.ai. It prints a token that lasts a year. -
Save it as a secret on the repository:
gh secret set CLAUDE_CODE_OAUTH_TOKEN --repo owner/name. Paste it into your terminal, not into Fletcher. - Commit this workflow to the default branch, under exactly this name:
# .github/workflows/fletcher-review.yml
# Fletcher reviews each pull request with Claude Code on your Claude
# subscription. Needs the CLAUDE_CODE_OAUTH_TOKEN secret (claude setup-token).
name: Fletcher review
on:
pull_request: # never pull_request_target
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: fletcher-review-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
review:
# Forks get no secrets or OIDC token on pull_request, so they can't run.
if: >-
${{ !github.event.pull_request.draft &&
github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
timeout-minutes: 25
permissions:
contents: read
id-token: write # Fletcher checks GitHub's OIDC token, not a secret
env:
FLETCHER_URL: https://notmytempo.dev
FLETCHER_AUDIENCE: fletcher
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1
persist-credentials: false
- name: Get the review from Fletcher
id: claim
env:
PR: ${{ github.event.pull_request.number }}
SHA: ${{ github.event.pull_request.head.sha }}
run: |
dir="$RUNNER_TEMP/fletcher" && mkdir -p "$dir"
oidc=$(curl -sSf -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$FLETCHER_AUDIENCE" | jq -r .value)
body=$(jq -n --argjson pr "$PR" --arg sha "$SHA" '{pullRequestNumber: $pr, headSha: $sha}')
# Fletcher may still be starting this review: wait up to a minute.
for attempt in 1 2 3 4 5 6 7; do
# Fletcher being unreachable is a notice, not a failed check.
status=$(curl -sS -o "$dir/job.json" -w '%{http_code}' -X POST \
"$FLETCHER_URL/runner/v1/claim" -H "Authorization: Bearer $oidc" \
-H 'content-type: application/json' -d "$body") || status=unreachable
[ "$status" = 200 ] && break
code=$(jq -r '.error.code // empty' "$dir/job.json" 2>/dev/null || true)
[ "$status" = 409 ] && [ "$code" = not_ready ] || break
sleep 10
done
if [ "$status" != 200 ]; then
echo "::notice::Fletcher has no review for this commit ($status $code)."
exit 0
fi
jq -r .systemPrompt "$dir/job.json" > "$dir/system.md"
jq -r .prompt "$dir/job.json" > "$dir/prompt.md"
jq -c .schema "$dir/job.json" > "$dir/schema.json"
{
echo "job_id=$(jq -r .jobId "$dir/job.json")"
echo "model=$(jq -r .model "$dir/job.json")"
echo "max_turns=$(jq -r .maxTurns "$dir/job.json")"
} >> "$GITHUB_OUTPUT"
- name: Review with Claude Code
id: claude
if: steps.claim.outputs.job_id != ''
env:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1"
MODEL: ${{ steps.claim.outputs.model }}
MAX_TURNS: ${{ steps.claim.outputs.max_turns }}
run: |
dir="$RUNNER_TEMP/fletcher"
npm install --global --loglevel=error @anthropic-ai/claude-code@2.1.318
status=0
claude -p \
--append-system-prompt-file "$dir/system.md" \
--output-format json \
--json-schema "$(cat "$dir/schema.json")" \
--tools "Read,Grep,Glob" \
--allowedTools "Read,Grep,Glob" \
--permission-mode dontAsk \
--max-turns "$MAX_TURNS" \
--model "$MODEL" \
--setting-sources user \
--strict-mcp-config \
--no-session-persistence \
< "$dir/prompt.md" > "$dir/result.json" || status=$?
# Say why there is no review: Claude Code reports it on stdout.
if [ "$status" -ne 0 ] || ! jq -e '.is_error == false and .structured_output != null' "$dir/result.json" > /dev/null; then
reason=$(jq -r '[.subtype, .result] | map(select(. != null)) | join(": ")' \
"$dir/result.json" 2>/dev/null | tr '\n' ' ' | head -c 400 || true)
echo "::error::Claude Code produced no review (exit $status). ${reason:-It printed no result.}"
exit 1
fi
- name: Send the review to Fletcher
if: always() && steps.claim.outputs.job_id != ''
env:
JOB: ${{ steps.claim.outputs.job_id }}
MODEL: ${{ steps.claim.outputs.model }}
OUTCOME: ${{ steps.claude.outcome }}
run: |
dir="$RUNNER_TEMP/fletcher"
oidc=$(curl -sSf -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=$FLETCHER_AUDIENCE" | jq -r .value)
if [ "$OUTCOME" = success ]; then
report=$(jq -c --arg model "$MODEL" '{
outcome: "success",
structuredOutput: .structured_output,
model: ((.modelUsage // {} | keys | map(select(startswith($model))) | first) // (.modelUsage // {} | keys | first) // $model),
inputTokens: ((.usage.input_tokens // 0) + (.usage.cache_read_input_tokens // 0) + (.usage.cache_creation_input_tokens // 0)),
outputTokens: (.usage.output_tokens // null)
}' "$dir/result.json")
elif [ "$OUTCOME" = cancelled ]; then
report='{"outcome":"cancelled"}'
else
message=$(jq -r '.result // empty' "$dir/result.json" 2>/dev/null | head -c 400 || true)
report=$(jq -n --arg m "${message:-Claude Code failed. See the Actions log.}" \
'{outcome: "failure", message: $m}')
fi
curl -sS --fail-with-body --retry 3 --retry-delay 5 -X POST \
"$FLETCHER_URL/runner/v1/jobs/$JOB/result" -H "Authorization: Bearer $oidc" \
-H 'content-type: application/json' -d "$report"
-
Pull requests from forks aren't reviewed. GitHub
keeps secrets from their runs, and only
fletcher-review.ymlrunning onpull_requestcan fetch a review. -
The token is one person's plan. Anthropic sizes
subscription limits for ordinary individual use. For a team, set
ANTHROPIC_API_KEYin the review step instead ofCLAUDE_CODE_OAUTH_TOKEN. - Each review takes about a minute of Actions time. If the workflow doesn't report back within 30 minutes, the review fails and the dashboard says why.
Things that catch people out
-
One bad value resets everything. If the file isn't
valid JSON, or any field has a value not listed above, Fletcher
ignores the whole file and uses the defaults, including
"enabled": trueand no ignores. Nothing is posted about it, so check the file carefully. - Plain JSON only. No comments and no trailing commas.
-
Misspelled fields are skipped without a warning.
"severity"or"ignored"does nothing. - Very large pull requests aren't reviewed. The limit is 300 KB of diff, and it counts every file, including ignored ones and lockfiles. Split big changes, or move large generated changes into their own pull request.
-
Edits in a pull request don't apply to that pull request.
Merge the change to
.fletcher.jsonfirst. Commits Fletcher has already reviewed or skipped stay that way; the new settings apply from the next push.