Harness Notes

Environment detection

Updated 2026-11-22,

On this page

How a script, hook or CLI can tell it was started by each harness, and which session started it. Children inherit these variables, so treat them as hints that an agent is involved, not as proof that no person is watching.

Detecting the harness

QuestionCursor Agentchecked at 2026.10.12-d47ca18
The variable to check

CURSOR_AGENT. Cursor suggests checking it in ~/.zshrc or ~/.bashrc to skip heavy prompts and themes; the CLI sets it to 1.

Which processes get it

Partly

Commands the agent runs in its terminal. Hooks and MCP servers aren't documented.

Which session started the command

Partly

Undocumented, but agent commands in 2026.10.12 get CURSOR_CONVERSATION_ID, CURSOR_REQUEST_ID and AGENT_TRANSCRIPTS (the project's transcript folder).

Relying on it

QuestionCursor Agentchecked at 2026.10.12-d47ca18
Telling the agent's commands from yours

Not documented

Not documented. Cursor doesn't say whether a person's own terminal in the editor also gets CURSOR_AGENT.

Signs that nobody will answer a prompt

Not documented

Not documented. Cursor doesn't say whether agent commands get a dumb terminal, pager overrides or a CI flag.

Removing or overriding it

Not documented

Not documented. Cursor doesn't say whether CURSOR_AGENT can be removed or changed.

Notes and sources

Cursor Agent, 2 sources
The variable to check, 2
Which processes get it, 2
Which session started the command, 2
Telling the agent's commands from yours, 1
Signs that nobody will answer a prompt, 1
Removing or overriding it, 1