// Pipeline

A simple agentic loop

The core loop stays deliberately legible: accept a goal, ask the model what to do, execute validated tools, feed observations back, and stream the result.

PromptReasonActObserve
01

Start with a goal

A user, application, scheduled task, or chat channel submits a goal along with the active system instructions and session context.

02

Let the model decide

The selected provider returns text, tool calls, or both. PasClaw normalizes provider-specific responses into one execution flow.

03

Execute and observe

Validated tool calls run under the configured policy. Their structured results become observations for the next turn.

04

Finish or continue

The loop continues until the model produces a final result, reaches a configured limit, or is redirected by an operator.

From the documentation

Technical details

Implementation notes drawn from the PasClaw repository documentation.

Dispatch and agent loop

The executable routes commands into agent, gateway, and TUI modes. RunToolLoop then coordinates provider responses, tool execution, memory, and session persistence.

  • Provider-specific payloads are normalized before entering the loop.
  • Independent read-only tool calls can execute concurrently.
  • Lifecycle hooks wrap turns, tool calls, results, and errors.

Context that survives

Sessions serialize after every turn and keep a compact working-state snapshot available after compaction or restart.

  • Working state tracks the last eight edited files, last shell command, and latest tool error.
  • A summarizer compacts long conversations at the configured threshold.
  • Queued steering instructions are drained into a running loop between steps.

Common questions

Frequently asked questions

Keep exploring

See how the rest of PasClaw fits together.

CLI and modes