agentleFS
gptmegptme/gptme/AGENTS.md

gptme

AGENTS.md4.4k starsChanged 6 months agoMITView on GitHub

This file provides agent-specific guidance for working on gptme. For general project information, see README.md and docs. Run tests before submitting PRs: Key directories: - gptme/ - Core library code - gptme/cli/ - CLI entry points - gptme/tools/ - Tool implementations - gptme/llm/ - LLM provider integrations - gptme/server/ - REST API server - tests/ - Test suite - docs/ - Sphinx documentation (RST + MD) - scripts/ - Build and utility scripts We aim to keep gptme core small…

  • Commits and pushes

Trending

Quiet since January.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 3 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the gptme/gptme repository that our weekly crawl found: only 7 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about gptme/gptme

The biggest 5 of 7 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 7

Talked about on GitHub and Hacker News (7 times).

On GitHub · 6

1 more on GitHub
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

16 rules. About 0 are common, 9 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    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
  1. Distinctive:

    Never push directly to master: - always use branches and PRs

    line 8
  2. Distinctive:

    Commit format: Use Conventional Commits

    line 10
  3. Distinctive:

    Stage files explicitly: Never use git add . or git commit -a

    line 15
  4. Very specific:

    Create PRs: Use gh pr create after pushing branch

    line 16
  5. Distinctive:

    Type hints: All functions must have type annotations

    line 20
  6. Distinctive:

    KISS: Keep it simple - avoid over-engineering

    line 23
  7. Distinctive:

    Minimal mocking: Prefer integration tests over heavy mocking

    line 25
  8. Distinctive:

    Run tests before submitting PRs:

    line 29
  9. Very specific:

    When in doubt, start in gptme-contrib.

    line 64
  10. Distinctive:

    Run recall once to surface the entries most relevant to the current task:

    line 92
  11. Very specific:

    If gptme-rag (with the lexical extra) is installed the TF-IDF backend is used automatically.

    line 98
  12. Distinctive:

    When you learn something worth keeping across sessions — a user preference, a project decision, a recurring pattern — persist it:

    line 105
  13. Very specific:

    Default write root is project memory/ if that directory exists, else ~/.claude/projects/<workspace-hash>/memory/.

    line 116
  14. Very specific:

    Add tests in tests/test_tools_toolname.py

    line 147
  15. Very specific:

    Every docs page declares its target audience — :audience: user|power-user|developer as the first line of .rst files, audience: front matter …

    line 164
  16. Very specific:

    After make docs, review the rendered structure with make docs-structure.

    line 170

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Agent Instructions for gptme

This file provides agent-specific guidance for working on gptme. For general project information, see README.md and docs.

Git Workflow

  • Never push directly to master - always use branches and PRs
  • Branch naming: feat/, fix/, docs/, refactor/ prefixes
  • Commit format: Use Conventional Commits
    • feat: for new features (not just docs)
    • fix: for bug fixes
    • docs: for documentation only
    • refactor:, test:, chore: as appropriate
  • Stage files explicitly: Never use git add . or git commit -a
  • Create PRs: Use gh pr create after pushing branch

Code Style

  • Type hints: All functions must have type annotations
  • Formatting: ruff format and ruff check (run via pre-commit)
  • Type checking: mypy must pass
  • KISS: Keep it simple - avoid over-engineering
  • Small functions: Refactor deeply nested code into smaller units
  • Minimal mocking: Prefer integration tests over heavy mocking

Testing

Run tests before submitting PRs:

make test           # Fast tests (excludes slow/eval)
make test SLOW=1    # Include slow tests
make typecheck      # mypy
make lint           # ruff + other checks

Project Structure

Key directories:

  • gptme/ - Core library code
    • gptme/cli/ - CLI entry points
    • gptme/tools/ - Tool implementations
    • gptme/llm/ - LLM provider integrations
    • gptme/server/ - REST API server
  • tests/ - Test suite
  • docs/ - Sphinx documentation (RST + MD)
  • scripts/ - Build and utility scripts

Core vs gptme-contrib

We aim to keep gptme core small and focused. See docs/arewetiny.rst.

Belongs in core (gptme):

  • Essential tools (shell, save, patch, browser, vision)
  • Core infrastructure (chat loop, message handling, LLM providers)
  • Features needed by most users

Belongs in gptme-contrib:

  • Specialized tools (Twitter/X, Discord, email)
  • Experimental features
  • Integrations with specific services
  • Multi-agent patterns (consortium)

When in doubt, start in gptme-contrib. If widely adopted, consider upstreaming.

Performance

We track startup time and code size. See docs/arewetiny.rst.

CI benchmarks enforce startup thresholds.

Key Concepts

  • Tool: A function the assistant can execute (shell, save, patch, etc.)
  • ToolUse: Parsed representation of a tool invocation in a message
  • Message: A single message in the conversation
  • LogManager: Manages conversation history persistence
  • Step: One LLM generation + tool execution cycle
  • Turn: Complete user→assistant exchange (may include multiple steps)

See docs/glossary.md for full terminology.

Memory

gptme uses a cross-harness memory store that is shared between gptme, Claude Code, and Codex sessions. Memories are Claude Code–compatible Markdown files in layered roots: project memory/ when that directory exists, then the Claude Code per-project directory, then agent/user roots.

Recall at session start

Run recall once to surface the entries most relevant to the current task:

gptme-util memory recall "<one-line task description>" -k 5

If gptme-rag (with the lexical extra) is installed the TF-IDF backend is used automatically; a deterministic token-overlap fallback is used otherwise. The output line always names the backend that ran (backend=tfidf or backend=overlap). Recall searches every layered root.

Save a memory

When you learn something worth keeping across sessions — a user preference, a project decision, a recurring pattern — persist it:

gptme-util memory save <slug> "<one-line description>" --type <type> <<'EOF'
<body — as many lines as useful>
EOF

Valid --type values: user, feedback, project, reference.

Default write root is project memory/ if that directory exists, else ~/.claude/projects/<workspace-hash>/memory/. Existence is the only check — an unwritable project directory is an error, not a fallback. recall (and the Claude Code hook) search every layered root, so other harnesses see the entry on their next recall. gptme's session-start workspace prompt loads the indexes of every existing layered root (64 KB shared budget), but Claude Code's native MEMORY.md auto-load reads only the CC root; pass --scope cc when the memory must appear in Claude Code without recall.

Inspect and manage

gptme-util memory roots          # Which roots are active for this workspace
gptme-util memory list           # All living entries across all roots
gptme-util memory show <slug>    # Full text of one entry
gptme-util memory index --write  # Regenerate MEMORY.md in the write root

See docs/memory.rst or https://gptme.org/docs/memory.html for the full reference.

Subsystem Guides

  • webui/AGENTS.md - Web UI architecture and gotchas

Common Tasks

Adding a new tool

  1. Create gptme/tools/toolname.py
  2. Implement ToolSpec with execute() function
  3. Tools are auto-discovered - no manual registration needed
  4. Add tests in tests/test_tools_toolname.py

Running the server

uv run gptme-server --port 5000

Working on the web UI

See webui/AGENTS.md for full setup including dev servers, testing, and architecture notes.

Building docs

make docs

Writing docs

Every docs page declares its target audience — :audience: user|power-user|developer as the first line of .rst files, audience: front matter in .md — and the build fails without it. Keep content at the page's level: move power-user or developer detail to a more technical page and link to it, and flag mismatches in review. Hub pages list their subpages near the top; leaf pages have no toctree and no .. contents::. Don't nest a lone related page under a content-heavy page. After make docs, review the rendered structure with make docs-structure. See "Documentation" in docs/contributing.rst.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.