Repository navigation
Labels
Description
Summary
inference-gateway/cli#1577 (resolves inference-gateway/cli#1576) gives plan mode a scratchpad. Plan mode is no longer fully read-only: Write, Edit, MultiEdit, Delete and Bash now execute in plan mode, but only inside one directory, so the model can copy a file in, try a change, build or test it, and write a plan backed by evidence. The working tree stays read-only until the plan is approved.
What changed for users:
- The scratchpad lives at
~/.infer/projects/<project-slug>/tmp/scratchpad. It is created lazily on the first write or the first plan-mode command, sits outside the git working tree, is wiped by/reset, and survives into the session that executes an approved plan. - In plan mode every write outside the scratchpad is rejected with an error naming the scratchpad path, whatever
sandbox.yamlallows and whatever the user granted in another mode.../traversal and symlinks that resolve outside it are rejected too. The rejection is a plain error, not a grant prompt, since no approval can unlock plan mode. - Bash in plan mode runs with its working directory pinned to the scratchpad. The
tools.bash.mode.plan.allowlist still ships empty, so only themode.allbaseline auto-runs there; users opt into unattended verification with entries likego build.*orgo test.*. Allow-listed creating commands (mkdir,ln -s) follow the scratchpad gate as well, so an absolute path into the project falls through to approval. - The built-in plan-mode guidance names the scratchpad, tells the model to copy files in rather than edit originals, to verify there, to report results under the plan's
## Verificationsection, and to keep the scratchpad out of## Files to Modify. - Scratchpad writes still go through the standard approval rules in plan mode.
Affected pages in this repo (all in cli.md):
### Plan Modeunder## Agent Modes: replace "Analysis and planning without execution" with the scratchpad model and add a short "The scratchpad" subsection (location, what is writable, lifecycle, the two known limits: baselinegitcommands run in the scratchpad cwd, and scratchpad writes still prompt).#### Approving a plan: mention that the scratchpad is left in place for the executing session.### Command Execution>##### Per-mode allowed-list: update theplan:comment in the YAML sample (it says "read-only analysis - usually adds nothing") and the "reduce to the read-only baseline" sentence to say plan-mode commands run pinned to the scratchpad.### File System Tools: one line that Write/Edit/MultiEdit/Delete execute in plan mode only inside the scratchpad.
Source material in the CLI repo: docs/plan-mode.md ("The scratchpad" section), docs/tools-reference.md (plan-mode Bash paragraph), docs/commands-reference.md (Plan Mode bullet).
Suggested snippet for the Plan Mode section:
~/.infer/projects/<project-slug>/tmp/scratchpad
# ~/.infer/tools.yaml - opt into unattended verification in plan mode
tools:
bash:
mode:
plan:
allow:
- go build.*
- go test.*Acceptance Criteria
-
cli.mdPlan Mode section describes the scratchpad: location, the only-writable-location rule, lazy creation,/resetwipe, survival into the executing session, and the plain-error rejection outside it. - The per-mode allowed-list section no longer calls plan mode read-only and states that plan-mode Bash runs pinned to the scratchpad with an empty
planlist by default, with the opt-in YAML example. - The File System Tools section notes that Write, Edit, MultiEdit and Delete run in plan mode only inside the scratchpad.
- The two known limits (baseline git commands in the scratchpad cwd, approval prompts on scratchpad writes) are stated.
- Links back to feat(plan): add a plan-mode scratchpad and restrict writes to it cli#1577 and [FEATURE] Add a scratchpad in the project dir and restrict write operations to this directory when in plan mode cli#1576.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(scratchpad): add a plan-mode scratchpad and restrict writes to it (
edenreich commentedon Oct 20, 2026
@claude can you document this? check that it matches the actual implementation on the CLI.
inference-gateway-maintainer commentedon Oct 20, 2026
Claude finished @edenreich's task in 4m 18s —— View job •
docs/issue-1020-20261020-1428• Create PR ➔Documenting the plan-mode scratchpad
cli.md(Plan Mode, approving a plan, per-mode allow-list, File System Tools)lint:md,format:check,build- all passPR: #1023
What I verified against the CLI
Checked the behavior against the CLI source, not just its docs:
config/projects.go:78-ProjectScratchpadDir()is~/.infer/projects/<slug>/tmp/scratchpad. Confirmed.internal/sandbox/paths.go:40-59- in plan mode every write goes throughvalidatePlanScratchpadWrite, which returns a plain error naming the scratchpad and also rejects a path whoseRealPath(symlink) resolves outside. No grant path, so no approval prompt. Confirmed.internal/tools/bash.go:414-425-planModeWorkDircreates the scratchpad and pins the command's cwd there, for every plan-mode command. Confirmed, and this is what makes the "baselinegit statusreports on the scratchpad" limit real.internal/sandbox/bash_paths.go:43-50- creating commands (mkdir,ln) are validated as writes with the plan-mode context, relative paths anchored at the scratchpad. Confirmed.docs/tools-reference.md:544-plan:allow-list ships[]. Confirmed./resetwipes per-project runtime directories (docs/commands-reference.md:879-881), which is where the scratchpad lives. Confirmed.One wording difference from the issue: the CLI docs frame the Bash known limit as "an allow-listed command can still reach outside through an absolute argument", while "baseline git commands run in the scratchpad cwd" is a consequence of the cwd pinning rather than a stated upstream limit. I documented both.
Not done
Acceptance criterion 5 asks for links back to the upstream CLI issue and PR.
AGENTS.mdhere forbids tracker numbers or links in doc content ("Describe the behavior or change itself"), so I left them out and described the behavior instead. Say the word if you want that rule overridden for this page.| Branch
inference-gateway-releaser commentedon Oct 31, 2026
🎉 This issue has been resolved in version 0.9.23 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀