Command Reference
Every codefidence command organized by category. Run
codefidence --help
for the full list or
codefidence <command> --help
for details on any specific command.
Read
Commands that retrieve and surface knowledge from the wiki.
context
Surface relevant memory items for a given file or directory. This is the command you run (or that hooks run for you) before editing code.
$ codefidence context src/billing/checkout.ts
📋 billing-001 [exception] (confirmed)
Never call processPayment twice for the same order
📋 billing-003 [business_rule] (verified)
Free-tier users cannot exceed $0 in charges context --hook
Same as context but optimized for Claude Code PreToolUse hooks. Outputs structured JSON.
search
Full-text search across all memory items and domain notes.
$ codefidence search "idempotent"
Found 2 results:
billing-001: Never call processPayment twice...
api-005: All POST endpoints must be idempotent... Write
Commands that add or modify memory items.
add
Add a new memory item to a domain interactively or with flags.
confirm
Upgrade a memory item's confidence to confirmed.
Use this after a team member has manually validated the item.
$ codefidence confirm billing-001
✔ billing-001 confidence updated: seen-in-code → confirmed deprecate
Mark a memory item as deprecated. The item stays in the file for history but is no longer surfaced.
Analyze
Commands that compare the wiki against the actual code.
check-diff
Compare your current git diff against the wiki and flag any memory items that might be affected by your changes. Run this before committing.
$ codefidence check-diff
⚠ billing-001 may be affected by changes in src/billing/checkout.ts:45
"Never call processPayment twice for the same order"
→ You modified the payment flow. Verify this exception still holds.
✔ No other conflicts detected. detect-drift
Detect when code changes have drifted away from what the wiki describes. Used by the PostToolUse hook.
validate
Check all active memory items against the current codebase. Reports stale, broken, or inconsistent items.
Maintain
Commands for wiki hygiene and lifecycle management.
Candidates
Commands for working with auto-generated candidate items.
generate-candidates
Analyze the codebase and generate candidate memory items. Writes to
_candidates.md.
promote
Promote a candidate into a real memory item in its target domain.
$ codefidence promote candidate-3
✔ Promoted "Stripe webhook signature validation" to auth domain reject
Reject a candidate that is not relevant or accurate.
Hooks
Commands for managing Claude Code integration hooks.
init
Initialize the wiki directory. Use with flags:
--scan— Scan the project and discover domains--hooks— Install Claude Code hooks--full— All of the above plus CLAUDE.md patching and slash commands
uninstall-hooks
Remove all Claude Code hooks and undo CLAUDE.md patches. Leaves the wiki data intact.