agent-skills/session-management/SKILL.md

2.6 KiB

name intent description
ollie-session-management session, agent, spawn, kill, multi-agent, cooperate, collaborate Manage ollie sessions via the 9P filesystem — spawn, kill, rename, prompt, and read other agents. Use for multi-agent workflows and session coordination.

Ollie Session Management

Sessions live at ollie/s/. Each session is a directory; all operations are filesystem reads and writes.

Discover sessions

cat ollie/s/idx

Output is tab-separated: {id} {state} {cwd} {backend} {model}

Find sessions working in the same directory:

grep "$PWD" ollie/s/idx

Spawn a session

cwd is the only required field. name is optional — if omitted, a unique ID is generated. If provided, the name must be unique; the filesystem enforces this and will reject a duplicate.

# Minimal — generated ID:
echo "cwd=$PWD" > ollie/s/new

# Named session:
echo "name=reviewer\ncwd=$PWD" > ollie/s/new

The new session ID appears in ollie/s/idx immediately after creation.

Kill a session

rm -r ollie/s/{id}

Rename a session

mv ollie/s/{id} ollie/s/{newname}

Renaming updates $OLLIE_SESSION_ID inside the renamed session automatically.

Send a prompt

echo "your prompt here" > ollie/s/{id}/prompt

To queue work for after the current turn completes:

echo "your prompt here" > ollie/s/{id}/fifo.in

Read session state

Useful for observing what a peer is doing.

# Last 100 lines of chat history:
tail -100 ollie/s/{id}/chat

# Most recent model response (everything after the last user prompt):
offset=$(cat ollie/s/{id}/offset)
tail -c +$((offset + 1)) ollie/s/{id}/chat

# Current state (idle / thinking / calling: <tool>):
cat ollie/s/{id}/state

Discover available models

cat ollie/s/{id}/models

To switch model:

echo "model-name" > ollie/s/{id}/model

Change session working directory

echo "/path/to/dir" > ollie/s/{id}/cwd

Multi-agent workflow pattern

Agents prompt each other directly — fire and forget. The receiving agent processes the prompt and can prompt back when done.

  1. Check ollie/s/idx for existing sessions with matching cwd
  2. If none, spawn one: write to ollie/s/new
  3. Send work via ollie/s/{id}/prompt
# Spawn a reviewer and delegate work to it
echo "name=reviewer\ncwd=$PWD" > ollie/s/new
echo "Review the changes in the current branch and report back." > ollie/s/reviewer/prompt

The reviewer will process the prompt and can write back to your session when done:

echo "Review complete: ..." > ollie/s/{your-session-id}/prompt