Extending
Specs: memory, MCP, hooks, agents and commands.
AGENTS.md, CLAUDE.md, GEMINI.md and BLITZ.md, from the repository root down to the workspace, plus ~/.blitz/BLITZ.md, are added to the agents’ instructions, so a repository set up for another agent works unchanged. A file with the same content under two names loads once. BLITZ.local.md and CLAUDE.local.md are personal, and Blitz warns if git tracks them. /setup (also /init, blitz init, and the desktop app’s wand) makes the folder a git repository with a .gitignore for its stack, if you agree, and sets a project up the recommended way: one .agents/AGENTS.md, with each of those four files a single @.agents/AGENTS.md line, so Blitz, Claude Code, Gemini CLI and Codex all read the same instructions.
A line can import another file with @docs/style.md: relative to the file, at most five deep, never from outside the repository (or ~/.blitz for your own files), and never a blocked path.
Rule files in .blitz/rules/, .agents/rules/, .claude/rules/ and ~/.blitz/rules/ load too. One with frontmatter paths: ["src/api/**/*.go"] is given to the agent only when it first reads or edits a matching file. Quote globs (paths: "*.go"): a file whose front matter isn’t valid YAML isn’t used, and Blitz says so. None of these files can grant permissions. /memory lists what’s loaded; /init has the agent write BLITZ.md.
A rule can also be checked rather than followed. Give it when: before_agent (it judges your prompt before the agent runs) or when: after_agent (it judges the answer and the changes before the turn ends), and say what a failure does:
---
when: after_agent
action: revise # block, warn or revise
order: 10 # gates run by order
agents: [coder] # none: every agent
---
The answer says how the change was tested.
block stops a prompt (or marks an answer as failing), warn says so in the chat, and revise gives the agent the reason: with the prompt, or as a request to fix its answer (twice at most). A fast model judges each rule (the suggestions model). In the desktop app, Studio › Rules lists them in the order they run, reorders them by dragging, and has Try it to check a sample prompt or answer.
Rules are about the quality of the work. Guardrails are about safety and limits, and they watch every step of a turn: your prompt, each tool call before it runs, what each tool brings back, and the answer. Three are built in, and they’re on by default. A file in .agents/guardrails/ named after one (~/.blitz/guardrails/ for every workspace) changes its settings, or switches it off with enabled: false; delete the file to go back to the defaults:
---
builtin: limits
limits:
max_cost_usd: 2 # per turn (0: no ceiling)
max_turns: 40 # model calls per turn, its continuations included (0: no ceiling)
max_files_changed: 20
allowed_domains: [example.com]
commands: [defaults, "dropdb *"]
---
Without a file, limits refuses force pushes (--force, -f or a +branch; --force-with-lease is allowed, since it won’t overwrite commits you haven’t seen), deleting / or your home folder (rm -r or rm -rf, with its flags in any order, $HOME and /* too, even after sudo -u root, env, nohup or xargs, inside cd x && …, $(…) or bash -c "…"; a push as git -C dir push -uf too), mkfs and dd onto a disk; a file’s commands replaces that list, and defaults in it stands for that list as your version of Blitz has it, so commands: [defaults, "dropdb *"] adds to it and keeps up with updates (no commands keeps the defaults; commands: [] refuses none). Each pattern is matched against the whole line and against each command in it. A turn also stops at 200 model calls or $10 unless the file sets max_turns or max_cost_usd under limits: (0: no ceiling); when it stops, it says which guardrail set the limit and where to change it, and you can send “continue” to carry on where it stopped. A refused domain, command or file says which setting refused it, and in which file. allowed_domains holds web fetches, the browser (its scripts are refused while it’s set, and a page a click takes off the list is withheld) and workflows’ API and remote agent calls; MCP servers reach what their own settings let them. A mistake in the file (a setting outside limits:, a setting Blitz doesn’t know, such as a misspelt allowed_domain, an action it doesn’t have) shows in Studio, and the guardrail runs with its defaults until it’s fixed. prompt_injection watches what web pages, the browser and MCP servers return for text aimed at the agent: a fast model confirms each match first, so a page that only quotes or discusses injection passes (judge: false acts on the pattern alone), and then action: redact (the default) takes the instructions out and keeps the rest of the page, warn tells the agent it’s data, not orders, and block withholds it all. secrets masks credentials in answers (action: redact, warn or block; pii: true adds email addresses, phone numbers, card and social security numbers). Your own guardrail is a check in plain English, judged by the suggestions model:
---
stage: action # input, tool_result, output or action
action: block # or warn
tools: [run_shell_command]
---
Deleting a git branch, locally or on the remote.
A rule that can’t be checked lets the turn go on; a guardrail that can’t be checked and blocks stops what it guards. In the desktop app, Studio › Guardrails switches the built-ins off and on, tunes them (or resets them to their defaults), and edits your own, with Try it. In the limits’ form, an empty ceiling follows the default (200 model calls, $10), No limit (or 0) turns it off, and a value that isn’t a number is shown as an error instead of being saved.
Edit any of these, or an agent or skill in .agents/, while you work: the change applies from your next message, in the same conversation or a new one. Blitz checks the files’ sizes and times before each message and reloads only what changed. /reload (in the app, Agents › Reload agent files) reads them all again now and says what it loaded. MCP servers in .mcp.json or .agents/mcp_config.json are the exception: open the workspace again to apply a change to them.
Instructions are what you hand down; .agents/EXPERIENCE.md is what agents found out here. /setup creates it with two headings, How to work (habits true in any project: read the error before retrying, run the tests before saying it’s done) and This project (its commands, data and conventions), and .agents/AGENTS.md imports it with the line @EXPERIENCE.md, so every agent, in Blitz and in the tools that follow imports, reads it. Each entry is one sentence and, in brackets, the runs it came from.
/reflect [since] fills it. The reflector reads what went wrong in this workspace’s sessions since the last reflection (or the last 14 days; since is a date or a number of days), from the audit log: failed commands and tools, actions you or a rule refused, guardrail blocks, your corrections (“no, use pnpm”), undos, stopped turns and limits, and the skills and agents in those turns. It also sees what worked after a failure (the agent ran make deploy after make push failed), so an entry says what to do, not only what went wrong; and work agents did again in .agents/scratch/ in different sessions (a script rerun, a file fetched again), which it offers to turn into a support script in .agents/scripts/. It groups them into patterns (twice or more, or once at a cost), weighs each as a habit and as a fact about the project, and offers at most five changes in one question: an experience entry, a line in .agents/AGENTS.md, a step in a skill, an agent’s tools, a rule or guardrail, a support script. It writes only what you pick. A habit that held in two or more of your workspaces can be offered for ~/.blitz/BLITZ.md, so every workspace gets it. The evidence needs the audit log ([audit] enabled, on by default).
Reflecting is always your call; Blitz says when it’s worth it. Each pattern counts one, and one that cost something (an undo, a turn at a limit, an action you refused) counts two. When the count since the last reflection reaches reflect_threshold (5 by default), the welcome screen says Agents hit the same problems: review what to learn, the terminal says it under its banner, and the chat says it once at the end of a turn, with Reflect (/reflect in a new chat) and Not now (not again for a week). The chat says it at most once a day. To have it look on its own, give the workspace a schedule in its own settings, never the project’s (the Overview’s settings in the desktop app):
[harness]
reflect_schedule = "every monday at 09:00" # off by default
max_cost_usd = 0.5 # a scheduled reflection stops here
reflect_threshold = 5 # when to suggest /reflect; 0: never
A scheduled reflection reads and proposes but changes nothing: when there’s something new, the welcome says N changes to review, and /reflect offers them.
/skills update, /agents update and /rules update read the same evidence: a skill that fails at the same step, an agent denied the same tool again and again, a rule that keeps sending work back. When the runs since the skills or agents last changed show a pattern about them, the welcome offers their update.
The agent also keeps its own notes across sessions, with its remember tool: a fact about the project, how you like things done, or a mistake not to repeat. Each is a small Markdown file in ~/.blitz/memory/<workspace>-<hash>/, with credentials masked before it’s saved. They’re added to the agent’s instructions when a session starts (the newest first) as things it learned, never as permission to do anything.
/memory notes # what it saved, newest first
/memory forget 20260930-1412 # delete one (the start of its name will do)
blitz memory list # the same from the shell, plus show and edit ($EDITOR)
Set [memory] auto = false to turn them off.
When you move to another conversation, Blitz writes down where the one you left stands: what it was for, what got done and decided, what’s still open and the next step. It goes in the same folder, as sessions/<session id>.md. A conversation is yours, so this stays on your machine and never goes in the project. Credentials are masked, and very short conversations (one question and its answer) get no summary.
A new conversation’s first message tells the agent about the five latest earlier ones in the workspace (when each was, its title and where it stood), gives it the latest one’s summary in full, and says where the repository stands: the branch, the uncommitted files and the latest commits. Ask it to pick up where you left off, or what you did yesterday, and it answers from these, reading another conversation’s summary with its recall_session tool when you mean an older one, and checking what changed since. The summary is written with the small model, the same one the welcome suggestions use: [suggestions] model, else the reviewer’s, else the main one.
Set [memory] summaries = false to turn summaries off (auto = false turns them off too). You can still search earlier chats with search_workspace.
A style changes how the agent writes its answers, not what it may do: concise keeps them short, explanatory explains its choices and the codebase as it works. /style lists them and /style concise switches (the desktop app has it in a workspace’s settings); [ui] style = "concise" makes it the default. Add your own as Markdown in ~/.blitz/styles/<name>.md, with an optional description in frontmatter.
For one run, --append-system-prompt "…" or --append-system-prompt-file notes.md adds to the agent’s instructions.
MCP servers give the agent tools other programs offer: blitz mcp add <name> <command|url>, or [[mcp.servers]] in the settings. Everything about them, from approvals and OAuth to prompts, resources and troubleshooting, is in MCP servers.
Hooks are your commands, run at points in the agent’s work. Each receives a JSON event on stdin: event, session_id, prompt_id, workspace, transcript_path, permission_mode, agent, and the event’s own fields (tool, args, result, prompt, …).
[[hooks.pre_tool]]
match = "run_shell_command" # a tool-name glob
command = "~/.blitz/hooks/check.sh"
[[hooks.post_tool]]
command = "jq -c . >> ~/tool-log.jsonl"
[[hooks.prompt_submit]]
command = "grep -qv 'password' || { echo 'no secrets' >&2; exit 2; }"
| Hook | Can |
|---|---|
pre_tool, prompt_submit |
Block the action: exit 2 (stderr is the reason) or print {"decision":"block","reason":"…"}. What a prompt_submit hook prints is given to the agent with the prompt |
session_start |
Add context for the agent |
stop |
Keep the agent going: {"continue": true, "reason": "now run the tests"}, at most five times per prompt |
permission_request |
Answer an approval: {"decision": "allow"} or "deny" (deny rules still come first, and what an ask rule covers it may only deny) |
post_tool, post_tool_failure, session_end, subagent_start, subagent_stop, pre_compact, post_compact, notification |
Observe only. They run in the background, in order, and never delay the agent |
A pre_tool hook can do more than block. Its JSON reply may carry "decision": "allow" (the call skips its approval question; deny and ask rules still apply), "ask" (you’re asked first), "updated_args" (the call runs with these arguments instead), "additional_context" (given to the agent with the result) and, from any hook, "system_message" (shown to you).
Hooks needn’t be shell commands:
[[hooks.pre_tool]] # only for git push
match = "run_shell_command"
if = "shell(git push *)"
args = ["/usr/local/bin/check-branch"] # run directly, no shell
[[hooks.pre_tool]] # ask a policy service
type = "http"
url = "https://hooks.internal.example/blitz"
headers = { Authorization = "Bearer $HOOK_TOKEN" }
allowed_env_vars = ["HOOK_TOKEN"]
[[hooks.pre_tool]] # or have a model judge
match = "run_shell_command"
type = "prompt"
prompt = "Deny anything that deletes outside the workspace or touches production."
An http hook’s headers get only the variables allowed_env_vars names, and never one sandbox.scrub_env withholds from commands (*_API_KEY, *_TOKEN, … by default): to send such a token, take its pattern out of scrub_env. Before you trust a project’s hooks, Blitz shows the headers and variables each http hook would send.
if takes a permission rule: shell(…) is checked against each command of the script (one Blitz can’t parse runs the hook, so it can decide), read, write and delete(…) against the files a call reads, writes or deletes (for apply_patch, the files in its patch), and web(…) against a page’s host.
/hooks lists them all, where each came from, and their recent failures.
Other failures, a reply that starts with { but isn’t valid JSON or names a decision Blitz doesn’t know among them, warn unless fail_closed = true. Hooks come from your own trusted settings, so they run outside the OS sandbox with your environment; they’re still killed with Blitz.
A Markdown file is a slash command: ~/.blitz/commands/fix.md is /fix. In a project, .blitz/commands/, .claude/commands/ and .agents/workflows/ work too; the project’s win, and db/migrate.md is /db:migrate. A .flow.yaml in .agents/workflows/ is a workflow: several steps, run by the same /name. The body is the prompt, with $ARGUMENTS or $1…$9 for what you type after the command.
---
description: Fix a GitHub issue
argument-hint: <issue>
agent: qa # run as this agent
model: anthropic/claude-haiku-4-5
allowed-tools: Read, Grep, Bash(git *) # this turn may use only these
mode: plan # read-only
---
Fix issue #$1: read it with `gh issue view $1`, find the cause, fix it and add a test.
Without allowed-tools the turn may use every tool; allowed-tools: [] allows none. A key Blitz doesn’t know (allowed_tools, say) or an allowed-tools it can’t read is the command’s problem, reported, and the command doesn’t run.
/review, /security-review (both read-only), /simplify and /verify are bundled, and every skill is a command too. Built-in commands win name clashes; /help lists the custom ones.
A plugin bundles skills, commands, agents, hooks and MCP servers in one directory with a plugin.toml:
lint-kit/
plugin.toml # name = "lint-kit", version = "1.2.0", description = "…"
skills/lint/SKILL.md
commands/fix-lint.md
agents/linter.md
hooks.toml # [[post_tool]] … as [hooks]; ${BLITZ_PLUGIN_ROOT} is the plugin's folder
mcp.toml # [[servers]] … as [mcp]
blitz plugin install ./lint-kit # or a .zip, an https URL, a git repo, or a name from a marketplace
blitz plugin list
blitz plugin disable lint-kit # enable, remove, update [name]
blitz plugin marketplace add https://example.com/marketplace.toml
blitz plugin install lint-kit@acme
blitz --plugin-dir ./lint-kit "try it" # load one for a run, without installing
blitz plugin import claude ~/src/some-claude-plugin # or: import gemini <extension>
Installing shows everything the plugin adds, and hooks and MCP commands first, because they run code on your machine; it asks before going ahead (--yes skips the question). Blitz records a hash of the installed files and won’t load a plugin whose files changed afterwards: blitz plugin update fetches it again. A marketplace lists each plugin with its hash, and a plugin that doesn’t match isn’t installed. Plugins and marketplaces come over https (plain http only from this machine), since their hashes are only as good as the connection. hooks.toml and mcp.toml hold the [hooks] and [mcp] tables’ contents, without the table’s name: a key Blitz doesn’t know is an error, so a hook can’t be skipped silently. The Claude importer doesn’t give an agent a scoped tool such as Bash(git tag:*), since the Blitz tool would allow every command; its report names it.
Plugins you enable load in every workspace. A project can turn some off, or on once you trust its settings:
# .blitz/settings.toml
[plugins]
enable = ["lint-kit"] # needs trust
disable = ["noisy-kit"]
If you’re connected to an organization whose policy turns off your own plugins, none of them loads, in any workspace: Blitz says so when a workspace opens, and blitz plugin list and install say so too.
The importers convert what maps from Claude Code plugins and Gemini CLI extensions (commands, skills, agents, hooks, MCP servers) and list what they couldn’t. See the plugins spec.