Autosearch
CLAUDE.md49 starsChanged 8 months agoMITView on GitHub
Behavioral rules for AI agents and human contributors working in this codebase. A self-improving search system. The human provides intent. The AI does everything else: understand the goal, generate strategies, run them across all platforms, score results, reflect, iterate, and harvest. Fast subset only (~4s). Full suite runs in CI.
- Pipes a download into a shell
- Reads credentials
- Commits and pushes
In this repositoryOne other file it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
17 rules. About 0 are common, 6 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 19
If working on AVO/skills → read § AVO rules below
- Very specific: line 20
If working on search quality → read PRINCIPLES.md
- Very specific: line 25
Commit: {type}: {description} (feat/fix/refactor/test/docs/chore)
- Distinctive: line 28
Don't stage the entire repo (git add .
- Very specific: line 29
Don't stage .env*, credentials, node_modules/, __pycache__/, or .git/ internals.
- Distinctive: line 30
Don't modify linter or formatter config to suppress errors.
- Very specific: line 31
Run ruff check && ruff format --check before commit.
- Distinctive: line 38
Don't skip platforms. Instead, run every configured platform on every search.
- Distinctive: line 40
Don't rank by engagement alone.
- Very specific: line 44
Don't skip Phase 3 (post-mortem).
- Very specific: line 54
Don't delete patterns.jsonl.
- Very specific: line 56
Don't delete evolution.jsonl.
- Very specific: line 62
Verify patterns.jsonl and evolution.jsonl have new entries (Phase 3 ran).
- Very specific: line 72
Don't modify meta-skills: create-skill, observe-user, extract-knowledge, interact-user, discover-environment.
- Very specific: line 74
Don't delete or rewrite lines in append-only state files: worklog.jsonl, patterns.jsonl, evolution-v1.jsonl, outcomes.jsonl.
- Very specific: line 80
Use Python 3.10+ to run lib/judge.py and tests.
- Distinctive: line 122
Don't version-bump in each parallel PR.
≈ “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
AutoSearch — Project Rules
Behavioral rules for AI agents and human contributors working in this codebase.
What this is
A self-improving search system. The human provides intent. The AI does everything else: understand the goal, generate strategies, run them across all platforms, score results, reflect, iterate, and harvest.
Local test (run before push)
.venv/bin/python -m pytest tests/unit/ -x -q -m "not real_llm and not slow and not network"Fast subset only (~4s). Full suite runs in CI.
Session Checklist
- If working on AVO/skills → read § AVO rules below
- If working on search quality → read
PRINCIPLES.md
Workflow
- Branch:
feature/{desc},fix/{desc}— don't develop on main - Commit:
{type}: {description}(feat/fix/refactor/test/docs/chore) - One commit = one logical change. Commit sequence: source code first, tests second, docs/config third. Don't batch. Because: reviewers need to verify tests cover exactly the code that changed.
- Feature commits without corresponding test commits will not pass review. Because: untested features are untested assumptions.
- Don't stage the entire repo (
git add ./git add -A). Stage specific files only. Because: prevents accidental inclusion of debug files, env changes, or unrelated edits. - Don't stage
.env*, credentials,node_modules/,__pycache__/, or.git/internals. Because: these files contain secrets or generated content that must not enter version control. - Don't modify linter or formatter config to suppress errors. Fix the code, not the config. Because: suppressing errors hides real problems and compounds technical debt.
- Run
ruff check && ruff format --checkbefore commit. Because: pushing lint failures wastes CI time and blocks other PRs. - Tests:
pytest -x -qmust pass before push. - PR stays under 5 commits. Larger → split into smaller PRs first. Because: oversized PRs don't get meaningful review.
- PR requires review before merge — don't self-merge. Because: self-review misses what a second pair of eyes catches.
Search rules
- Don't skip platforms. Instead, run every configured platform on every search. Because: each platform surfaces different content types — skipping one creates blind spots that compound across sessions. Exception: a platform is explicitly disabled in
standard.json. - Don't rank by engagement alone. Instead, use LLM relevance scoring to separate signal from popularity. Because: a 10-like post with a specific rule violation is more valuable than a 1000-like cheatsheet — engagement measures attention, not goal-match.
- Don't just score results and move on. Instead, after each round, write a reflection block to the session log: (a) top 3 patterns from high-scoring queries, (b) angles that returned zero results, (c) one hypothesis for next round. Because: reflection is what turns random search into directed search — without it, the system never learns within a session.
- Don't skip Phase 3 (post-mortem). Instead, let the engine write winning/losing patterns to
patterns.jsonlafter every session. Because: the outer loop is what makes this system self-improving — skipping it means next session starts no smarter than this one. - Don't hardcode queries. Instead, generate every query from the methodology (entities, pain verbs, objects, symptoms extracted from the user's requirement). Because: hardcoded queries can't adapt to new goals, and they bypass the gene pool that enables cross-session learning. Exception: seed genes in
queries.jsonthat bootstrap the first round. - Don't start searching before defining the target spec. Instead, answer three questions first: (a) what are we looking for? (b) what does a useful finding look like, concretely? (c) what output will findings become? Because: without a target spec, scoring is arbitrary and harvest produces unfocused results.
- Don't keep the same query mix ratio forever. Instead, track win rates by source (LLM / pattern / gene) and let the ratio adjust across sessions. Because: the optimal ratio depends on the problem space — a mature topic with many patterns needs fewer genes; a novel topic needs more exploration.
Data rules
- Don't delete
patterns.jsonl. Instead, treat it as append-only accumulated intelligence. Because: each entry represents a validated learning from a real search session — deleting it resets the system to zero. - Don't delete
evolution.jsonl. Instead, treat it as the append-only experiment log. Because: it's the raw data that enables cross-session analysis and debugging. - Architecture:
PROTOCOL.md+skills/+lib/search_runner.py.
Session Protocol — After completing a search session
- Verify
patterns.jsonlandevolution.jsonlhave new entries (Phase 3 ran). - Save durable findings or analysis in repo-local artifacts only. Do not write to directories outside the repository tree.
- Sync patterns to platform channel SKILL.md files: win_rate ≥ 0.6 across 3+ sessions → add; win_rate = 0 across 3+ sessions → Known Failures.
- Public-repo hygiene: do not commit
HANDOFF.md,docs/plans/,docs/proposals/,docs/spikes/,docs/channel-hunt/,docs/exec-plans/,reports/, or any*.private.md/*.handoff.md. The full list and rationale is indocs/internal-docs.md; the rules are enforced by.gitignore,scripts/committer,.husky/pre-commit, and the CI hygiene workflow. - CHANGELOG.md is release-only — update it during release (
bump-version.sh), not on every PR. GitHub release notes auto-generate from PR titles using.github/release-notes-instructions.md.
AVO rules (self-evolution)
- Don't modify
judge.pyorPROTOCOL.mdwithout explicit user authorization. These are the fixed contracts. judge.py is the scoring function. PROTOCOL.md is the operating protocol. Because: if AVO can change its own evaluation or rules, behavior becomes unpredictable. Exception: adding new scoring dimensions requires explicit user authorization per instance. AVO MUST NOT modify judge.py on its own. - Don't modify meta-skills:
create-skill,observe-user,extract-knowledge,interact-user,discover-environment. These define HOW to evolve, not WHAT to evolve. AVO can modify all OTHER skills. Because: meta-skills are the "DNA replication machinery" — evolution changes genes, not the replication mechanism. - Don't delete or rewrite lines in append-only state files:
worklog.jsonl,patterns.jsonl,evolution-v1.jsonl,outcomes.jsonl. Because: the AVO loop learns from history — deleting entries resets accumulated intelligence. - Skill changes during AVO go through
git commit. Failed changes getgit revert. Because: git history IS the lineage P_t that AVO uses to learn from failures. - Skill format:
skills/{name}/SKILL.md, one directory per skill. Name: lowercase a-z, 0-9, hyphens, max 64 chars, matches the directory name. Frontmatter:name+description(first sentence = WHEN to use, not what it does). Body: strategy guide, max 500 lines, ends with# Quality Bar. Full spec:docs/skill-format-standard.md. Because: without format constraints, AVO drifts toward bad names and 2000-line monsters. - Use Python 3.10+ to run
lib/judge.pyand tests. System python3 may be 3.9 which lacks union type syntax (X | Nonerequires 3.10+). - Platform skills can use free OR paid APIs. AVO discovers what's available via
discover-environmentand selects accordingly. - Every validation run MUST include a native Claude baseline comparison. Run the same query with native Claude (no AutoSearch skills/protocol), then compare in a table: result count by type, conceptual framework depth, content coverage gaps. Because: AutoSearch's value proposition is "better than native Claude at research" — if it's not, the system hasn't earned its complexity.
- AVO self-evolution MUST be validated separately from search quality. Search quality tests (like F006) prove the pipeline works. Evolution tests prove the system improves itself. An evolution test requires: (a) baseline score, (b) agent-initiated skill modification, (c) re-score showing improvement, (d) git commit on improvement, (e) git revert on regression, (f) pattern written to state. Without this test passing, AutoSearch is a search agent, not a self-evolving search agent.
Architecture: PROTOCOL.md + skills/ + lib/search_runner.py.
Release Workflow
Version format: CalVer YYYY.MM.DD.N (e.g., 2026.04.04.1). N is the daily sequence number (1, 2, 3...).
Version lives in 3 files (kept in sync by scripts/bump-version.sh):
.claude-plugin/plugin.json— Claude Code reads this to detect updates.claude-plugin/marketplace.json— marketplace catalogCHANGELOG.md— user-facing release notes
How to release
scripts/bump-version.sh— auto-bumps to today's datescripts/committer "chore: bump version to X.Y.Z" .claude-plugin/plugin.json .claude-plugin/marketplace.json CHANGELOG.mdgit tag vX.Y.Zgit push && git push --tags— triggersrelease.yml→ creates GitHub Release
How users update
- Manual:
claude plugin update autosearch@autosearch - Auto:
/plugin→ Marketplaces tab → autosearch → Enable auto-update - Re-install:
curl -fsSL https://raw.githubusercontent.com/0xmariowu/autosearch/main/scripts/install.sh | bash
Guardrails
- Pre-push hook: blocks push if source files changed but version not bumped
- CI: posts PR comment warning if version drift detected
- release.yml: validates tag matches plugin.json version
Lessons Learned
- Pre-commit hook must verify git author email is the project's noreply address and name matches the public maintainer pseudonym before every commit. Rules in this file alone are not enough — they get forgotten under task pressure. The hook is the enforcement. Because: a prior incident leaked maintainer PII (real name + non-public hostname) into public git history and required a history rewrite.
- Detection config files (
.gitleaks.toml) must use generic regex patterns, never literal PII values — e.g.[a-z]+macrather than spelling out an actual hostname. Because: the detection file itself can become a PII leak. - Don't version-bump in each parallel PR. Bump once after the merge batch on main. Because: parallel bumps create empty CHANGELOG entries and merge noise.
- Pre-commit hook must grep staged files for internal-project codenames and private knowledge-base names. Maintain that pattern list inside the hook (and
.gitleaks.toml), not in user-visible documentation. Because: internal references leak into public docs despite written rules — only the scanner reliably catches them. bump-version.shshould warn if the previous version section inCHANGELOG.mdhas no content. Because: empty version entries are user-visible bugs.
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.

