invariance_session_create
Start a new agent session to contain a bounded chunk of work, such as a Claude Code task, meeting, recording, or note, so events and tool calls can be appended and linked to a run.
Instructions
Open a new agent-session — the canonical container for an operator's bounded chunk of work in the company brain. CALL THIS at the START of: a new Claude Code task (source='api'), a screen recording for a teammate (source='screen_recording'), a mic capture session (source='microphone'), a meeting (source='meeting'), ingestion of a Granola note (source='granola_note'), or a manual note-taking session (source='manual_note'). Events (transcript chunks, tool calls, screenshots, notes) are appended to this session via invariance_session_append_note or the events sub-route. Link a session to a run via agent_id+run_id (or call invariance_session_attach_run later).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | Human-readable title for the session. | |
| run_id | No | Optional run ID to attach at creation time. | |
| source | Yes | What kind of activity stream this session represents. Use: - "api" for autonomous agent work, including a single Claude Code task / sub-agent invocation (one Claude Code session = one agent-session with source="api"). - "screen_recording" when capturing a human teammate's screen for the company brain. - "microphone" when capturing raw mic audio (e.g. a teammate thinking out loud at their desk). - "meeting" for a Zoom/Meet/in-person meeting with multiple participants. - "granola_note" when ingesting a Granola meeting note. - "manual_note" when a human or agent is jotting freeform notes into the brain. | |
| agent_id | No | Optional agent ID to associate with the session (for source="api" Claude Code work, this is the agent running the task). | |
| metadata | No | Optional metadata as a JSON object string. Example: {"participants":["alice@x.com"],"app":"granola"} | |
| session_type | No | Optional finer-grained label, e.g. "claude_code", "standup", "1on1", "design_review". | |
| external_session_id | Yes | Stable client-supplied ID for dedup (e.g. the Claude Code conversation ID, the meeting calendar event ID, the Granola note ID, the screen-recording file UUID). Reusing the same external_session_id for the same source returns the existing session. |