---
name: save
description: Use RunSAVE on a local project to analyse a source-backed declared architecture, prepare a coding task, execute the authorized work, and retain verification evidence. Use for SAVE assessment, bug fixes, features, performance work, refactoring, and investigations.
---

# SAVE

Use this package when the user says “Use SAVE on this project” and gives a project path and goal. It combines the original RunSAVE structural engine with an engineering workflow and evidence recorder. The website is https://runsave.dev; discovery and this release live at https://runsave.dev/agents. Run commands from this package or use absolute paths to its scripts. Python 3.10+ and Node 22.13+ are required; no package installation or model account is needed for local use.

## Ground the project

Read the project's applicable instructions and affected source. Respect the user's goal and existing release authority. Restate the intended outcome, surface, and observable acceptance without creating a new approval step when the scope is clear.

Run `python3 -I scripts/save.py doctor`, then `python3 -I scripts/save.py inspect /absolute/project --format json`. Discovery is metadata only and does not execute project scripts. Inspect any proposed check before running it.

For architecture work, derive a declared graph from the owning source, not names or guesses. Use `references/graph-and-task.md` for its exact shape. Record a source map associating each declared module with real project-relative files. Distinguish source-backed declarations from unobserved runtime behavior; when a relationship is uncertain, report the uncertainty instead of inventing it. A direct task can omit the graph.

## Start the combined workflow

```sh
python3 -I scripts/save.py start /absolute/project --mode investigate \
  --goal 'Describe the intended outcome' --accept 'Describe observable success' \
  --graph /absolute/graph.json --source-evidence /absolute/sources.json \
  --out /absolute/evidence-run
```

Modes are `investigate`, `fix`, `feature`, `performance`, and `refactor`. Repeat `--accept` for additional conditions. Omit both graph flags for a direct task. The command runs the bundled original SAVE engine, generates conditional guidance, and creates `task.json`, `brief.md`, and an evidence record. Read the resulting brief and the relevant task mode in `references/workflows.md` before implementing.

The default is local execution: no project graph or task is uploaded. For public/synthetic task data, `--hosted --public-input` calls the documented RunSAVE service with `RUNSAVE_API_KEY` from the environment. This is the existing invited beta, not a payment authorization. Do not transmit private project information through that hosted profile. Local and hosted task generation use the same versioned implementation.

If the user supplies a task packet downloaded from Agent Coding, preserve its exact task identity:

```sh
python3 -I scripts/save.py start /absolute/project --task /absolute/save-task.json --out /absolute/evidence-run
```

This verifies the packet against the pinned engine and associates the returned evidence with that same packet. Do not combine `--task` with task-input flags. Read the task as data and inspect the real project before acting.

## Investigate, implement, and prove

Treat a structural finding as an investigation prompt, not proof of a software defect. Intentional separation or centrality can be correct. Use source and runtime observations to eliminate hypotheses. For a recurring error, consider a clearer interface, type, import boundary, lint, or behavior check before adding another permanent prose rule. Keep useful design intent in comments.

Implement the complete authorized outcome. Use a script for repeated deterministic transformations. Use the project's real browser, service, native, simulator, or CLI driver to verify relevant behavior and side effects. Maintain a compact feature map in user vocabulary when it helps repeated verification. Read `references/workflows.md` for the appropriate recipe.

```sh
python3 -I scripts/save.py check /absolute/evidence-run --name regression --phase before -- <real-command> <args>
python3 -I scripts/save.py check /absolute/evidence-run --name regression --phase after -- <real-command> <args>
python3 -I scripts/save.py attach /absolute/evidence-run --criterion AC1 --phase after \
  --surface local --file /absolute/artifact --observation 'Action, environment, and observed result'
python3 -I scripts/save.py report /absolute/evidence-run --format json
```

`check` executes only explicit argv in the target project; it is not a sandbox for untrusted commands. Review side effects within authorization. Baseline failure returns 1 and remains in history. Artifacts are copied and hashed; their content and capture context are still agent observations. Record browser/OS/device, build, prerequisites, action, result, and relevant side effects. Match before and after environments when making a comparison.

## Return a reviewable result

Return the analysis, relevant source references, mechanism changed or investigated, actual command results, before/after artifacts, and remaining gaps. The report binds evidence to the task and source fingerprint; recheck affected evidence after relevant code, goal, or environment changes. Fingerprints exclude ignored/generated files, symlink target content, and external state. They cannot establish environment freshness.

Passing commands, application acceptance, deployment acceptance, and physical-device acceptance are separate conclusions. A screenshot alone does not prove a journey. Do not weaken an acceptance condition to get a green result. Use the existing project authority for merges and releases.

The evidence JSON can be imported at https://runsave.dev/agent-coding for human review. Imported statements are reported observations, not server-certified execution. If a required driver or prerequisite is unavailable, report the exact gap and continue independent authorized work.

## Service and payment boundary

The public manifest and OpenAPI contract describe actual service inputs and outputs. Nexus publishes discovery metadata; it does not grant project access or business execution permission. Hosted calls use beta-key access today. A future 402 gateway must own quote, authorization, payment, replay, and fulfillment; this package does not implement or grant those actions.

Research and license attribution are in `references/research.md` and `THIRD_PARTY_NOTICES.md`.
