steer

Context

One command that answers "where am I, what is this project, what can I use?"

Serious skills start with a hand-rolled "Step 0: figure out the situation": git probes, marker-file checks, command -v ladders, per-host branching ("If on Claude Code… if on claude.ai…"). Across the skills we analyzed it was the single most duplicated piece of code; some skills vendor the same detection shim in three separate places.

steer context is that preamble as one command.

When to use it

  • The skill behaves differently by platform, project type, available tools, or host agent: any body with a "first, check whether..." step.
  • The repo-health example ships it as step 0; the snapshot tells the agent up front whether it is even in a git repository, which the report then handles instead of discovering mid-run.
  • Skip it when the skill does the same thing everywhere. A pure text transform has nothing to probe.

CLI

steer context                          # markdown, for the agent to read
steer context --json                   # for scripts
steer context --only git,project       # subset of sections
steer context --tools terraform,helm   # probe extra binaries
steer context --workspace ~/work/acme  # inspect another directory
## Context snapshot
- **System**: Darwin arm64, Python 3.13.5, cwd `/Users/jane/work/acme`
- **Host agent**: claude-code (non-interactive)
- **Git**: branch `main`, 3 dirty files (1 untracked)
  - `a1b2c3d fix flaky retry test`
- **Project**: node, python
  - package managers: pnpm, uv
  - also present: docker, github-actions
- **Tools on PATH**: git, gh, docker, node, pnpm, python3, uv, jq, rg
  - missing: cargo, go, kubectl, terraform
- **Env**: TERM=xterm-256color, LANG=en_US.UTF-8

Sections

SectionContents
systemOS, arch, Python version, cwd
agentHost agent detection (Claude Code, Codex, Cursor, Gemini CLI, …) via env markers; CI flag; TTY flag
gitIn a repo? branch, dirty/untracked counts, last 3 commits, remotes, linked-worktree detection
projectTypes from manifests (node/python/rust/go/…), package managers from lockfiles, extras (docker, CI, Makefile, SKILL.md)
toolsWhich of ~20 common binaries exist on PATH (+ any you ask for)
envA small allowlist (CI, TERM, LANG, SHELL, VIRTUAL_ENV, NODE_ENV); steer never dumps the environment

Python

from steer.context import gather, to_markdown

snapshot = gather(workspace=".", only=["git", "project"])
if "uv" not in gather(only=["tools"])["tools"]["available"]:
    ...
print(to_markdown(snapshot))

In a SKILL.md

steer new --with context generates:

1. **Ground yourself.** Run `python3 scripts/steer.py context` and read
   the snapshot before doing anything else; it tells you the platform,
   project type, git state, and which tools exist here.

The command runs through the skill's bundled runtime, so it works on machines that never installed steer.

In Claude Code you can go further and inject it before the model even reads the skill body, with dynamic context injection:

!`steer context`

Injection runs before the skill body loads, from the project directory, so this one spelling does need steer on the PATH; the bundled spelling inside the body has no such requirement.

On this page