agentify context

Bounded retrieval against the repo index.

Four subcommands: search, fetch, compact, status. Dispatched at src/main.js:637; implemented in src/core/context.js and src/core/session-memory.js.

read .agentify/index.db compact requires --session all support --json

Each subcommand reads or shapes the indexed graph.

search

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.

agentify context search analytics --json
fetch

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 fetchContext
compact

context 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.

agentify context compact --session <id>
status

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.

agentify context status --session <id>

Operational notes.

prereq

All subcommands require .agentify/index.db. Run agentify up first if missing or stale.

compact

Compact uses the session-memory backend. Without a configured memory provider it no-ops or errors per compactSessionContext guards.

fetch precedence

If both --lines and --symbol are passed, the symbol resolution wins and the line range is ignored.

json output

Every subcommand supports --json for machine-readable output. The shape mirrors the function's return value.