Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Data retention and deletion

Uploaded agent sessions have a 30-day lifetime from server-side session creation. Sending more events does not extend that lifetime. This policy covers agent-session events and titles in the workspace telemetry database.

What happens over time

StageBehavior
First accepted batchCreates a session with creation and expiry timestamps. The expiry is 30 days after creation, not 30 days after the original agent activity.
Additional batchesAppend or deduplicate events without moving the expiry timestamp.
ExpirySession reads and listings stop returning the session. MCP searches and derived activity queries exclude expired sessions. Further ingestion into that session returns 410.
Retention cleanupRemoves expired session events and clears titles. A minimal removed-session record remains so replays cannot recreate the same session ID.
An expired session becomes unavailable even if cleanup has not run yet. Physical deletion is performed by a separate retention job, so expiry does not guarantee immediate removal of the underlying database rows or backup copies.
A mission can span several sessions. Each session keeps its own expiry clock. Removing a stream removes its projected events, reviews and outgoing links. A retained consumer can still cite a predecessor whose evidence is unavailable.
The supported producer retry horizon is the session lifetime, up to 30 days after its creation. It ends earlier if the session is forgotten or unshared. For an active stream, the service retains event identities through archival so producers can replay the original payloads after compaction and receive a deduplicated receipt.
The 30-day agent-session lifetime applies to every workspace.

Unshare a trace

Unshare a session when you want its shared evidence removed before expiry:
span login span unshare --session 6b2863cf-ce34-405e-af75-27748912d239
The original sharer or a workspace owner or admin can unshare an active session. The CLI uses the signed-in workspace for this operation. With an API key, ownership belongs to the key that originally shared the session; creating a replacement key does not transfer that ownership. See API unsharing.
Unsharing deletes the session's stored events, clears its title, and hides it from readers. It keeps a minimal record of the unshared session, including its identifier, workspace, and sharer. The local agent transcript stays on disk.
To share it again before its original expiry, use span share while signed in with the authorized sharer identity, or the API's explicit reshare route. Resharing sends the events again and starts a new 30-day lifetime. Normal ingestion does not restore an unshared session.

Forget versus unshare

The authenticated dashboard API also provides a forget operation for workspace owners and admins. It deletes the stored events, clears the title, and marks the session as removed. Removed sessions cannot be reshared under the same identifier. Scoped API keys do not have access to this operation.
ActionShared events and titleCan the same session ID return?Local transcript
UnshareDeleted and hidden.Yes, through explicit resharing before the old expiry.Kept.
ForgetDeleted and marked removed.No.Kept.
ExpireHidden at expiry; deleted by the retention job.No.Kept.
span removeUnchanged.Existing sharing stays available until removed or expired.Kept.
span logoutUnchanged.Existing sharing stays available until removed or expired.Kept.
Removing hooks stops future automatic sharing; it does not recall previous uploads. Logging out revokes that computer's CLI connection; it does not delete workspace data.

Local files, exports, and other copies

The server's 30-day session policy does not delete native agent histories, local Vercel AI SDK captures, reviewed JSONL exports, or Git notes. Manage those files and any copies pushed to Git remotes separately.
The policy also does not define a deletion schedule for database backups, infrastructure logs, account records, comparison definitions, or evidence held by external model providers. It is not a blanket retention period for every Halfspan data store. For deployment-specific backup, log, or provider retention requirements, confirm the applicable configuration and service terms with your deployment administrator.

Board conversations

A Board thread expires after 30 days without a new message or a new participant acknowledgment on a message. Its messages and receipts expire together. Board reads enforce the deadline immediately, and the workspace retention job removes the stored entries. Workspace Board

Assistant conversations

The workspace assistant stores questions, answers and agent checkpoints separately from uploaded traces. A conversation lasts at most 30 days and ends no later than the earliest retained trace expiry in its project or workspace scope. Reads and resumed work enforce this deadline immediately; the retention job removes expired conversations and checkpoints.
Unsharing, forgetting or moving a trace clears assistant conversations across its workspace, including saved evidence and pending work. This conservative reset prevents a follow-up from recalling evidence that is no longer available in its original scope. A new question starts a fresh conversation. Workspace assistant

Running retention cleanup

For deployments you operate, schedule the retention program for every workspace using its telemetry database. It is a one-shot command, not a continuously running scheduler:
just go-build HALFSPAN_TELEMETRY_DATABASE_URL="$TELEMETRY_DATABASE_URL" \ services/bin/agent-retention workspace-id
You can pass multiple workspace IDs. The command processes expired active sessions in bounded batches until no more eligible sessions remain. Session reads enforce expiry independently, but running this job is required to remove expired event payloads from the application database.

Event storage and archival

Production deployments can use PlanetScale Postgres for transactional state and ClickHouse for archived event bodies. Set HALFSPAN_CLICKHOUSE_URL, HALFSPAN_CLICKHOUSE_DATABASE, HALFSPAN_CLICKHOUSE_USER, and HALFSPAN_CLICKHOUSE_PASSWORD on the API and retention processes, then run just clickhouse-init with schema-owner credentials. Use separate scoped runtime credentials for reads and maintenance. Deployment and migration instructions are in infra/observability/storage.md.
The retention program remains responsible for transferring events and compacting the PostgreSQL journal. Schedule it for every workspace. Event identities and reduced evidence metadata remain in PostgreSQL for deduplication, references, and transactional projections. Dashboard trace search also searches ClickHouse and validates matches against active PostgreSQL sessions and committed archive manifests. Broad archive searches cap candidates at 4,096 chunks and report truncation; expired and removed sessions remain unavailable.
ClickHouse Cloud manages object storage and caching. The local Compose service uses a persistent disk volume; configure object storage and cache policies separately for a self-hosted production deployment. This does not change the 30-day session lifetime.
When migrating existing object archives, keep both sets of credentials configured and run services/bin/agent-retention --copy-events-to-clickhouse workspace-id. The command verifies source and destination checksums and can be rerun. Existing S3 event chunks remain readable as a fallback and are removed with ClickHouse copies during normal session cleanup. Artifact content continues to use S3.

S3 archive and artifacts

Set HALFSPAN_ARCHIVE_BUCKET_URL to a private bucket URL, for example https://my-bucket.s3.us-east-1.amazonaws.com. Supply HALFSPAN_ARCHIVE_REGION, HALFSPAN_ARCHIVE_ACCESS_KEY_ID, and HALFSPAN_ARCHIVE_SECRET_ACCESS_KEY to the API and retention processes. Temporary credentials also use HALFSPAN_ARCHIVE_SESSION_TOKEN. The API reads objects. The retention process needs permission to conditionally create, read, and delete them. Keep the bucket private and use an unversioned bucket for physical deletion, or configure expiry of noncurrent object versions.
The API acknowledges events after the PostgreSQL transaction commits. The worker groups events older than five minutes into gzip chunks for a single tenant and session, targeting 1 MiB before compression. It records its upload intent, writes the object, downloads it to verify its checksum, then commits its manifest. After a 24-hour hot window a later transaction compacts the journal. Each invocation processes up to 1,000 archive steps per supplied workspace. Schedule the command frequently enough to drain the backlog. A failed step exits with an error and the next invocation retries from the committed state.
Until session expiry, retrying an identical event returns zero new inserts, including after archive compaction. Reusing the same ID with different content returns a conflict. Unsharing, forgetting, or expiry hides the stream immediately. The retention worker removes event chunks for deleted sessions and retries failed deletions. Scope any fallback age-based bucket lifecycle rule for event chunks to the events/v1/ prefix, with allowance for in-flight writes. Keep the archive endpoint and credentials available to readers for the lifetime of compacted sessions.
Explicitly uploaded artifact content is shared by SHA-256 digest within a single workspace. Each producing event has its own reference. Deleting one session revokes access through that session, and the retention worker removes the stored bytes after the last reference is gone. A newer session can still reference bytes first uploaded by an older one.
Uploaded artifact bytes use the separate artifacts/v1/ prefix. An upload requires a redacted capture record, the producing sharer or workspace admin, and bytes matching the event's SHA-256 digest. Identical bytes share an object within a tenant. Each producing event keeps its own reference. Removing a session drops its references. The worker deletes the object after the last reference is removed, so use reference-based deletion for this prefix. A later session can keep an artifact active beyond 30 days from its initial upload.
To check archive progress, use the restricted database role and set the psql variable workspace to the authorized organization ID. The first query reports eligible events still waiting for a chunk. The second shows verification progress, stored bytes, and objects waiting for deletion.
BEGIN; SELECT set_config('halfspan.organization_id', :'workspace', true); SELECT count(*) AS eligible_events, min(e.journaled_at) AS oldest_eligible FROM agent_events e JOIN agent_sessions s ON s.organization_id=e.organization_id AND s.id=e.session_id WHERE e.organization_id=:'workspace' AND e.archive_id IS NULL AND e.journaled_at <= now() - interval '5 minutes' AND NOT s.deleted AND s.expires_at > now(); SELECT state, discard AS awaiting_deletion, count(*) AS chunks, sum(event_count) AS events, sum(stored_bytes) AS compressed_bytes FROM agent_archives WHERE organization_id=:'workspace' GROUP BY state, discard ORDER BY state, discard; COMMIT;
See Privacy and shared data for what sharing sends, text-selection defaults, and workspace visibility.