Code Sessions
Interactive code execution sessions.
Access it as client.code_sessions on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.
Methods
Core
create
create(*, project_name: str, project_description: str, project_id: str | None = None, workspace_id: str | None = None) -> CodeSession
Start (or resume) an interactive code session.
Parameters
project_name(str): Name of the project.project_description(str): Description of the project.project_id(str | None, optional): Create the session's workspace inside this existing project (clones project files and mounts its volumes).workspace_id(str | None, optional): Attach to this existing code-session-enabled workspace instead of creating a new one.
retrieve
retrieve(session_id: str) -> CodeSession
Retrieve the state of a code session.
delete
delete(session_id: str) -> None
Terminate and delete a code session. Raises on failure; returns nothing.
Lifecycle & actions
deploy
deploy(session_id: str) -> App
Build the session's workspace as a new app; returns the app, building.
The platform deploys it when its build completes (follow it with
client.apps.retrieve).
Other
output
output(session_id: str, **params) -> CodeSessionOutput
Poll buffered stdout/stderr from the session.
send_input
send_input(session_id: str, *, text: str) -> CodeSession
Send text input to the session's terminal (PTY); returns the session.
Read what the terminal printed with output.
start_login
start_login(session_id: str) -> dict[str, Any]
Start logging the session's Claude Code in with your own Claude account.
Parameters
session_id(str): The code session's ID.
Returns
dict[str, Any]: The login:state,auth_urlandmessage.stateisurl(openauth_urland sign in, then pass the code it shows tosubmit_login_code),authenticated(already logged in),pending(the URL has not printed yet: call again shortly),starting(the workspace is still starting) orterminal(a Codex session, whose login runs in its terminal).
status
status(session_id: str) -> dict[str, Any]
Get a code session's lifecycle status.
Parameters
session_id(str): The code session's ID.
submit_login_code
submit_login_code(session_id: str, *, code: str) -> CodeSession
Finish the Claude Code login with the code the sign-in page showed.
Parameters
session_id(str): The code session's ID.code(str): The authorization code from the sign-in page.