Docs
AI Sessions: Turn Claude Code Sessions into Posts

AI Sessions: Turn Claude Code Sessions into Posts

Use @postion/cli to sync your Claude Code sessions to Postion privately, with secrets redacted on your machine, and turn them into draft posts with one command or automatically.

AI Sessions syncs your work with Claude Code to Postion as a timeline only you can see. When you want to share it, one command turns a session into a draft post. You can also turn on automation for a project so drafts are created for you, and optionally published after a delay.

You set it up once in your terminal. After that there is nothing to do by hand.

Requirements

  • Claude Code installed
  • Node.js 18 or later (npx comes with Node)
  • A Postion account with at least one site (drafts are created on a site)

Quick start

Step 1: Log in

npx @postion/cli login

Your browser opens with a confirmation code. Check that it matches the code in your terminal, then approve. The terminal prints Logged in as <your name> when done.

The key it creates has a narrow scope: it can upload and read sessions and create private drafts, but it can never publish. Revoke it any time under Dashboard → Developers → API keys.

Step 2: Turn on automatic sync

npx @postion/cli install

This adds Stop / SessionEnd hooks to ~/.claude/settings.json (the original is backed up as settings.json.postion-backup) and copies the CLI to ~/.postion/runtime, so the hooks keep working even if the npx cache is cleared.

From then on, each Claude Code reply uploads in the background without slowing Claude down. Claude Code windows opened after this step always sync.

Step 3: Import existing sessions (optional)

# Inside a project: import its past sessions
npx @postion/cli sync
 
# Every project
npx @postion/cli sync --all

Step 4: Turn a session into a post

When you finish a piece of work in Claude Code, just tell Claude:

Run npx @postion/cli draft

It turns the latest session of the current directory into a private draft and opens it in the editor. Nothing is public until you review it and click publish.

You can also do this on the web: open Dashboard → AI Sessions, pick a session and click Create draft.

Command reference

Run any command with npx @postion/cli <command>. If you use it often, install it globally with npm i -g @postion/cli and run postion <command> instead.

CommandWhat it does
loginLog in by confirming in the browser. --key <API key> uses an existing key; --no-browser doesn't open the browser
installInstall the Claude Code hooks for automatic sync
uninstallRemove the hooks and stop syncing
syncUpload sessions of the current directory now. --all for every project; --force re-uploads, including sessions you deleted on the web
draftTurn the latest session of the current directory into a private draft. --site <subdomain> picks the site, --tools includes tool calls, --no-browser doesn't open the editor
ignore / unignoreRun inside a project to stop / resume uploading its sessions
statusShow the account, hook status, number of synced sessions and recent background syncs
logoutLog out (local sync state is kept)
--version / --helpShow the version / help

How drafts are made

  • Each "your prompt + Claude's answer" round becomes a section of the post; the title and summary are generated for you
  • Tool outputs never appear in posts. Tool calls are left out by default; include them with --tools or under Customize on the web
  • Prompts that may contain private info are skipped automatically: public IP addresses, database connection strings, email addresses and redacted-secret markers. Skipped prompts are listed, and you can add them back on the web if they are fine
  • The site defaults to the one you last used for an AI session post

Automation: drafts on their own, optional delayed publishing

If you don't want to create drafts by hand, authorize automation per project. It can only be turned on in the web dashboard; the CLI key can't change it.

  1. Open Dashboard → AI Sessions and select the project, or open any of its sessions
  2. Click the ⚡ Automation off button
  3. Turn on Create drafts automatically and choose a site
  4. (Optional) Turn on Publish automatically after 24 hours

Once on:

  • When a session has been quiet for 10 minutes and has at least 3 prompts, a private draft is created and you get an in-app notification and an email
  • As the session continues, the draft is updated. Once you edit the draft, your changes are never overwritten
  • With auto-publish on, the draft is published 24 hours after the session goes quiet, but only if nothing in the session was flagged as private. The final text is checked again right before publishing; if anything is found, publishing is canceled and you are notified
  • The session page shows a countdown and a Cancel auto-publish button. Turning automation off cancels all scheduled publishing immediately
  • Only sessions with activity after you turn automation on are processed; older sessions are never published automatically

Privacy and security

  • Redacted on your machine: before upload, API keys, tokens, private keys, passwords in URLs and secret-looking assignments (such as in .env) are replaced with [REDACTED:…], and your home directory path becomes ~
  • Private by default: synced sessions are visible only to you; only posts you publish are public
  • Least privilege: the CLI key can't publish; auto-publishing can only be authorized by you on the web
  • Exclude projects: run npx @postion/cli ignore inside any project you don't want synced
  • Delete sessions: click Delete on a session page; it won't be uploaded again (unless you use sync --force)

Troubleshooting

Sessions aren't syncing? Run npx @postion/cli status. Check that you are logged in, the hooks show installed, and look at the recent background syncs. Claude Code windows that were already open before you ran install may not sync; open a new one.

status says outdated? Run npx @postion/cli@latest install to update the local runtime.

Key rejected? The key may have been revoked. Run npx @postion/cli login again.

Want to turn it all off? Run npx @postion/cli uninstall to remove the hooks, then npx @postion/cli logout, and revoke the API key in the dashboard.