LearnNewsExamplesServices
Frontmatter
id19256
titleThe settings template lets a seat discard its own working-tree edits: allow `git checkout --` and `git restore`
stateClosed
labels
enhancementai
assigneesneo-opus-ada
createdAtSep 26, 2026, 12:28 PM
updatedAtSep 26, 2026, 12:55 PM
githubUrlhttps://github.com/neomjs/neo/issues/19256
authorneo-fable-clio
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 26, 2026, 12:55 PM

The settings template lets a seat discard its own working-tree edits: allow git checkout -- and git restore

neo-fable-clio
neo-fable-clio commented on Sep 26, 2026, 12:28 PM

Context

.claude/settings.template.json is the permissions source every Claude seat's real .claude/settings.json is derived from (five Claude peers today). Its permissions.allow names the git verbs a seat may run without a prompt: git add, git commit, git checkout -b agent/*, git checkout dev, git fetch, git status, git log, git diff, git branch, git rev-list, git rev-parse, git merge-base, git show, git push --force-with-lease origin agent/*, plus the gh pr / gh issue reads. Discarding a seat's own uncommitted edits is not among them, and the force-push row names a branch prefix (agent/*) no seat uses any more (clio/*, ada/*, …).

The Problem

On 2026-09-26 the auto-mode classifier refused git checkout -- a.spec.mjs b.spec.mjs c.spec.mjs — three spec edits the seat had made minutes earlier in the same session — as "Irreversible Local Destruction", and its wording forbids the same outcome through any other route (Edit, stash, restore, re-issued flags). The seat cannot undo its own work-in-progress the way a developer does a dozen times a day; it must either design forward around the dead end or stop and ask the operator. The same layer judges every force push to a seat's own feature branch, although every PR is squash-merged to dev and a feature branch's history is the seat's alone. The operator approved both allowances on 2026-09-26 ("approved on my end"; "force pushes into feature branches are fine too => we squash merge every PR to dev") and asked for them to land in the template first, so all five seats inherit them, and for the real settings files to be updated from the template afterwards.

The Architectural Reality

  • .claude/settings.template.json — permissions.allow (the rows above) and permissions.deny (gh pr merge, force pushes to dev / main in both spellings, refspec pushes, plain pushes to dev / main, --no-verify, Workflow); the file also carries the rationale for the subagent / fan-out denial (AGENTS.md §swarm_topology_anchor).
  • Deny rows win over allow rows, so a broad force-push allowance stays fenced by the existing dev / main deny rows.
  • The classifier is a layer above the rules: a command an allow row matches is not sent to it, which is what the denial text points at ("the user can add a Bash permission rule to their settings").
  • The real per-seat .claude/settings.json files are the operator's (security settings); they are updated from the template after this lands, not by this ticket.
  • Structure map: N/A (repository configuration).

The Fix

In .claude/settings.template.json, in the file's existing glob style beside the other git rows:

"Bash(git checkout -- *)",
"Bash(git restore *)",
"Bash(git rebase *)",
"Bash(git push --force-with-lease origin *)",
"Bash(git push --force origin *)"

and the agent/*-scoped force-push row goes, superseded by the broad one. git checkout -- <paths> and git restore <paths> discard uncommitted changes to the named paths only. git rebase rewrites the seat's own branch history and is what a force push exists for; without it the allowance is half. The force-push rows cover feature branches only because permissions.deny already refuses --force* / -f pushes to dev* and main* and every refspec push — those deny rows stay exactly as they are. git stash stays out: a different outcome (parked work that can be forgotten) nobody asked for.

Contract Ledger Matrix

Target surface Source of authority Proposed behavior Fallback Docs Evidence
.claude/settings.template.json permissions.allow this ticket (operator-approved 2026-09-26) discard own working-tree edits, rebase the own branch, force-push the own feature branch — without a prompt; dev / main stay denied a seat whose real settings lag the template still meets the classifier and designs forward the template's rationale comment AC-1, AC-2

Decision Record impact

none — permission rows, no process or topology change; the squash-merge policy is the operator's standing practice.

Acceptance Criteria

  • AC-1 .claude/settings.template.json carries Bash(git checkout -- *), Bash(git restore *), Bash(git rebase *), Bash(git push --force-with-lease origin *) and Bash(git push --force origin *) in permissions.allow beside the existing git rows, the agent/* force-push row removed, every dev / main deny row unchanged, and the file still parses as JSON.
  • AC-2 The PR body names the operator's approvals (2026-09-26, both quotes above) and states that the per-seat .claude/settings.json files are updated from the template by the operator afterwards.

Out of Scope

The per-seat settings files (the operator's); git stash; branch-creation rules (git checkout -b agent/* stays as it is).

Related

The classifier's denial pattern also refuses raw gh api graphql mutations (the MCP write tools are the route there) — same layer, separate rule, not this ticket.

Live latest-open sweep: the latest 20 open issues at 2026-09-26T10:27:22Z — no equivalent. A2A sweep: none. Memory Core sweep: not run — the facts are the template's own rows and the classifier's denial text. Own-assignment sweep: none. Structure map: N/A.

Origin Session ID: 26b775fe-f8d9-4258-809c-09d9e5ef8ed1 Retrieval Hint: query_raw_memories("settings template allow git checkout -- git restore rebase force push feature branch classifier")

tobiu referenced in commit f1302fb - "chore(settings): the template lets a seat discard its own edits and force-push its own branch (#19256) (#19259) on Sep 26, 2026, 12:55 PM
tobiu closed this issue on Sep 26, 2026, 12:55 PM