[FEATURE] Programmatic artifact share-with-org + delete from headless/server CLI sessions
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Claude Code 2.1.186 can publish Artifacts from non-interactive sessions (VPS, CI, autonomous agents), but the two essential post-publish operations — sharing with the organization and deleting — have no programmatic path reachable by the publishing session. Both require either a browser UI or an enterprise Compliance Access Key, neither of which is available in a headless /login (OAuth) setup. An autonomous agent can publish but can never expose its output to the team or clean up stale artifacts without human intervention.
Proposed Solution
Any one of the following would unblock headless sessions:
- Publish-time visibility flag — a parameter on the Artifact tool to set org visibility at creation time (e.g.
read_mode: "org"), so a headless session can make its output team-visible without a follow-up action.
- Session-scoped manage API — allow the standard OAuth session that owns an artifact to change its visibility and delete it, without requiring a separate enterprise Compliance Access Key (self-service for the author, not just admin governance).
- CLI subcommands — at minimum,
claude artifacts share <id> --organdclaude artifacts delete <id>usable non-interactively from the terminal.
Alternative Solutions
- Expose artifact visibility as an environment variable (e.g.
CLAUDE_ARTIFACT_VISIBILITY=org) read at publish time, so headless sessions can configure it without code changes. - Allow the standard
/loginOAuth token to authenticate against the Compliance API for artifacts owned by that session, scoped to read/write/delete on the author's own content only.
Priority
Medium - Would be very helpful
Feature Category
API and model interactions
Use Case Example
Example scenario:
- An autonomous Claude Code agent runs on a VPS overnight, generating an HTML dashboard artifact summarizing the day's task activity.
- The agent publishes the artifact via the Artifact tool — this works fine today.
- The agent then needs to share it with the org so teammates can open it in the morning — currently impossible: the only share option is a button in the browser, which doesn't exist in a headless session.
- With this feature, the agent could pass
read_mode: "org"at publish time (or callclaude artifacts share <id> --orgafterwards), and the dashboard would be immediately visible to all org members without any human intervention. - This would save time because the entire report workflow — generate, publish, share, notify via Telegram — would run unattended end-to-end, with no manual step required from the team.
Additional Context
Links to similar features in other tools:
- GitHub Gists API:
PATCH /gists/{gist_id}with{"public": true}— allows programmatic visibility change on owned content via the same token used to create it. Exact analogue to what we're asking for artifacts. - Notion API:
PATCH /v1/pages/{id}supports sharing/permission updates from the same API key used to create the page.
Technical considerations or constraints:
- The publishing session already holds a valid OAuth token tied to the artifact's owner — scoping share/delete to "own content only" is a natural trust boundary that avoids any governance concerns.
- The Compliance API already models
read_modeas a field (referenced in earlier internal testing); exposing write access to the owning session would be a minimal surface addition. - For the CLI subcommand approach, the artifact ID is already returned/logged at publish time, so it's available to the agent for follow-up calls without additional state management.
Related issues (not duplicates):
- #61571 — Artifact sharing not working in Claude Cowork integration (UI/Cowork-specific)
- #54781 — Artifact API proxy strips mcp_servers parameter (different surface)
Internal reference: this scenario was discovered while running Claude Code 2.1.186 as an autonomous agent on a Linux VPS with Team plan /login auth, generating shareable HTML reports for a development team with no browser access on the server.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗