Skip to content

docs(claude): add project-level CLAUDE.md cognitive anchor#56

Open
juice094 wants to merge 7 commits into
mainfrom
docs/claude-cognitive-anchor
Open

docs(claude): add project-level CLAUDE.md cognitive anchor#56
juice094 wants to merge 7 commits into
mainfrom
docs/claude-cognitive-anchor

Conversation

@juice094
Copy link
Copy Markdown
Owner

Summary

Create .claude/CLAUDE.md as an anti-amnesia anchor for AI long-range work.

Problem

Context compression in multi-turn AI sessions causes systematic information loss:

  • Handoff documents describe "what was done this round" but lack "cumulative project state"
  • No cross-document fact validation between KNOWN_ISSUES, handoffs, and NEXT_STEPS
  • AI sessions after compression lose early context and treat handoff as complete truth

Solution

A small, structured anchor file at .claude/CLAUDE.md containing:

  1. Immutable Facts — Version, test count, tool count, schema version, etc.
  2. Architecture Guardrails — RF-1 through RF-7 for quick reference
  3. Current Context — Phase, active work, next phase
  4. Known Architecture Gaps — Distinguishing "not yet implemented" from "broken"
  5. Anti-Amnesia Checklist — Mandatory checks for every new session
  6. Quick Reference — Common commands and key file mappings

Design Principles

  • Survives compression: File is < 5KB, guaranteed to stay in context window
  • Single source of truth: If handoff contradicts this file, this file wins
  • Structured but readable: Tables for facts, checklists for verification

🤖 Generated with Claude Code

juice094 and others added 7 commits May 18, 2026 13:48
Create `.claude/CLAUDE.md` as an anti-amnesia anchor for AI sessions.
This file is designed to survive context compression and contains:

- Immutable Facts table (version, tests, tools, schema, etc.)
- Architecture Guardrails (RF-1 through RF-7)
- Current Context (phase, gaps, active work)
- Known Architecture Gaps (distinguishing "not yet implemented" from "broken")
- Anti-amnesia Checklist for session startup
- Quick Reference commands and key file mappings

This addresses the systematic information loss problem identified in
context-compressed AI long-range work.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
project_context previously returned repo metadata, relations, and workflows
but omitted two high-signal fields: unmitigated known limits (risk layer) and
available skills. This meant AI callers had to make separate tool calls to
assess project health or discover capabilities.

- Add known_limits: top 20 unmitigated entries from L3 risk layer
- Add skills: top 20 registered skills with type/tags
- Update stale tool-count comment: 37 → 68
- Refresh CLAUDE.md gap tracker to reflect completed items

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Stable tier requires "unit-tested" per architecture guardrails.
query_repos, vault_search, and vault_read previously lacked
dedicated JSON-RPC-level tests, relying only on indirect scenario
coverage. This commit adds independent tests for each.

- test_tools_call_devkit_query_repos: empty registry + seeded repo
- test_tools_call_devkit_vault_search: keyword search with scan
- test_tools_call_devkit_vault_read: existing note + not-found error
- seed_repo() helper for lightweight entity insertion

Total tests: 485 → 488 (3 new)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
mcp-tools.md was severely outdated:
- Tool count said 40, actual is 68
- 4 tools mislabeled Experimental→Beta (code_metrics, module_graph, call_graph, dead_code)
- 3 tools mislabeled Stable→Beta (hybrid_search, project_brief)
- 1 tool mislabeled Stable→Experimental (session_recall)
- Missing categories: Index (3), Workflow (3), Relation (3), KnownLimit (2)
- Missing Vault tools: daily, graph, export, history
- Missing Session tools: 12 of 13 not listed

stable-tools/README.md also listed Beta/Experimental tools as Stable.
Deleted incorrect docs (project_brief.md, hybrid_search.md, session_recall.md)
and updated README to reflect the actual 5 Stable tools with test coverage.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Centralized record of known issues, test coverage gaps, and
architectural debt. Includes 28 tools lacking invocation tests,
repo.rs 730-line remainder, vault search linear scan performance,
and missing document_convert tool. Resolved items archived with
version/commit references.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add JSON-RPC-level tests for high-frequency Beta tools:
- devkit_status: empty registry returns "fresh" overall
- devkit_workflow_list: empty registry returns count=0
- devkit_index: empty registry returns indexed=0

These tools are called frequently in real-world usage but previously
lacked dedicated test coverage, relying only on indirect exercise.

Total tests: 488 → 491 (3 new)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add Experimental-tier PDF/PPTX → Markdown conversion tool
(pdftotext / python-pptx pipeline). Includes:
- devkit_document_convert implementation with quality heuristics
- Registration in McpToolEnum (69 tools total)
- JSON-RPC invocation tests for 6 key tools (query_repos, vault_search,
  vault_read, status, workflow_list, index) plus document_convert error path
- README/AGENTS/CHANGELOG/KNOWN_ISSUES/mcp-tools.md/CLAUDE.md updates
- Cargo fmt pass

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant