Each subcommand reads or shapes the indexed graph.
context search <term>
Dispatch: src/main.js:637 · searchContext(root, term).
Flags: --term <value> (or positional arg 2), --root, --json.
Reads: .agentify/index.db semantic and structural indexes.
context fetch <path>
Dispatch: src/main.js:640 · fetchContext(root, target, { lines, symbol }).
Flags: --file <path> / --path <path> (or positional arg 2), --lines <start:end>, --symbol <name>, --root, --json.
Returns a slice of the file (line range) or the symbol definition with neighbors from the index.
agentify context fetch src/app.ts --symbol fetchContextcontext compact
Dispatch: src/main.js:649 · compactSessionContext(root, sessionId, config) in src/core/session-memory.js.
Flags: --session <id> (required), --root, --json.
Writes: context-facts.json and context-facts.md inside the session directory.
context status
Dispatch: src/main.js:654.
Flags: --session <id> (required), --root, --json.
Returns context_bytes, run_history_count, has_context_facts, prepared_child_session.
Operational notes.
All subcommands require .agentify/index.db. Run agentify up first if missing or stale.
Compact uses the session-memory backend. Without a configured memory provider it no-ops or errors per compactSessionContext guards.
If both --lines and --symbol are passed, the symbol resolution wins and the line range is ignored.
Every subcommand supports --json for machine-readable output. The shape mirrors the function's return value.