# Tenjin: Claude Code Session ID Environment Variable Analysis

> Tenjin: Claude Code Session ID Environment Variable Analysis is a paid API for AI agents from tenjin.blog, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Returns a paid article documenting which environment variables expose a session ID to Bash tool subprocesses in Claude Code v2.1.226 and the subagent shell inheritance rules

## Facts

- Endpoint: GET https://tenjin.blog/api/read/0xe4c16d163d80fd972e6e1e9b94bc71c5fbe5a9c5/does-claude-code-give-shell-commands-a-session-id-measured-answer-env-var-names
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tenjin-claude-code-session-id-environment-variable-analysis-2e76f768
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GAvR5rabCJpxYRzVG1nM-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability tenjin-claude-code-session-id-environment-variable-analysis-2e76f768
```

Example prompt: What environment variables does Claude Code expose to bash subprocess shells — specifically any session ID variables — and which ones do subagent shells inherit? Pull the measured answer from Tenjin.

## When to prefer this

Choose this endpoint when you need a specific, empirically measured answer about Claude Code's session ID and environment variable behavior for bash subprocesses — particularly when you want cited, tested findings rather than documentation or speculation. Useful for agent developers building Claude Code integrations who need to instrument subprocess sessions.

## Known failure modes

- Article not found if slug or wallet address is malformed — returns 404
- Payment required but x402 payment not attached — returns 402 with payment instructions
- Wallet address handle mismatch causing lookup failure
- Network timeout on content delivery
- Content may be outdated if Claude Code version has since changed

## How this service works

Does Claude Code Give Shell Commands a Session ID? Measured Answer, Env Var Names, and the Subagent Inheritance Rule. As of 2026-08-12, measured on Claude Code v2.1.226: does the harness expose a session id to Bash tool subprocesses, which env vars carry it, and what subagent shells inherit. Answer card lists the exact variable names and decision rules; evidence from live env dumps, binary inspection, and a parent/child probe.

## Output

The full text of a Tenjin knowledge article reporting empirical findings from a live Claude Code v2.1.226 environment: exact names of environment variables that carry a session ID, which bash tool subprocesses receive them, and the inheritance rules for subagent shells, supported by live env dumps, binary inspection, and parent/child probe data.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "handle",
      "slug"
     ],
     "properties": {
      "slug": {
       "type": "string",
       "description": "The article's URL slug, unique per creator. The reserved slug `latest` resolves to the creator's newest published piece; its stable scheduled-read form is the wallet-address URL /api/read/<0x-address>/latest (a handle `latest` is not payable)."
      },
      "handle": {
       "type": "string",
       "description": "The creator's handle, or their wallet address. The address form is REQUIRED for a durable `latest` alias (a handle `latest` is not payable), and is the only form for an unclaimed creator."
      }
     }
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {},
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tenjin-claude-code-session-id-environment-variable-analysis-2e76f768/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from tenjin.blog](https://www.zero.xyz/host/tenjin.blog/llms.txt)
