haze.
Docs / Guide

Workflows.

How haze behaves across longer jobs: durable sessions, parallel fleet runs, image attachments, instruction files, managed processes, and headless pipelines.

Durable sessions

Every interactive conversation is saved as compact JSONL under ~/.haze/sessions. Streaming chatter is skipped and bulky tool output is slimmed, so files stay small.

  • /resume — browse this workspace's sessions, continue one, or fork a copy to explore an alternate approach without touching the original.
  • haze --continue — pick up the latest workspace session immediately.
  • /compact [instructions] — condense older context into a size-limited continuity summary instead of starting over. Automatic large-history compaction is split-turn aware, and every compaction is recorded in stream events and the session log.
  • /session — show the current session file; /new starts fresh.
Aborting is safe. Esc stops the current turn without losing the session; registered background processes keep running until the session ends or you kill them.

Fleet & subagents

When work splits into genuinely independent pieces, /fleet hands them to disposable workers. Each worker starts with fresh project instructions for its scope, a fixed tool budget and deadline, and its own context — the main conversation receives only a compact result, keeping your window clean.

inside haze
/fleet migrate packages/web, packages/admin, packages/mobile, packages/cli from sdk v1 to v2

# control one run explicitly:
/fleet --profile review --workers openrouter/anthropic/claude-sonnet-4.6 --concurrency 2 \
  review the auth, billing, and notifications services for security issues
  • Profiles control concurrency and deadlines; file mutations are serialized across retries.
  • If a worker ignores an abort, its concurrency/mutation slot stays occupied until it actually stops.
  • haze declines work that cannot run in parallel rather than faking it.
  • The model can also spawn single subagents on its own for context isolation.

Image input

Reference an image in your prompt and haze sends it alongside your text:

prompts with images
@design/reports-tab.png this tab overflows on narrow screens — fix the spacing
@screenshots/error.png reproduce this crash and fix it
recreate the chart in @mockups/analytics.png with recharts
  • Formats: png, jpeg, gif, webp — up to 5 MB and 4 per message.
  • Opt-in: mark the provider image-capable in /provider; images are only sent to capable providers. /settings shows which are.
  • Invalid paths or oversized files fail with a clear message before any model call; resumed sessions keep a placeholder instead of image bytes.

Context files

haze builds project understanding from Markdown instruction files, loaded in a defined order:

  • Global: ~/.haze/AGENTS.md wins over ~/.claude/CLAUDE.md.
  • Ancestors: root AGENTS.md / CLAUDE.md load at startup.
  • Nested: subtree instruction files load lazily when tools touch that directory, and reload when their signature changes.

Run /init to generate a compact, budget-aware AGENTS.md for the current repo. Check context cost any time with /context.

Type @ to browse workspace files, or mention a path containing / to bless an outside file for read-only access during that turn. Mutating tools always stay inside the workspace. Protected secret files (SSH keys, shell histories, .env, credentials) are never readable, even when explicitly mentioned.

Background processes

The agent can register up to five dev servers or watchers with shell background=true, then inspect them with the process tool:

  • Each process has a 256 KB rolling output log, readable by handle even after summarization.
  • The status bar shows the live count; aborting a turn leaves processes running.
  • Starting a new session or exiting haze terminates every registered process tree.
  • Background processes are unavailable inside fleet workers and never outlive haze itself.

Headless & CI

haze -p runs one non-interactive turn with the full toolset and exits with a meaningful code, which makes haze a building block for pipelines:

github actions example
pr-review:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
      with: { fetch-depth: 0 }
    - uses: actions/setup-node@v4
      with: { node-version: 22 }
    - run: npm i -g @denizokcu/haze
    - name: Configure haze provider # keys live in settings.json, never env vars
      run: |
        mkdir -p ~/.haze
        cat > ~/.haze/settings.json <<EOF
        { "provider": "openrouter",
          "model": "anthropic/claude-sonnet-4.6",
          "providers": [ { "name": "openrouter",
            "url": "https://openrouter.ai/api/v1",
            "key": "${{ secrets.OPENROUTER_API_KEY }}",
            "models": ["anthropic/claude-sonnet-4.6"] } ] }
        EOF
        chmod 600 ~/.haze/settings.json
    - name: Review the PR diff
      run: |
        git diff origin/main...HEAD | \
          haze -p "review this diff: bugs, test gaps, risks" \
          --output json > review.json

--output json emits one envelope for scripts; --output stream-json streams live NDJSON events first. Combine with --resume <id> to load a saved session's context without modifying it. For long autonomous runs, --until-done relaunches the goal after transient provider failures (exponential backoff, goal_resume events, a three-strike no-progress guard) until it structurally completes or --timeout hits — a provider hiccup at hour two no longer wastes the run, and unattended operation never grants extra authority. Completion is evidence-gated: declared tasks and post-edit validation must agree before a mutating goal reports done. For fixes, a pre-edit failing check is optional; when one is observed, that same check must turn green. Validation pipelines use pipefail, and shell compounds that can mask failure do not count as passing evidence. See the terminal flags for the full contract.