Skip to content

Evaluate /goal command for autonomous agent loops #482

Description

@olegbrok

Context

Claude Code v2.1.139 introduced the `/goal` command:

Set completion conditions for autonomous work across turns.

Our agents (Barsik, Murzik, Persik, Ryzhik, Pushok) run heartbeat-driven autonomy loops. On each heartbeat they:

  1. Send a heartbeat
  2. Check inbox
  3. Pull next task
  4. Do background work
  5. Update saved context

The decision logic for "is this task done?" / "should I keep working on this overnight?" is currently ad-hoc, scattered across each agent's soul/CLAUDE.md and saved context. `/goal` may offer a more structured way to declare "keep iterating until X" and let the harness track completion.

Questions to answer

  1. What's the actual semantic of `/goal` — does it persist across turns / sessions, or only within a single Claude Code session?
  2. Does it gate other tools, or is it advisory?
  3. How does it interact with our heartbeat triggers (which inject fresh prompts each hour)?
  4. Could a single `/goal` declared overnight survive a daemon restart? (Probably not — relevant to Fleet: Live Activity should show tasks + peer reviews; Agent Comms not displaying messages #84.)
  5. Is there a way to query the current `/goal` programmatically from the SDK?

Why this matters

If `/goal` survives across heartbeats, we could replace some of the imperative "check the saved-context priority_items" logic with declared goals. That cleans up our autonomy story and makes agent intent inspectable.

If it's session-local only, this is a no-op for our use case and we close.

Spike plan

  1. Read the docs / source for `/goal` in claude-code repo
  2. Try it manually in an interactive session: `/goal merge stack PRs feat(config): PINKY_DEPLOYMENT_MODE env + cached app.state.deployment_mode (#434) #472-479` then trigger a heartbeat
  3. Inspect what state survives across heartbeats vs gets dropped
  4. Report findings; close or convert to design doc

Effort

~2 hours. Spike-grade — no code changes expected from this issue, just a writeup.

Sources

🤖 Opened by Barsik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions