Skip to content

Platform & CI Detection

  • Type: Boolean (set by GitHub Actions)
  • Default: Unspecified (detected automatically)
  • Description: Detected when running in GitHub Actions CI. Set automatically by GitHub Actions runner.
  • Example: Automatically set by CI platform
  • Type: Boolean (1, true, 0, false)
  • Default: false
  • Description: Indicates running as a GitHub Action. Sets entrypoint to claude-code-github-action.
  • Example: export CLAUDE_CODE_ACTION=1
  • Type: String (GitHub username)
  • Default: Unspecified
  • Description: GitHub username that triggered the workflow.
  • Example: octocat
  • Type: String (GitHub user ID)
  • Default: Unspecified
  • Description: GitHub user ID that triggered the workflow.
  • Example: 1234567
  • Type: String (owner/repo)
  • Default: Unspecified
  • Description: GitHub repository in owner/repo format.
  • Example: anthropics/claude-code
  • Type: String (owner)
  • Default: Unspecified
  • Description: GitHub repository owner.
  • Example: anthropics
  • Type: String (owner ID)
  • Default: Unspecified
  • Description: GitHub repository owner numeric ID.
  • Example: 123456
  • Type: String (repo ID)
  • Default: Unspecified
  • Description: GitHub repository numeric ID.
  • Example: 789012
  • Type: String (event name)
  • Default: Unspecified
  • Description: Name of the GitHub event that triggered the workflow (e.g., push, pull_request, issues).
  • Example: push
  • Type: String (file path to JSON)
  • Default: Unspecified
  • Description: Path to GitHub Actions event payload JSON. Contains detailed event information.
  • Example: /github/workflow/event.json
  • Type: String (authentication token)
  • Default: Set automatically by GitHub Actions
  • Description: GitHub authentication token with permissions for the workflow. Used for API calls within the action.
  • Example: ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Security: Automatically scoped and short-lived; safe to use in workflows.
  • Type: String (file path)
  • Default: Set by GitHub Actions
  • Description: Path to GitHub Actions environment file. Write to this file to set env vars for subsequent steps.
  • Example: /github/env
  • Type: String (file path)
  • Default: Set by GitHub Actions
  • Description: Path to GitHub Actions PATH file. Append to this file to add directories to PATH.
  • Example: /github/path
  • Type: String (file path)
  • Default: Set by GitHub Actions
  • Description: Path to GitHub Actions output file. Write key=value to this file for step outputs.
  • Example: /github/output
  • Type: String (file path)
  • Default: Set by GitHub Actions
  • Description: Path to GitHub Actions state file. Persists state across workflow steps.
  • Example: /github/state
  • Type: String (file path)
  • Default: Set by GitHub Actions
  • Description: Path to GitHub Actions step summary file. Markdown appended here appears in workflow summary.
  • Example: /github/step-summary
  • Type: String (JSON object)
  • Default: Unspecified
  • Description: JSON-encoded inputs for GitHub Action. Contains action input parameters.
  • Example: {"key":"value"}
  • Type: String (directory path)
  • Default: Set by GitHub Actions
  • Description: Path to the GitHub Action directory. Location where action code is checked out.
  • Example: /github/actions/claude-code@v1
  • Type: Boolean (set by CircleCI)
  • Default: Unspecified
  • Description: Detected when running in CircleCI. Set automatically.
  • Example: Automatically set by CI platform
  • Type: Boolean (set by Buildkite)
  • Default: Unspecified
  • Description: Detected when running in Buildkite CI. Set automatically.
  • Example: Automatically set by CI platform
  • Type: Boolean (set by GitLab CI)
  • Default: Unspecified
  • Description: Detected when running in GitLab CI. Set automatically.
  • Example: Automatically set by CI platform
  • Type: String (OS name)
  • Default: Unspecified
  • Description: CI runner operating system (e.g., Linux, macOS, Windows).
  • Example: Linux
  • Type: String (environment identifier)
  • Default: Unspecified
  • Description: CI runner environment identifier.
  • Example: github-hosted
  • Type: String (git ref)
  • Default: Auto-detected (typically main or master)
  • Description: Override the base git ref for diff operations. Falls back to auto-detected default branch.
  • Example: export CLAUDE_CODE_BASE_REF=develop
  • Type: Boolean (1, true, 0, false)
  • Default: false
  • Description: Enable Perforce source control mode. Affects file permission/lock handling for Perforce repos.
  • Example: export CLAUDE_CODE_PERFORCE_MODE=1
  • Type: Boolean (1, true, 0, false)
  • Default: false
  • Description: Skip saving prompts to history. Useful for automated/scripted runs.
  • Example: export CLAUDE_CODE_SKIP_PROMPT_HISTORY=1
  • Type: String (Perforce server address)
  • Default: Unspecified
  • Description: Perforce server port. Used when CLAUDE_CODE_PERFORCE_MODE is enabled.
  • Example: export P4PORT=perforce.company.com:1666

← Back to env/README.md