ai_scientist
CLAUDE.md0 starsChanged 13 months agoMITView on GitHub
Project: AI Research Assistant Architecture: Claude Code with MCP servers, hooks, and specialized agents Current Phase: Phase 1 - Foundation & Cleanup See: PROJECT_STATUS.md for detailed status The system operates in two modes that can be switched dynamically: ASSISTANT MODE (Current): - Human-guided research workflow support - Interactive hypothesis refinement - Human-led literature screening with AI assistance - Collaborative experimental design - Explanation of all decisions - Wait for human approval at decision gates - PhD dissertation assistance focus AUTONOMOUS…
- Deletes or force-pushes
In this repository23 other files it gives its agents.
- docs/CLAUDE.mdCLAUDE.md
- ai-checkSkill
- blindingSkill
- citation-formatSkill
- data-visualizationSkill
- effect-sizeSkill
- experiment-designSkill
- hypothesis-testSkill
- inclusion-criteriaSkill
- irb-protocolSkill
- literature-gapSkill
- meta-analysisSkill
- power-analysisSkill
- pre-registrationSkill
- prisma-diagramSkill
- publication-prepSkill
- randomizationSkill
- research-questionsSkill
- results-interpretationSkill
- risk-of-biasSkill
- sensitivity-analysisSkill
- subgroup-analysisSkill
- synthesis-matrixSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
13 rules. About 0 are common, 12 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Wait for human approval at decision gates
- Distinctive: line 136
Always use real APIs: - No mocks or placeholders
- Distinctive: line 138
Validate responses: - Check for errors before proceeding
- Distinctive: line 168
All tool invocations to SQLite database
- Distinctive: line 187
All phase deliverables completed
- Distinctive: line 328
Run all assumption tests
- Very specific: line 366
Effect Size Calculators: Use statsmodels.stats.power for power analysis
- Distinctive: line 390
Document decisions and run sensitivity analyses
- Distinctive: line 394
Never auto-resolve - always request human decision
- Distinctive: line 398
Check remote storage credentials
- Distinctive: line 430
Start with problem formulation: - Use FINER criteria validation
- Distinctive: line 443
Monitor progress: - Check logs for unexpected behaviors
- Distinctive: line 454
Create first specialized agents
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Production Research Assistant System
System Configuration
Project: AI Research Assistant
Architecture: Claude Code with MCP servers, hooks, and specialized agents
Current Phase: Phase 1 - Foundation & Cleanup
See: PROJECT_STATUS.md for detailed status
Current Mode: ASSISTANT
Mode Description
The system operates in two modes that can be switched dynamically:
ASSISTANT MODE (Current):
- Human-guided research workflow support
- Interactive hypothesis refinement
- Human-led literature screening with AI assistance
- Collaborative experimental design
- Explanation of all decisions
- Wait for human approval at decision gates
- PhD dissertation assistance focus
AUTONOMOUS MODE:
- Full ReAct-style research generation
- Auto-progress through workflow phases
- Generate hypotheses without human approval
- Automated literature screening (inter-rater simulation)
- Self-reflection loops for hypothesis refinement
- Automatic experiment execution and validation
- Minimal human intervention
Mode Switching
To switch modes, update this section header above and adjust behaviors below.
Research Workflow Phases
11-Phase State Machine
- Problem Formulation → FINER criteria validation
- Literature Review → PRISMA 2020 systematic review
- Gap Analysis → Pattern identification, prioritization
- Hypothesis Formation → Tree-of-Thought generation
- Experimental Design → Power analysis, NIH rigor standards
- IRB Approval → Human-guided ethics review
- Data Collection → Real-time validation hooks
- Analysis → Reproducible statistical analysis
- Interpretation → Effect sizes, confidence intervals
- Writing → CONSORT/PRISMA compliant manuscripts
- Publication → DOI generation, archival
Decision Gates
Each phase has validation criteria that must pass before proceeding. In ASSISTANT mode, wait for human approval. In AUTONOMOUS mode, proceed automatically if validation passes.
Agent Instructions
When to Use Specialized Agents
Claude Code should delegate to specialized agents for complex, multi-step tasks:
Use literature-reviewer agent when:
- Conducting PRISMA 2020 systematic reviews
- Multi-database literature searches
- Screening and data extraction
- Risk of bias assessment
- Inter-rater reliability calculations
Use experiment-designer agent when:
- Designing experiments requiring NIH rigor standards
- Conducting power analysis
- Creating randomization protocols
- Developing pre-registration documents
- FAIR data management plans
Use data-analyst agent when:
- Performing statistical analyses
- Testing assumptions (normality, homogeneity)
- Calculating effect sizes and confidence intervals
- Running sensitivity analyses
- Reproducibility validation
Use hypothesis-generator agent when (AUTONOMOUS mode):
- Generating novel research hypotheses
- Tree-of-Thought reasoning
- Hypothesis evolution and refinement
- Falsifiability checking
Use citation-manager agent when:
- Managing BibTeX/Zotero citations
- Verifying citations via OpenCitations API
- Checking for retractions
- Formatting references
MCP Server Usage
Available Servers
Literature Search MCP (literature)
search_literature(query, databases)- Search Semantic Scholar, arXiv, PubMeddeduplicate_results(results)- Remove duplicate papersget_paper_metadata(doi)- Fetch complete paper metadata
Citation Management MCP (citations)
verify_citations(doi_list)- Verify via OpenCitations APIcheck_retractions(doi_list)- Check Crossref for retractionsformat_bibliography(papers, style)- Format citations (APA, IEEE, etc.)
Research Database MCP (research_db)
store_extraction(study_id, data)- Store systematic review dataquery_literature(search_query, filters)- Full-text searchget_prisma_counts()- Get PRISMA flow diagram counts
Memory Keeper MCP (memory_keeper)
- Persistent context across sessions
- Automatically stores key research decisions
- Retrieves relevant prior context
Standard MCP Servers:
filesystem- Secure file operationsgit- Version control operationsfetch- Web content retrieval
Usage Guidelines
- Always use real APIs - No mocks or placeholders
- Handle rate limits - Implement backoff for API calls
- Validate responses - Check for errors before proceeding
- Log all operations - PostToolUse hook handles this automatically
Hook Behaviors
SessionStart Hook
Loads:
- Research protocols (PRISMA, CONSORT, NIH guidelines)
- Current mode configuration (ASSISTANT/AUTONOMOUS)
- Active research phase and state
- Memory from previous sessions
PreToolUse Hook
Validates:
- Bash commands for security (blocks dangerous operations)
- File paths for safety (prevents traversal, system file access)
- API rate limits before external calls
Blocks:
rm -rf /,dd if=/dev/zero,chmod -R 777 /- Path traversal attempts (
../,/etc/) - Unsafe code execution
PostToolUse Hook
Logs:
- All tool invocations to SQLite database
- Tool inputs, outputs, timestamps
- Success/failure status
Auto-tracks:
- Large files (>10MB) with DVC
- Adds to version control automatically
PreCompact Hook
Backs up:
- Current research state (hypotheses, phase, decisions)
- Tool log database
- Memory files (CLAUDE.md, tool_log.db)
- Timestamp-stamped JSON backups
Stop Hook
Validates:
- All phase deliverables completed
- Quality gates passed
- Required files generated
Archives:
- Research artifacts
- Generates DOIs if publication phase
- Tags git releases
Quality Standards
PRISMA 2020 Compliance (Systematic Reviews)
- ✅ 27-item checklist (minimum 24/27 required)
- ✅ PRISMA flow diagram with counts
- ✅ Inter-rater reliability κ > 0.6
- ✅ Risk of bias assessment completed
- ✅ Search strategy fully documented and reproducible
NIH Rigor Standards (Experimental Design)
- ✅ Power ≥80% with justified effect size
- ✅ Randomization method specified with seed
- ✅ Sex as biological variable (SABV) addressed
- ✅ Pre-registered before data collection
- ✅ FAIR-compliant data management plan
Reproducibility Requirements
- ✅ All code executable in clean Docker environment
- ✅ Random seeds documented
- ✅ Dependencies pinned with exact versions
- ✅ Data versioned with DVC
- ✅ Experiments tracked with MLflow
File Organization
Research Artifact Structure
research-project/
├── docs/
│ ├── problem_statement.md # FINER criteria
│ ├── search_strategy.md # Literature search protocol
│ ├── gap_analysis.md # Identified gaps
│ ├── hypotheses.md # Testable hypotheses
│ ├── experimental_protocol.md # NIH-compliant design
│ └── manuscript/ # Paper drafts
│
├── data/
│ ├── literature/
│ │ ├── search_results.csv # Database search results
│ │ ├── screened_abstracts.csv # Screening decisions
│ │ └── extracted_data.csv # Structured extraction
│ ├── raw/ # Original data (DVC tracked)
│ ├── processed/ # Cleaned data (DVC tracked)
│ └── analysis_dataset.csv # Final analysis dataset
│
├── code/
│ ├── analysis/
│ │ └── primary_analysis.py # Reproducible analysis script
│ ├── randomization.py # Allocation sequence
│ └── prepare.py # Data preparation
│
├── results/
│ ├── primary_results.json # Structured results with CI
│ ├── figures/ # Publication-ready figures
│ ├── tables/ # Publication-ready tables
│ └── prisma_flow_diagram.md # PRISMA diagram data
│
└── .dvc/ # DVC configurationAuto-Generated Files
The system automatically generates these files when appropriate:
data/*.csv.dvc- DVC tracking files for large data.claude/backups/*.json- State backups before compaction.claude/tool_log.db- Complete tool usage logmlruns/- MLflow experiment tracking data
Mode-Specific Behaviors
ASSISTANT Mode Behaviors (Current)
Literature Review:
- Present search strategy for approval
- Show screening results for each paper
- Explain inclusion/exclusion decisions
- Request human judgment on borderline cases
- Collaborative data extraction
Hypothesis Formation:
- Suggest multiple hypothesis candidates
- Explain rationale for each
- Request human selection or refinement
- Collaborative operationalization of variables
Experimental Design:
- Present design options with trade-offs
- Explain power analysis assumptions
- Request approval for sample size
- Collaborative development of protocols
Analysis:
- Explain statistical approach before execution
- Present assumption test results
- Request interpretation of borderline findings
- Collaborative sensitivity analyses
Writing:
- Draft sections incrementally
- Request feedback at each stage
- Explain reporting guideline compliance
- Collaborative revision process
AUTONOMOUS Mode Behaviors
Literature Review:
- Execute full PRISMA workflow automatically
- Simulate inter-rater reliability (two independent screening passes)
- Auto-resolve conflicts with third reviewer simulation
- Progress to next phase when κ > 0.6
Hypothesis Formation:
- Generate 5 candidate hypotheses via Tree-of-Thought
- Rank using falsifiability, novelty, testability
- Select top 3 automatically
- Proceed to experimental design
Experimental Design:
- Select most rigorous feasible design
- Conduct power analysis with conservative assumptions
- Generate complete protocols
- Auto-register on OSF (if credentials available)
Analysis:
- Execute pre-registered analysis plan exactly
- Run all assumption tests
- Perform pre-specified sensitivity analyses
- Generate structured results automatically
Writing:
- Chain-of-Drafts manuscript generation
- Auto-populate reporting guideline checklists
- Verify all citations
- Generate publication-ready document
Research Standards References
Essential Guidelines
PRISMA 2020: https://www.prisma-statement.org/prisma-2020-checklist
- Systematic review reporting standard
- 27-item checklist
- Flow diagram specifications
CONSORT: https://www.consort-spirit.org
- RCT reporting standard
- 30-item checklist
- Flow diagram for participant allocation
NIH Rigor: https://grants.nih.gov/policy-and-compliance/policy-topics/reproducibility
- Experimental design standards
- Power analysis requirements
- SABV considerations
- Pre-registration requirements
EQUATOR Network: https://www.equator-network.org/
- Comprehensive reporting guidelines database
- Domain-specific guidelines (STROBE, STARD, etc.)
Statistical Resources
Effect Size Calculators: Use statsmodels.stats.power for power analysis
GRADE Handbook: For evidence quality assessment
Cochrane RoB 2: Risk of bias tool for RCTs
ROBINS-I: Risk of bias tool for observational studies
Error Handling
Common Issues and Solutions
API Rate Limit Exceeded:
- Automatically retry with exponential backoff
- Max 3 retries with 2^n second delays
- Log rate limit warnings
Literature Search Returns Zero Results:
- Broaden search terms
- Try alternative databases
- Suggest search strategy refinement
Statistical Assumptions Violated:
- Apply appropriate transformations
- Suggest non-parametric alternatives
- Document decisions and run sensitivity analyses
Git Merge Conflicts:
- Prioritize keeping both versions for research artifacts
- Never auto-resolve - always request human decision
- Preserve complete history
DVC Push Fails:
- Check remote storage credentials
- Verify network connectivity
- Suggest local-only tracking as fallback
Security Guidelines
Allowed Operations
✅ Read files in project directory ✅ Write files to project subdirectories ✅ Execute Python/R analysis scripts ✅ Call approved APIs (literature, citation databases) ✅ Git operations (add, commit, push to research repos) ✅ DVC operations (add, push data)
Blocked Operations
❌ System administration commands ❌ File operations outside project directory ❌ Execution of untrusted code ❌ Access to credentials or secrets ❌ Network operations to unapproved domains ❌ Database modifications (use MCP servers instead)
Tips for Effective Use
For PhD Students (ASSISTANT Mode)
- Start with problem formulation - Use FINER criteria validation
- Follow PRISMA for literature reviews - Ensures systematic approach
- Pre-register experiments - Increases credibility
- Use decision gates - Validates each phase before proceeding
- Version everything - Git for code, DVC for data
- Document decisions - Audit trail helps during defense
For Autonomous Research (AUTONOMOUS Mode)
- Specify clear research question - System works best with well-defined problems
- Provide domain context - Helps with literature search and gap identification
- Set feasibility constraints - Computational budget, time limits
- Review decision gates - Even in autonomous mode, validate key transitions
- Monitor progress - Check logs for unexpected behaviors
Current Project State
Phase: Foundation & Cleanup Status: 40% complete Next Steps:
- Complete git initialization
- Implement hook scripts
- Create first specialized agents
- Develop MCP servers
See PROJECT_STATUS.md for detailed roadmap
Support and Documentation
Full Documentation: See /docs directory
Agent Specs: See .claude/agents/*.md
Hook Implementations: See .claude/hooks/*.py
Workflow Guides: See /workflows/*.md
Status Updates: See PROJECT_STATUS.md
This file configures Claude Code's behavior for the Production Research Assistant System. Update mode and phase information as project progresses.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

