Context
qp context builds bounded repository briefings for humans and agents. It is designed to produce useful context without dumping the entire repo.
Modes
Default mode
qp contextIncludes project/task/guard metadata plus selected repo context configured in context:.
Agent mode
qp context --agent --task checkAgent mode adds task-scoped file targeting, codemap details, and last-guard context. --task is required with --agent.
Topic mode
qp context --about "transport protocol"Topic mode surfaces matching tasks, scopes, codemap entries, glossary terms, and relevant paths.
JSON mode
qp context --json --about "release safety"Returns sections + rendered markdown in one structured payload.
Output Controls
qp context --out .qp/context.md
qp context --copy
qp context --max-tokens 2500--out: write markdown to file--copy: copy markdown to clipboard--max-tokens: rough truncation budget for handoffs
Example: Agent Handoff
qp context --agent --task check --max-tokens 3000 --out .qp/agent-context.mdResulting brief typically includes:
- Project summary
- Agent task details and scoped files
- File tree snapshot
- Task + guard map
- codemap excerpts
- last guard status
- current git diff summary
Context Configuration
Tune output through top-level context::
context:
file_tree: true
git_log_lines: 12
git_diff: true
todos: true
dependencies: true
files:
- README.md
- docs/user-guide.md
agent_files:
- AGENTS.md
- CLAUDE.md
include:
- cmd/**/*
- internal/**/*
exclude:
- vendor/**
- .git/**
caps:
file_tree_entries: 200
files_max: 6
file_lines: 120
git_log_lines: 30
git_diff_lines: 250
todos_max: 25
agent_file_lines: 600
dependency_lines: 150Practical Usage Patterns
- Generate topic context before planning:
qp context --about "<topic>". - Generate task-scoped agent context before edits:
qp context --agent --task <task>. - Persist context artifacts in CI for debugging.
- Use
--jsonwhen another tool needs deterministic structure.
Next Step
For semantic repository metadata used by context and explain flows, continue to Codemap.