Are we tiny?#
gptme is intended to be small and simple, and focus on doing the right thing in the right way, rather than all the things in all the ways.
The benefits of this approach are many:
It is easier to understand and maintain.
It is easier to contribute to.
It is easier to learn.
It is easier to extend.
It is more fun to work on.
Being aggressive about keeping things small and simple is a way to keep the project maintainable and fun to work on. The fastest way to kill a project is to make it too big and complex, and suffer burnout as a result.
Another major benefit of keeping things small and simple is that it makes it easier for AI to understand and work with the codebase. This is a major goal of the project, and it is important to keep in mind that the simpler the codebase is, the easier it will be for AI to work with it:
“The simpler your API is, the more effectively the AI can harness it when generating code.”
—Kenneth Reitz (and many others)
To that end, in this document we will present some statistics about the current state of the project, trying to be mindful to keep an eye on this page and make sure we are not growing too much.
Startup time#
$ make bench-import
make[2]: Entering directory '/home/runner/work/gptme/gptme'
Benchmarking import time for gptme
time poetry run python -X importtime -m gptme --model openai --non-interactive 2>&1 | grep "import time" | cut -d'|' -f 2- | sort -n | tail -n 10
291883 | mcp.types
294108 | gptme.tools.mcp_adapter
297390 | openai.types
364741 | openai
432685 | gptme.llm.llm_openai
724279 | gptme.cli.main
738680 | gptme.llm
740595 | gptme.commands
773887 | gptme.chat
776335 | gptme
real 0m2.787s
user 0m2.202s
sys 0m0.691s
make[2]: Leaving directory '/home/runner/work/gptme/gptme'
$ make bench-startup
make[2]: Entering directory '/home/runner/work/gptme/gptme'
Benchmarking startup time for gptme
hyperfine "poetry run gptme '/exit'" -M 5 || poetry run gptme '/exit' || exit 1
Benchmark 1: poetry run gptme '/exit'
Time (mean ± σ): 2.526 s ± 0.065 s [User: 2.197 s, System: 0.560 s]
Range (min … max): 2.457 s … 2.612 s 5 runs
make[2]: Leaving directory '/home/runner/work/gptme/gptme'
Lines of code#
LoC Core#
$ make cloc-core
make[2]: Entering directory '/home/runner/work/gptme/gptme'
cloc gptme/*.py gptme/llm/*.py gptme/util/*.py gptme/tools/base.py gptme/tools/__init__.py gptme/hooks/__init__.py gptme/plugins/__init__.py gptme/lessons/*.py --by-file --hide-rate --quiet | tail -n +2
-----------------------------------------------------------------------------------------------
File blank comment code
-----------------------------------------------------------------------------------------------
gptme/util/gh.py 217 245 1161
gptme/llm/llm_openai.py 222 241 955
gptme/llm/llm_anthropic.py 153 197 726
gptme/tools/base.py 138 180 574
gptme/util/context.py 136 192 543
gptme/llm/llm_openai_subscription.py 136 116 523
gptme/lessons/installer.py 146 165 495
gptme/llm/__init__.py 86 126 419
gptme/util/prompt.py 103 151 410
gptme/chat.py 68 92 395
gptme/util/_telemetry.py 106 123 357
gptme/message.py 85 116 344
gptme/telemetry.py 85 54 342
gptme/info.py 84 70 293
gptme/tools/__init__.py 89 71 273
gptme/plugins/__init__.py 85 119 256
gptme/codeblock.py 37 143 247
gptme/lessons/index.py 90 133 235
gptme/util/auto_naming.py 68 78 224
gptme/lessons/parser.py 73 117 221
gptme/lessons/hybrid_matcher.py 84 108 218
gptme/util/_sound_sounddevice.py 57 50 218
gptme/profiles.py 64 67 217
gptme/lessons/commands.py 91 48 213
gptme/util/sound.py 65 72 200
gptme/llm/llm_openai_models.py 6 25 193
gptme/hooks/__init__.py 20 42 188
gptme/llm/validate.py 30 29 174
gptme/util/__init__.py 34 29 155
gptme/llm/utils.py 54 73 153
gptme/llm/llm_openai_models_deprecated.py 5 13 151
gptme/util/tool_format.py 48 75 151
gptme/util/cost_display.py 39 31 148
gptme/util/reduce.py 45 42 148
gptme/util/clipboard.py 22 12 147
gptme/init.py 33 32 142
gptme/llm/llm_gptme.py 47 58 127
gptme/util/export.py 26 29 111
gptme/util/cost_tracker.py 43 62 109
gptme/dirs.py 42 31 103
gptme/lessons/matcher.py 35 47 103
gptme/util/ask_execute.py 25 40 89
gptme/util/tree.py 21 15 87
gptme/util/git_worktree.py 25 33 83
gptme/__version__.py 17 5 82
gptme/lessons/auto_include.py 31 27 78
gptme/llm/llm_anthropic_models_deprecated.py 5 11 70
gptme/session.py 39 64 70
gptme/util/generate_name.py 5 6 69
gptme/util/master_context.py 28 38 66
gptme/util/_sound_cmd.py 22 17 62
gptme/util/tokens.py 20 20 60
gptme/util/uri.py 29 42 59
gptme/util/output_storage.py 26 36 54
gptme/util/context_dedup.py 41 93 53
gptme/util/terminal.py 28 23 53
gptme/llm/provider_plugins.py 39 35 48
gptme/util/cost.py 12 9 47
gptme/util/file_storage.py 30 47 40
gptme/util/keyword_matching.py 35 66 39
gptme/util/content.py 18 24 30
gptme/util/install.py 13 25 30
gptme/util/useredit.py 11 13 26
gptme/constants.py 17 19 25
gptme/executor.py 18 26 24
gptme/util/interrupt.py 13 15 23
gptme/lessons/__init__.py 7 15 18
gptme/__init__.py 4 0 12
gptme/__main__.py 2 0 12
gptme/llm/constants.py 1 4 1
-----------------------------------------------------------------------------------------------
SUM: 3679 4472 13772
-----------------------------------------------------------------------------------------------
make[2]: Leaving directory '/home/runner/work/gptme/gptme'
LoC LLM#
$ make cloc-llm
make[2]: Entering directory '/home/runner/work/gptme/gptme'
cloc gptme/llm/*.py --by-file --hide-rate --quiet | tail -n +2
-----------------------------------------------------------------------------------------------
File blank comment code
-----------------------------------------------------------------------------------------------
gptme/llm/llm_openai.py 222 241 955
gptme/llm/llm_anthropic.py 153 197 726
gptme/llm/llm_openai_subscription.py 136 116 523
gptme/llm/__init__.py 86 126 419
gptme/llm/llm_openai_models.py 6 25 193
gptme/llm/validate.py 30 29 174
gptme/llm/utils.py 54 73 153
gptme/llm/llm_openai_models_deprecated.py 5 13 151
gptme/llm/llm_gptme.py 47 58 127
gptme/llm/llm_anthropic_models_deprecated.py 5 11 70
gptme/llm/provider_plugins.py 39 35 48
gptme/llm/constants.py 1 4 1
-----------------------------------------------------------------------------------------------
SUM: 784 928 3540
-----------------------------------------------------------------------------------------------
make[2]: Leaving directory '/home/runner/work/gptme/gptme'
LoC Tools#
$ make cloc-tools
make[2]: Entering directory '/home/runner/work/gptme/gptme'
cloc gptme/tools/*.py gptme/hooks/*.py gptme/plugins/*.py --by-file --hide-rate --quiet | tail -n +2
-------------------------------------------------------------------------------------
File blank comment code
-------------------------------------------------------------------------------------
gptme/tools/shell.py 195 300 1093
gptme/hooks/workspace_agents.py 148 102 640
gptme/tools/mcp_adapter.py 206 210 610
gptme/tools/browser.py 187 263 596
gptme/tools/base.py 138 180 574
gptme/tools/gh.py 116 126 523
gptme/tools/_browser_playwright.py 140 105 518
gptme/tools/computer.py 154 222 514
gptme/tools/chats.py 85 101 385
gptme/tools/tmux.py 95 171 384
gptme/hooks/registry.py 88 78 381
gptme/tools/mcp.py 102 102 337
gptme/tools/lessons.py 102 109 275
gptme/tools/save.py 61 60 274
gptme/tools/__init__.py 89 71 273
gptme/tools/shell_validation.py 88 121 273
gptme/tools/patch.py 62 95 270
gptme/tools/shell_background.py 65 36 270
gptme/plugins/__init__.py 85 119 256
gptme/tools/python.py 74 90 239
gptme/tools/todo.py 95 109 232
gptme/tools/precommit.py 70 96 229
gptme/hooks/elicitation.py 90 132 213
gptme/hooks/__init__.py 20 42 188
gptme/tools/morph.py 43 47 185
gptme/tools/_browser_thread.py 27 12 156
gptme/hooks/cli_confirm.py 50 54 152
gptme/tools/read.py 32 25 152
gptme/tools/rag.py 62 74 151
gptme/tools/restart.py 51 81 150
gptme/tools/form.py 38 55 145
gptme/hooks/token_awareness.py 44 50 142
gptme/hooks/types.py 74 111 139
gptme/tools/elicit.py 36 109 135
gptme/hooks/cost_awareness.py 45 56 133
gptme/hooks/cache_awareness.py 95 138 128
gptme/tools/complete.py 34 45 125
gptme/hooks/form_autodetect.py 48 65 123
gptme/hooks/server_confirm.py 51 58 122
gptme/plugins/registry.py 40 32 115
gptme/hooks/server_elicit.py 52 56 113
gptme/hooks/confirm.py 53 88 109
gptme/tools/choice.py 32 38 103
gptme/hooks/active_context.py 25 23 100
gptme/tools/screenshot.py 25 29 94
gptme/hooks/time_awareness.py 29 31 84
gptme/tools/autocommit.py 37 58 80
gptme/hooks/agents_md_inject.py 27 47 78
gptme/tools/vision.py 25 14 73
gptme/tools/_browser_lynx.py 12 12 60
gptme/tools/_browser_perplexity.py 22 16 60
gptme/hooks/cwd_changed.py 15 11 54
gptme/hooks/markdown_validation.py 36 41 51
gptme/plugins/entrypoints.py 15 13 42
gptme/hooks/test.py 12 5 33
gptme/hooks/cwd_awareness.py 11 17 28
gptme/hooks/auto_confirm.py 11 9 24
gptme/plugins/plugin.py 25 39 17
gptme/tools/_browser_format.py 3 5 3
-------------------------------------------------------------------------------------
SUM: 3792 4604 13006
-------------------------------------------------------------------------------------
make[2]: Leaving directory '/home/runner/work/gptme/gptme'
LoC Server#
$ make cloc-server
make[2]: Entering directory '/home/runner/work/gptme/gptme'
cloc gptme/server --by-file --hide-rate --quiet | tail -n +2
--------------------------------------------------------------------------------------
File blank comment code
--------------------------------------------------------------------------------------
gptme/server/api_v2.py 187 143 991
gptme/server/session_step.py 150 200 661
gptme/server/tasks_api.py 186 121 639
gptme/server/api_v2_sessions.py 106 128 606
gptme/server/openapi_docs.py 198 147 537
gptme/server/static/main.js 51 69 497
gptme/server/workspace_api.py 97 89 437
gptme/server/external_sessions.py 40 25 267
gptme/server/session_models.py 57 69 201
gptme/server/static/index.html 11 18 199
gptme/server/acp_session_runtime.py 34 30 165
gptme/server/auth.py 57 80 160
gptme/server/client.py 63 79 149
gptme/server/static/style.css 27 4 143
gptme/server/cli.py 26 13 136
gptme/server/api_v2_common.py 75 62 133
gptme/server/api_v2_agents.py 25 17 114
gptme/server/static/computer.html 1 1 90
gptme/server/app.py 23 21 57
gptme/server/__init__.py 2 3 3
gptme/server/__main__.py 1 0 3
gptme/server/constants.py 1 3 1
--------------------------------------------------------------------------------------
SUM: 1418 1322 6189
--------------------------------------------------------------------------------------
make[2]: Leaving directory '/home/runner/work/gptme/gptme'
LoC Tests#
$ make cloc-tests
make[2]: Entering directory '/home/runner/work/gptme/gptme'
cloc tests --by-file --hide-rate --quiet | tail -n +2
-----------------------------------------------------------------------------------------------
File blank comment code
-----------------------------------------------------------------------------------------------
tests/test_init.py 207 109 1131
tests/test_llm_openai.py 315 187 1130
tests/test_eval_behavioral.py 668 685 1113
tests/test_acp_agent.py 321 184 1074
tests/test_util_gh.py 231 125 1059
tests/test_server_v2.py 269 112 1023
tests/test_tools_subagent.py 334 169 982
tests/test_eval_leaderboard.py 126 104 883
tests/test_info.py 167 73 878
tests/test_util_gh_mocked.py 149 119 777
tests/test_tools_shell.py 251 397 729
tests/test_tasks_api.py 166 59 702
tests/test_tools_browser.py 232 52 697
tests/test_tools_gh.py 134 69 675
tests/test_agent.py 199 110 667
tests/test_hooks_registry.py 238 89 640
tests/test_acp_session_runtime.py 215 76 635
tests/test_server_workspace.py 128 130 605
tests/test_config.py 173 291 602
tests/test_tools_lessons.py 135 49 580
tests/test_tools_precommit.py 109 86 578
tests/test_prompt_templates.py 206 140 551
tests/test_auto_compact.py 227 189 543
tests/test_llm_models_resolution.py 187 128 543
tests/test_llm_utils.py 159 101 538
tests/test_doctor.py 154 96 536
tests/test_lessons.py 156 153 517
tests/test_server_v2_sessions.py 93 67 503
tests/test_llm_auth.py 169 56 476
tests/test_server_session_models.py 158 140 466
tests/test_skill_installer.py 138 154 459
tests/test_tools_shell_background.py 117 51 456
tests/test_tools_base.py 149 62 440
tests/test_lessons_commands.py 157 82 422
tests/test_dirs.py 97 69 421
tests/test_tools_computer.py 163 98 420
tests/context/test_task_analyzer.py 90 44 418
tests/test_lessons_parser.py 188 239 417
tests/test_hooks_cache_awareness.py 122 35 403
tests/test_codeblock.py 302 776 402
tests/test_tools_shell_validation.py 161 63 399
tests/test_tools_mcp.py 102 20 398
tests/test_server_path_traversal.py 100 60 388
tests/test_lessons_index.py 131 106 385
tests/test_util_cli_mcp.py 89 45 380
tests/test_profiles.py 84 30 354
tests/test_eval.py 77 70 352
tests/test_lessons_matcher.py 99 86 352
tests/test_llm_anthropic.py 64 28 352
tests/test_commands.py 123 60 347
tests/test_cli.py 95 71 342
tests/test_shell_background.py 99 71 342
tests/test_workspace_api.py 98 19 342
tests/test_unified_plugins.py 94 38 341
tests/test_eval_trends.py 35 22 335
tests/test_util_cli.py 87 52 333
tests/test_eval_behavioral_solutions.py 261 770 332
tests/test_provider_plugins.py 90 32 331
tests/test_message.py 120 111 328
tests/test_util_tool_format.py 78 32 322
tests/conftest.py 89 89 319
tests/test_agent_doctor.py 72 34 318
tests/test_mcp_discovery.py 97 39 315
tests/test_mcp_adapter.py 106 54 313
tests/test_util_hooks.py 82 87 311
tests/test_tools_morph.py 89 66 310
tests/context/test_adaptive_compressor.py 58 44 298
tests/test_context.py 130 79 297
tests/test_external_sessions.py 80 49 296
tests/test_workspace_agents.py 137 57 296
tests/lessons/test_wildcard_matching.py 114 125 287
tests/test_hybrid_lessons.py 77 34 286
tests/test_server.py 106 71 283
tests/test_hooks_server_confirm.py 78 31 282
tests/test_tools_restart.py 72 49 274
tests/test_server_v2_agents.py 57 25 272
tests/test_tools_complete.py 78 77 271
tests/test_execenv.py 70 51 266
tests/test_tools.py 113 59 259
tests/test_tools_autocommit.py 98 47 258
tests/test_context_selector.py 83 45 254
tests/test_eval_claude_code.py 66 27 253
tests/test_chat.py 122 142 252
tests/test_lessons_integration.py 97 66 252
tests/test_util_cli_providers.py 60 27 250
tests/test_prompt_tools.py 57 30 249
tests/test_llm_models.py 87 63 248
tests/test_tools_browser_thread.py 69 38 245
tests/test_agents_md_inject.py 43 37 241
tests/test_complete.py 56 40 241
tests/test_cost_display.py 27 20 241
tests/test_prompts.py 76 54 240
tests/test_mcp.py 68 59 239
tests/test_auto_naming.py 69 45 237
tests/test_conversations.py 35 25 235
tests/test_hooks.py 114 46 232
tests/test_browser.py 96 53 221
tests/test_util_keyword_matching.py 75 46 218
tests/test_lessons_tool.py 62 34 216
tests/test_logmanager.py 66 57 215
tests/test_autocompact_scoring.py 86 39 208
tests/test_executor.py 50 31 206
tests/test_plugins.py 82 70 203
tests/test_tools_screenshot.py 55 48 203
tests/test_util_file_storage.py 51 36 203
tests/test_chats_json.py 30 17 202
tests/test_tool_use.py 38 43 200
tests/test_subagent_unit.py 45 20 199
tests/test_server_v2_auto_stepping.py 45 45 197
tests/test_tools_save.py 57 36 193
tests/test_chats_clean.py 46 18 191
tests/test_chats_stats.py 63 27 184
tests/test_dspy_hybrid.py 65 45 179
tests/test_dspy_basic.py 66 44 177
tests/test_hooks_cwd_changed.py 55 24 176
tests/test_tools_todo.py 81 65 173
tests/test_chats_export.py 48 17 172
tests/test_acp_types.py 35 12 171
tests/test_tools_patch.py 91 214 171
tests/test_server_v2_hooks.py 70 59 170
tests/test_util_terminal.py 52 34 168
tests/test_tools_elicit.py 50 25 167
tests/test_tree.py 59 37 167
tests/test_acp_protocol_logging.py 56 15 160
tests/test_acp_client.py 64 34 159
tests/test_acp_stdout.py 76 37 158
tests/test_uri.py 55 30 158
tests/test_tools_time_awareness.py 52 34 155
tests/test_cost_tracker.py 21 24 154
tests/test_shell_allowlist_autoconfirm.py 38 38 154
tests/test_tools_tmux.py 69 63 154
tests/test_util_cli_skills.py 59 41 151
tests/test_util_tree.py 44 33 151
tests/test_server_api_v2_common.py 46 46 150
tests/test_util_install.py 34 31 148
tests/test_master_context.py 39 24 147
tests/test_file_selector_integration.py 50 23 145
tests/test_gptme_provider.py 66 20 143
tests/test_util_tokens.py 72 35 143
tests/test_dspy_integration.py 54 32 139
tests/test_tools_vision.py 36 31 138
tests/test_server_elicitation.py 47 17 137
tests/test_util_cli_models.py 15 11 137
tests/test_util_content.py 49 25 137
tests/test_agent_workspace_timeouts.py 41 22 129
tests/test_acp_adapter.py 42 33 128
tests/test_cwe214_docker_env_leak.py 42 41 128
tests/test_active_context.py 41 22 126
tests/test_tools_token_awareness.py 59 47 126
tests/test_util_context_dedup.py 61 43 125
tests/test_tools_python.py 56 19 124
tests/test_prompt.py 36 36 123
tests/test_reduce.py 33 28 123
tests/test_util_interrupt.py 48 38 121
tests/test_integration_phase4.py 22 19 119
tests/test_llm_openai_subscription.py 32 10 118
tests/test_util_clipboard_paste.py 27 14 117
tests/test_agent_service_timeouts.py 19 18 116
tests/test_llm_validate.py 26 20 116
tests/test_misc_subprocess_timeouts.py 43 27 114
tests/test_lessons_status.py 67 96 113
tests/test_chats_rename.py 42 17 112
tests/test_eval_swebench.py 39 32 111
tests/test_cost_awareness_delayed_warning.py 42 32 108
tests/test_server_v2_tool_confirmation.py 32 32 107
tests/test_util_cost.py 21 19 103
tests/test_git_worktree.py 31 19 102
tests/test_command_completion.py 33 23 100
tests/test_tools_read.py 30 14 98
tests/test_session.py 40 21 95
tests/test_tools_choice.py 47 24 91
tests/test_agent_memory.py 26 17 90
tests/test_browser_lynx.py 35 15 90
tests/test_swebench_utils.py 27 2 89
tests/test_browser_github_routing.py 27 0 86
tests/test_server_auth.py 40 19 84
tests/test_prompt_skills_summary.py 44 44 80
tests/test_onboard.py 17 17 79
tests/test_util.py 42 85 78
tests/test_eval_timeouts.py 32 33 77
tests/test_markdown_validation.py 43 34 75
tests/test_shell_issue729.py 50 52 75
tests/test_util_output_storage.py 18 10 75
tests/test_custom_providers.py 32 44 74
tests/test_shell_issue772.py 48 47 73
tests/test_chat_config.py 24 19 72
tests/test_hooks_form_autodetect.py 22 34 68
tests/test_tools_form.py 22 19 67
tests/test_shell_output_mixing_issue408.py 25 29 60
tests/test_eval_practical20.py 27 8 59
tests/test_server_client.py 33 26 59
tests/test_chat_history.py 14 12 56
tests/test_eval_practical17.py 33 3 53
tests/test_eval_practical18.py 23 4 53
tests/test_eval_practical19.py 23 6 53
tests/test_tools_chats.py 16 13 51
tests/test_server_v2_sse.py 15 13 50
tests/test_dspy_gepa.py 18 9 46
tests/test_demo_capture.py 19 9 45
tests/test_util_generate_name.py 17 10 45
tests/test-integration.sh 22 36 43
tests/test_pdf_to_images.py 13 13 43
tests/test_xml_format.py 19 68 41
tests/test_shell_fd_leak.py 23 16 39
tests/test_utils.py 14 17 38
tests/test_util_export.py 20 11 36
tests/test_message_command.py 13 12 35
tests/test_cli_confirm_hook.py 24 20 34
tests/test_tools_rag.py 15 8 34
tests/test_shell_for_loop_issue724.py 16 24 33
tests/test_eval_practical16.py 11 0 28
tests/test_telemetry.py 20 15 28
tests/test_quota_skip.py 5 3 26
tests/data/example-patch-codeblock.txt 4 0 25
tests/data/example-interrupted.txt 8 0 24
tests/test_tool_loading_duplicate.py 16 15 24
tests/test_setup_completions.py 9 6 22
tests/test_tools_shell_multiline.py 7 19 19
tests/test_browser_format.py 8 6 18
tests/test_screenshot.py 9 6 15
-----------------------------------------------------------------------------------------------
SUM: 17619 13206 56794
-----------------------------------------------------------------------------------------------
make[2]: Leaving directory '/home/runner/work/gptme/gptme'
LoC Eval#
$ make cloc-eval
make[2]: Entering directory '/home/runner/work/gptme/gptme'
cloc gptme/eval/**.py --by-file --hide-rate --quiet | tail -n +2
---------------------------------------------------------------------------------------
File blank comment code
---------------------------------------------------------------------------------------
gptme/eval/main.py 103 109 842
gptme/eval/leaderboard.py 149 485 804
gptme/eval/execenv.py 85 146 510
gptme/eval/run.py 57 69 413
gptme/eval/trends.py 59 31 317
gptme/eval/types.py 26 26 74
gptme/eval/filestore.py 11 8 63
gptme/eval/cost.py 12 24 6
gptme/eval/__init__.py 2 2 4
gptme/eval/__main__.py 1 0 3
---------------------------------------------------------------------------------------
SUM: 505 900 3036
---------------------------------------------------------------------------------------
make[2]: Leaving directory '/home/runner/work/gptme/gptme'
LoC Total#
$ make cloc-total
make[2]: Entering directory '/home/runner/work/gptme/gptme'
cloc gptme/session.py gptme/__version__.py gptme/server/external_sessions.py gptme/server/auth.py gptme/server/openapi_docs.py gptme/server/api_v2_agents.py gptme/server/api_v2.py gptme/server/client.py gptme/server/tasks_api.py gptme/server/app.py gptme/server/cli.py gptme/server/session_step.py gptme/server/session_models.py gptme/server/workspace_api.py gptme/server/api_v2_common.py gptme/server/api_v2_sessions.py gptme/server/constants.py gptme/server/acp_session_runtime.py gptme/server/__init__.py gptme/server/__main__.py gptme/message.py gptme/mcp/client.py gptme/mcp/registry.py gptme/mcp/__init__.py gptme/tools/save.py gptme/tools/shell_validation.py gptme/tools/screenshot.py gptme/tools/_browser_perplexity.py gptme/tools/patch.py gptme/tools/base.py gptme/tools/mcp.py gptme/tools/autocompact/handlers.py gptme/tools/autocompact/scoring.py gptme/tools/autocompact/resume.py gptme/tools/autocompact/hook.py gptme/tools/autocompact/engine.py gptme/tools/autocompact/decision.py gptme/tools/autocompact/__init__.py gptme/tools/rag.py gptme/tools/subagent/types.py gptme/tools/subagent/execution.py gptme/tools/subagent/batch.py gptme/tools/subagent/api.py gptme/tools/subagent/hooks.py gptme/tools/subagent/__init__.py gptme/tools/gh.py gptme/tools/tmux.py gptme/tools/browser.py gptme/tools/choice.py gptme/tools/mcp_adapter.py gptme/tools/form.py gptme/tools/shell.py gptme/tools/_browser_lynx.py gptme/tools/morph.py gptme/tools/precommit.py gptme/tools/read.py gptme/tools/python.py gptme/tools/_browser_format.py gptme/tools/complete.py gptme/tools/restart.py gptme/tools/elicit.py gptme/tools/shell_background.py gptme/tools/autocommit.py gptme/tools/todo.py gptme/tools/computer.py gptme/tools/_browser_thread.py gptme/tools/vision.py gptme/tools/chats.py gptme/tools/__init__.py gptme/tools/lessons.py gptme/tools/_browser_playwright.py gptme/logmanager/manager.py gptme/logmanager/__init__.py gptme/logmanager/conversations.py gptme/chat.py gptme/context/selector/config.py gptme/context/selector/base.py gptme/context/selector/file_selector.py gptme/context/selector/rule_based.py gptme/context/selector/file_config.py gptme/context/selector/file_integration.py gptme/context/selector/llm_based.py gptme/context/selector/hybrid.py gptme/context/selector/__init__.py gptme/context/config.py gptme/context/compress.py gptme/context/adaptive_compressor.py gptme/context/task_analyzer.py gptme/context/__init__.py gptme/executor.py gptme/init.py gptme/dirs.py gptme/config/chat.py gptme/config/cli_setup.py gptme/config/models.py gptme/config/core.py gptme/config/project.py gptme/config/user.py gptme/config/__init__.py gptme/llm/llm_gptme.py gptme/llm/utils.py gptme/llm/llm_openai_subscription.py gptme/llm/validate.py gptme/llm/llm_openai.py gptme/llm/provider_plugins.py gptme/llm/llm_anthropic_models_deprecated.py gptme/llm/constants.py gptme/llm/llm_openai_models_deprecated.py gptme/llm/llm_anthropic.py gptme/llm/llm_openai_models.py gptme/llm/__init__.py gptme/llm/models/types.py gptme/llm/models/listing.py gptme/llm/models/resolution.py gptme/llm/models/data.py gptme/llm/models/__init__.py gptme/util/_sound_sounddevice.py gptme/util/terminal.py gptme/util/reduce.py gptme/util/context.py gptme/util/auto_naming.py gptme/util/content.py gptme/util/git_worktree.py gptme/util/sound.py gptme/util/_sound_cmd.py gptme/util/gh.py gptme/util/file_storage.py gptme/util/tokens.py gptme/util/uri.py gptme/util/cost.py gptme/util/interrupt.py gptme/util/clipboard.py gptme/util/_telemetry.py gptme/util/generate_name.py gptme/util/useredit.py gptme/util/tree.py gptme/util/ask_execute.py gptme/util/keyword_matching.py gptme/util/cost_display.py gptme/util/context_dedup.py gptme/util/export.py gptme/util/prompt.py gptme/util/cost_tracker.py gptme/util/output_storage.py gptme/util/tool_format.py gptme/util/__init__.py gptme/util/install.py gptme/util/master_context.py gptme/eval/main.py gptme/eval/filestore.py gptme/eval/agents/swebench.py gptme/eval/agents/__init__.py gptme/eval/agents/claude_code.py gptme/eval/dspy/hybrid_optimizer.py gptme/eval/dspy/cli.py gptme/eval/dspy/metrics.py gptme/eval/dspy/experiments.py gptme/eval/dspy/signatures.py gptme/eval/dspy/tasks.py gptme/eval/dspy/prompt_optimizer.py gptme/eval/dspy/__init__.py gptme/eval/dspy/__main__.py gptme/eval/leaderboard.py gptme/eval/types.py gptme/eval/swe_extra/swe_bench_constants.py gptme/eval/swe_extra/run_swe_extra.py gptme/eval/swe_extra/swe_bench_test_spec.py gptme/eval/swe_extra/swe_bench_extra_data.py gptme/eval/swe_extra/__init__.py gptme/eval/execenv.py gptme/eval/cost.py gptme/eval/run.py gptme/eval/swebench/main.py gptme/eval/swebench/utils.py gptme/eval/swebench/evaluate.py gptme/eval/swebench/info.py gptme/eval/swebench/__init__.py gptme/eval/swebench/__main__.py gptme/eval/suites/basic.py gptme/eval/suites/practical20.py gptme/eval/suites/practical28.py gptme/eval/suites/practical8.py gptme/eval/suites/practical4.py gptme/eval/suites/practical11.py gptme/eval/suites/practical26.py gptme/eval/suites/practical14.py gptme/eval/suites/practical9.py gptme/eval/suites/browser.py gptme/eval/suites/practical31.py gptme/eval/suites/practical7.py gptme/eval/suites/practical22.py gptme/eval/suites/practical19.py gptme/eval/suites/practical13.py gptme/eval/suites/practical24.py gptme/eval/suites/practical23.py gptme/eval/suites/practical33.py gptme/eval/suites/practical12.py gptme/eval/suites/practical16.py gptme/eval/suites/practical3.py gptme/eval/suites/practical27.py gptme/eval/suites/practical10.py gptme/eval/suites/practical.py gptme/eval/suites/practical6.py gptme/eval/suites/practical21.py gptme/eval/suites/practical15.py gptme/eval/suites/init_projects.py gptme/eval/suites/practical25.py gptme/eval/suites/practical18.py gptme/eval/suites/practical30.py gptme/eval/suites/practical2.py gptme/eval/suites/practical29.py gptme/eval/suites/behavioral/optimize_n_squared.py gptme/eval/suites/behavioral/refactor_for_testability.py gptme/eval/suites/behavioral/write_test_suite.py gptme/eval/suites/behavioral/fix_mutable_default.py gptme/eval/suites/behavioral/implement_priority_queue.py gptme/eval/suites/behavioral/test_driven_error_handling.py gptme/eval/suites/behavioral/add_feature_preserve_default.py gptme/eval/suites/behavioral/merge_conflict_resolution.py gptme/eval/suites/behavioral/use_existing_helper.py gptme/eval/suites/behavioral/circuit_breaker.py gptme/eval/suites/behavioral/handle_specific_exception.py gptme/eval/suites/behavioral/validate_user_input.py gptme/eval/suites/behavioral/remove_dead_code.py gptme/eval/suites/behavioral/retry_with_backoff.py gptme/eval/suites/behavioral/scope_discipline_bugfix.py gptme/eval/suites/behavioral/multi_file_rename.py gptme/eval/suites/behavioral/implement_lru_cache.py gptme/eval/suites/behavioral/fix_security_path_traversal.py gptme/eval/suites/behavioral/add_deprecation_warning.py gptme/eval/suites/behavioral/add_logging.py gptme/eval/suites/behavioral/add_type_hints.py gptme/eval/suites/behavioral/fix_data_mutation.py gptme/eval/suites/behavioral/stage_new_files.py gptme/eval/suites/behavioral/iterative_debug.py gptme/eval/suites/behavioral/debug_data_pipeline.py gptme/eval/suites/behavioral/rate_limiting.py gptme/eval/suites/behavioral/noisy_worktree_fix.py gptme/eval/suites/behavioral/implement_memoization.py gptme/eval/suites/behavioral/implement_event_emitter.py gptme/eval/suites/behavioral/_common.py gptme/eval/suites/behavioral/add_docstrings.py gptme/eval/suites/behavioral/git_selective_commit.py gptme/eval/suites/behavioral/__init__.py gptme/eval/suites/behavioral/extract_function_refactor.py gptme/eval/suites/practical32.py gptme/eval/suites/__init__.py gptme/eval/suites/practical5.py gptme/eval/suites/practical17.py gptme/eval/trends.py gptme/eval/tbench/agent.py gptme/eval/tbench/run.py gptme/eval/tbench/__init__.py gptme/eval/__init__.py gptme/eval/__main__.py gptme/profiles.py gptme/plugins/entrypoints.py gptme/plugins/registry.py gptme/plugins/__init__.py gptme/plugins/plugin.py gptme/acp/agent.py gptme/acp/types.py gptme/acp/client.py gptme/acp/adapter.py gptme/acp/__init__.py gptme/acp/__main__.py gptme/cli/main.py gptme/cli/doctor.py gptme/cli/setup.py gptme/cli/wut.py gptme/cli/auth.py gptme/cli/cmd_mcp.py gptme/cli/onboard.py gptme/cli/cmd_chats.py gptme/cli/cmd_skills.py gptme/cli/cmd_hooks.py gptme/cli/util.py gptme/cli/__init__.py gptme/commands/session.py gptme/commands/llm.py gptme/commands/base.py gptme/commands/export.py gptme/commands/meta.py gptme/commands/__init__.py gptme/telemetry.py gptme/agent/doctor.py gptme/agent/workspace.py gptme/agent/service.py gptme/agent/cli.py gptme/agent/__init__.py gptme/constants.py gptme/info.py gptme/prompts/workspace.py gptme/prompts/context_cmd.py gptme/prompts/templates.py gptme/prompts/skills.py gptme/prompts/chat_history.py gptme/prompts/__init__.py gptme/lessons/auto_include.py gptme/lessons/matcher.py gptme/lessons/installer.py gptme/lessons/index.py gptme/lessons/hybrid_matcher.py gptme/lessons/parser.py gptme/lessons/commands.py gptme/lessons/__init__.py gptme/lessons/skills/python-repl/python_helpers.py gptme/__init__.py gptme/hooks/auto_confirm.py gptme/hooks/server_confirm.py gptme/hooks/confirm.py gptme/hooks/tests/test_server_confirm.py gptme/hooks/tests/test_markdown_validation.py gptme/hooks/tests/test_agents_md_inject.py gptme/hooks/tests/test_cache_awareness.py gptme/hooks/tests/test_server_elicit.py gptme/hooks/tests/test_time_awareness.py gptme/hooks/tests/test_active_context.py gptme/hooks/tests/test_workspace_agents.py gptme/hooks/tests/test_form_autodetect.py gptme/hooks/tests/test_cli_confirm.py gptme/hooks/tests/test_token_awareness.py gptme/hooks/tests/test_cost_awareness.py gptme/hooks/tests/test_elicitation.py gptme/hooks/tests/test_cwd_awareness.py gptme/hooks/tests/test_auto_confirm.py gptme/hooks/tests/test_confirm.py gptme/hooks/tests/__init__.py gptme/hooks/elicitation.py gptme/hooks/cache_awareness.py gptme/hooks/token_awareness.py gptme/hooks/types.py gptme/hooks/active_context.py gptme/hooks/cost_awareness.py gptme/hooks/server_elicit.py gptme/hooks/markdown_validation.py gptme/hooks/test.py gptme/hooks/form_autodetect.py gptme/hooks/time_awareness.py gptme/hooks/cli_confirm.py gptme/hooks/workspace_agents.py gptme/hooks/registry.py gptme/hooks/agents_md_inject.py gptme/hooks/cwd_awareness.py gptme/hooks/__init__.py gptme/hooks/cwd_changed.py gptme/__main__.py gptme/codeblock.py tests/test_uri.py tests/test_server_v2_agents.py tests/test_tools_shell.py tests/test_llm_openai.py tests/test_quota_skip.py tests/test_eval_practical18.py tests/test_util_interrupt.py tests/test_dspy_integration.py tests/test_integration_phase4.py tests/test_util_install.py tests/test_command_completion.py tests/test_markdown_validation.py tests/test_server_v2_auto_stepping.py tests/test_external_sessions.py tests/test_acp_protocol_logging.py tests/test_skill_installer.py tests/test_telemetry.py tests/test_llm_openai_subscription.py tests/test_tools_chats.py tests/test_llm_auth.py tests/test_subagent_unit.py tests/test_eval_practical16.py tests/test_tool_loading_duplicate.py tests/test_eval_practical17.py tests/test_codeblock.py tests/test_tools_shell_validation.py tests/test_eval_practical20.py tests/test_tools_rag.py tests/test_server_path_traversal.py tests/context/test_task_analyzer.py tests/context/test_adaptive_compressor.py tests/test_tools_screenshot.py tests/test_hooks_cache_awareness.py tests/test_agents_md_inject.py tests/test_server_v2_sessions.py tests/test_acp_client.py tests/test_autocompact_scoring.py tests/test_chat_config.py tests/test_chats_clean.py tests/test_eval_practical19.py tests/test_dspy_gepa.py tests/test_tools_tmux.py tests/test_tools_gh.py tests/test_util_hooks.py tests/test_tools_shell_background.py tests/test_tools_time_awareness.py tests/test_server_v2_hooks.py tests/test_mcp_discovery.py tests/test_server_workspace.py tests/test_lessons_parser.py tests/test_hooks_form_autodetect.py tests/test_server_api_v2_common.py tests/test_master_context.py tests/test_mcp_adapter.py tests/test_util_content.py tests/test_server_v2.py tests/test_util_cli_skills.py tests/test_agent_service_timeouts.py tests/test_llm_validate.py tests/test_util_export.py tests/test_reduce.py tests/test_context.py tests/test_cli_confirm_hook.py tests/test_demo_capture.py tests/test_prompt.py tests/test_acp_types.py tests/test_commands.py tests/test_tools_browser.py tests/test_mcp.py tests/test_eval_trends.py tests/test_active_context.py tests/test_workspace_agents.py tests/test_setup_completions.py tests/test_custom_providers.py tests/test_tools_lessons.py tests/test_message.py tests/test_init.py tests/test_util_terminal.py tests/test_gptme_provider.py tests/test_tools_shell_multiline.py tests/test_tools_save.py tests/test_shell_issue729.py tests/test_plugins.py tests/test_cost_awareness_delayed_warning.py tests/test_prompt_templates.py tests/test_profiles.py tests/test_utils.py tests/test_util_output_storage.py tests/test_eval_behavioral_solutions.py tests/test_util_keyword_matching.py tests/test_doctor.py tests/test_pdf_to_images.py tests/test_tools_restart.py tests/test_tools_elicit.py tests/test_util_cli.py tests/test_eval_leaderboard.py tests/test_tools_todo.py tests/test_util_tree.py tests/test_unified_plugins.py tests/test_prompts.py tests/test_logmanager.py tests/test_tools_mcp.py tests/test_util_cli_mcp.py tests/test_util.py tests/test_chats_json.py tests/test_eval_behavioral.py tests/test_llm_utils.py tests/test_util_clipboard_paste.py tests/test_util_file_storage.py tests/test_chats_export.py tests/test_cost_display.py tests/test_acp_agent.py tests/test_xml_format.py tests/test_cli.py tests/test_lessons.py tests/test_tools_vision.py tests/test_hooks.py tests/test_prompt_skills_summary.py tests/test_util_cost.py tests/test_provider_plugins.py tests/test_util_tokens.py tests/test_tools_patch.py tests/test_shell_background.py tests/test_util_gh_mocked.py tests/test_tree.py tests/test_agent_doctor.py tests/test_lessons_tool.py tests/test_tools_autocommit.py tests/test_lessons_integration.py tests/test_tools_read.py tests/test_onboard.py tests/test_browser_lynx.py tests/test_cwe214_docker_env_leak.py tests/test_tools_subagent.py tests/test_tools_browser_thread.py tests/test_chat.py tests/test_info.py tests/test_hooks_cwd_changed.py tests/test_server_elicitation.py tests/test_chat_history.py tests/test_chats_rename.py tests/test_shell_issue772.py tests/test_acp_adapter.py tests/test_hooks_registry.py tests/test_session.py tests/test_server_client.py tests/test_server_session_models.py tests/test_browser_github_routing.py tests/test_util_cli_providers.py tests/test_tools_choice.py tests/test_util_tool_format.py tests/test_tools_form.py tests/test_shell_for_loop_issue724.py tests/test_shell_fd_leak.py tests/test_tool_use.py tests/conftest.py tests/test_server_v2_sse.py tests/test_tools_token_awareness.py tests/test_server_v2_tool_confirmation.py tests/test_eval_swebench.py tests/test_screenshot.py tests/test_execenv.py tests/test_tools_python.py tests/test_git_worktree.py tests/test_conversations.py tests/test_util_generate_name.py tests/test_eval_timeouts.py tests/test_cost_tracker.py tests/test_misc_subprocess_timeouts.py tests/test_lessons_matcher.py tests/test_browser_format.py tests/test_tools_morph.py tests/test_acp_session_runtime.py tests/test_message_command.py tests/test_tools_computer.py tests/test_tools_precommit.py tests/test_context_selector.py tests/test_workspace_api.py tests/test_util_context_dedup.py tests/test_lessons_commands.py tests/test_server.py tests/test_auto_compact.py tests/test_eval.py tests/test_lessons_index.py tests/test_tools_complete.py tests/test_server_auth.py tests/lessons/test_wildcard_matching.py tests/test_file_selector_integration.py tests/test_hybrid_lessons.py tests/test_lessons_status.py tests/test_agent.py tests/test_shell_output_mixing_issue408.py tests/test_agent_workspace_timeouts.py tests/test_llm_models_resolution.py tests/test_llm_models.py tests/test_chats_stats.py tests/test_tools_base.py tests/test_complete.py tests/test_browser.py tests/test_dspy_basic.py tests/test_executor.py tests/test_shell_allowlist_autoconfirm.py tests/test_llm_anthropic.py tests/test_swebench_utils.py tests/test_tasks_api.py tests/test_auto_naming.py tests/test_config.py tests/test_agent_memory.py tests/test_tools.py tests/test_dspy_hybrid.py tests/test_hooks_server_confirm.py tests/test_util_gh.py tests/test_prompt_tools.py tests/test_util_cli_models.py tests/test_acp_stdout.py tests/test_eval_claude_code.py tests/test_dirs.py scripts/analyze_compression.py scripts/train/collect.py scripts/eval_leaderboard.py scripts/auto_rename_logs.py scripts/demo_capture.py scripts/github_bot.py scripts/eval_trends.py scripts/check_rst_formatting.py --by-file --hide-rate --quiet | tail -n +2
---------------------------------------------------------------------------------------------------------------
File blank comment code
---------------------------------------------------------------------------------------------------------------
gptme/util/gh.py 217 245 1161
tests/test_init.py 207 109 1131
tests/test_llm_openai.py 315 187 1130
tests/test_eval_behavioral.py 668 685 1113
gptme/tools/shell.py 195 300 1093
tests/test_acp_agent.py 321 184 1074
tests/test_util_gh.py 231 125 1059
tests/test_server_v2.py 269 112 1023
gptme/server/api_v2.py 187 143 991
gptme/acp/agent.py 181 294 983
tests/test_tools_subagent.py 334 169 982
gptme/llm/llm_openai.py 222 241 955
tests/test_eval_leaderboard.py 126 104 883
tests/test_info.py 167 73 878
gptme/eval/main.py 103 109 842
gptme/eval/leaderboard.py 149 485 804
tests/test_util_gh_mocked.py 149 119 777
tests/test_tools_shell.py 251 397 729
gptme/llm/llm_anthropic.py 153 197 726
gptme/eval/suites/basic.py 138 55 715
tests/test_tasks_api.py 166 59 702
tests/test_tools_browser.py 232 52 697
tests/test_tools_gh.py 134 69 675
gptme/cli/util.py 168 110 668
tests/test_agent.py 199 110 667
gptme/cli/doctor.py 107 80 664
gptme/server/session_step.py 150 200 661
gptme/hooks/workspace_agents.py 148 102 640
tests/test_hooks_registry.py 238 89 640
gptme/eval/dspy/tasks.py 170 374 639
gptme/server/tasks_api.py 186 121 639
tests/test_acp_session_runtime.py 215 76 635
gptme/tools/mcp_adapter.py 206 210 610
gptme/server/api_v2_sessions.py 106 128 606
tests/test_server_workspace.py 128 130 605
tests/test_config.py 173 291 602
gptme/cli/main.py 93 92 599
gptme/tools/browser.py 187 263 596
tests/test_tools_lessons.py 135 49 580
tests/test_tools_precommit.py 109 86 578
gptme/cli/setup.py 134 67 576
gptme/tools/base.py 138 180 574
tests/test_prompt_templates.py 206 140 551
gptme/util/context.py 136 192 543
tests/test_auto_compact.py 227 189 543
tests/test_llm_models_resolution.py 187 128 543
tests/test_llm_utils.py 159 101 538
gptme/server/openapi_docs.py 198 147 537
tests/test_doctor.py 154 96 536
gptme/llm/llm_openai_subscription.py 136 116 523
gptme/tools/gh.py 116 126 523
gptme/tools/_browser_playwright.py 140 105 518
tests/test_lessons.py 156 153 517
gptme/tools/computer.py 154 222 514
gptme/eval/execenv.py 85 146 510
tests/test_server_v2_sessions.py 93 67 503
gptme/lessons/installer.py 146 165 495
gptme/logmanager/manager.py 114 141 488
tests/test_llm_auth.py 169 56 476
tests/test_server_session_models.py 158 140 466
tests/test_skill_installer.py 138 154 459
tests/test_tools_shell_background.py 117 51 456
scripts/analyze_compression.py 103 68 446
scripts/demo_capture.py 104 83 445
tests/test_tools_base.py 149 62 440
gptme/server/workspace_api.py 97 89 437
tests/test_lessons_commands.py 157 82 422
tests/test_dirs.py 97 69 421
gptme/eval/dspy/prompt_optimizer.py 109 89 420
tests/test_tools_computer.py 163 98 420
gptme/llm/__init__.py 86 126 419
tests/context/test_task_analyzer.py 90 44 418
tests/test_lessons_parser.py 188 239 417
gptme/eval/run.py 57 69 413
gptme/util/prompt.py 103 151 410
scripts/github_bot.py 84 79 409
tests/test_hooks_cache_awareness.py 122 35 403
tests/test_codeblock.py 302 776 402
gptme/agent/service.py 108 103 400
tests/test_tools_shell_validation.py 161 63 399
tests/test_tools_mcp.py 102 20 398
gptme/chat.py 68 92 395
tests/test_server_path_traversal.py 100 60 388
gptme/agent/doctor.py 89 43 387
gptme/tools/chats.py 85 101 385
tests/test_lessons_index.py 131 106 385
gptme/tools/tmux.py 95 171 384
gptme/tools/subagent/api.py 63 114 382
gptme/hooks/registry.py 88 78 381
tests/test_util_cli_mcp.py 89 45 380
gptme/agent/cli.py 105 125 369
gptme/hooks/tests/test_workspace_agents.py 102 36 369
gptme/eval/dspy/cli.py 73 57 364
gptme/llm/models/data.py 3 30 364
gptme/cli/cmd_hooks.py 103 72 363
gptme/util/_telemetry.py 106 123 357
tests/test_profiles.py 84 30 354
tests/test_eval.py 77 70 352
tests/test_lessons_matcher.py 99 86 352
tests/test_llm_anthropic.py 64 28 352
gptme/eval/dspy/experiments.py 94 60 350
tests/test_commands.py 123 60 347
gptme/agent/workspace.py 120 209 346
gptme/eval/dspy/metrics.py 97 98 345
gptme/message.py 85 116 344
gptme/hooks/tests/test_elicitation.py 91 45 343
gptme/telemetry.py 85 54 342
tests/test_cli.py 95 71 342
tests/test_shell_background.py 99 71 342
tests/test_workspace_api.py 98 19 342
tests/test_unified_plugins.py 94 38 341
gptme/tools/mcp.py 102 102 337
tests/test_eval_trends.py 35 22 335
tests/test_util_cli.py 87 52 333
tests/test_eval_behavioral_solutions.py 261 770 332
tests/test_provider_plugins.py 90 32 331
tests/test_message.py 120 111 328
gptme/eval/suites/practical.py 35 30 326
tests/test_util_tool_format.py 78 32 322
gptme/tools/subagent/execution.py 88 123 321
tests/conftest.py 89 89 319
tests/test_agent_doctor.py 72 34 318
gptme/eval/trends.py 59 31 317
tests/test_mcp_discovery.py 97 39 315
tests/test_mcp_adapter.py 106 54 313
tests/test_util_hooks.py 82 87 311
tests/test_tools_morph.py 89 66 310
gptme/hooks/tests/test_confirm.py 100 59 309
gptme/mcp/client.py 93 108 299
tests/context/test_adaptive_compressor.py 58 44 298
tests/test_context.py 130 79 297
tests/test_external_sessions.py 80 49 296
tests/test_workspace_agents.py 137 57 296
gptme/info.py 84 70 293
gptme/cli/cmd_chats.py 61 35 288
tests/lessons/test_wildcard_matching.py 114 125 287
tests/test_hybrid_lessons.py 77 34 286
tests/test_server.py 106 71 283
gptme/eval/dspy/hybrid_optimizer.py 141 345 282
tests/test_hooks_server_confirm.py 78 31 282
gptme/eval/swe_extra/swe_bench_test_spec.py 53 29 280
gptme/logmanager/conversations.py 60 81 278
gptme/tools/lessons.py 102 109 275
gptme/tools/save.py 61 60 274
tests/test_tools_restart.py 72 49 274
gptme/tools/__init__.py 89 71 273
gptme/tools/shell_validation.py 88 121 273
tests/test_server_v2_agents.py 57 25 272
tests/test_tools_complete.py 78 77 271
gptme/tools/patch.py 62 95 270
gptme/tools/shell_background.py 65 36 270
gptme/server/external_sessions.py 40 25 267
gptme/acp/client.py 66 121 266
tests/test_execenv.py 70 51 266
gptme/hooks/tests/test_agents_md_inject.py 54 35 262
tests/test_tools.py 113 59 259
tests/test_tools_autocommit.py 98 47 258
gptme/plugins/__init__.py 85 119 256
tests/test_context_selector.py 83 45 254
gptme/hooks/tests/test_form_autodetect.py 73 25 253
tests/test_eval_claude_code.py 66 27 253
gptme/cli/cmd_skills.py 71 35 252
gptme/llm/models/listing.py 62 56 252
tests/test_chat.py 122 142 252
tests/test_lessons_integration.py 97 66 252
gptme/eval/suites/practical16.py 64 100 251
tests/test_util_cli_providers.py 60 27 250
tests/test_prompt_tools.py 57 30 249
gptme/llm/models/resolution.py 59 64 248
tests/test_llm_models.py 87 63 248
gptme/codeblock.py 37 143 247
tests/test_tools_browser_thread.py 69 38 245
tests/test_agents_md_inject.py 43 37 241
tests/test_complete.py 56 40 241
tests/test_cost_display.py 27 20 241
tests/test_prompts.py 76 54 240
gptme/tools/python.py 74 90 239
tests/test_mcp.py 68 59 239
gptme/context/task_analyzer.py 100 124 237
tests/test_auto_naming.py 69 45 237
gptme/lessons/index.py 90 133 235
tests/test_conversations.py 35 25 235
gptme/commands/meta.py 54 20 234
gptme/context/adaptive_compressor.py 76 130 232
gptme/prompts/__init__.py 48 88 232
gptme/tools/todo.py 95 109 232
tests/test_hooks.py 114 46 232
gptme/tools/precommit.py 70 96 229
gptme/hooks/tests/test_cost_awareness.py 49 37 227
gptme/cli/onboard.py 67 59 224
gptme/hooks/tests/test_token_awareness.py 37 28 224
gptme/util/auto_naming.py 68 78 224
gptme/eval/swebench/main.py 32 23 223
gptme/prompts/workspace.py 37 58 222
gptme/eval/suites/practical6.py 56 46 221
gptme/lessons/parser.py 73 117 221
tests/test_browser.py 96 53 221
gptme/commands/llm.py 53 51 220
gptme/hooks/tests/test_cli_confirm.py 75 23 218
gptme/lessons/hybrid_matcher.py 84 108 218
gptme/util/_sound_sounddevice.py 57 50 218
tests/test_util_keyword_matching.py 75 46 218
gptme/profiles.py 64 67 217
gptme/mcp/registry.py 59 70 216
tests/test_lessons_tool.py 62 34 216
tests/test_logmanager.py 66 57 215
gptme/eval/swe_extra/swe_bench_extra_data.py 69 51 213
gptme/hooks/elicitation.py 90 132 213
gptme/lessons/commands.py 91 48 213
tests/test_autocompact_scoring.py 86 39 208
tests/test_executor.py 50 31 206
tests/test_plugins.py 82 70 203
tests/test_tools_screenshot.py 55 48 203
tests/test_util_file_storage.py 51 36 203
gptme/cli/auth.py 47 28 202
gptme/tools/autocompact/engine.py 41 58 202
tests/test_chats_json.py 30 17 202
gptme/eval/suites/practical7.py 57 81 201
gptme/server/session_models.py 57 69 201
gptme/util/sound.py 65 72 200
tests/test_tool_use.py 38 43 200
tests/test_subagent_unit.py 45 20 199
gptme/hooks/tests/test_active_context.py 37 29 198
gptme/eval/suites/behavioral/__init__.py 9 11 197
tests/test_server_v2_auto_stepping.py 45 45 197
gptme/config/chat.py 41 46 196
gptme/hooks/tests/test_server_elicit.py 58 23 196
gptme/prompts/templates.py 53 87 195
gptme/config/models.py 67 58 194
gptme/llm/llm_openai_models.py 6 25 193
tests/test_tools_save.py 57 36 193
gptme/eval/suites/practical8.py 68 62 191
tests/test_chats_clean.py 46 18 191
gptme/hooks/__init__.py 20 42 188
gptme/eval/agents/claude_code.py 41 33 187
gptme/hooks/tests/test_server_confirm.py 48 32 186
gptme/eval/suites/practical14.py 64 52 185
gptme/tools/morph.py 43 47 185
tests/test_chats_stats.py 63 27 184
gptme/eval/swebench/evaluate.py 35 41 183
gptme/context/selector/file_selector.py 50 61 179
tests/test_dspy_hybrid.py 65 45 179
gptme/tools/autocompact/resume.py 50 74 178
tests/test_dspy_basic.py 66 44 177
gptme/eval/suites/practical4.py 47 24 176
tests/test_hooks_cwd_changed.py 55 24 176
gptme/llm/validate.py 30 29 174
tests/test_tools_todo.py 81 65 173
tests/test_chats_export.py 48 17 172
gptme/eval/suites/practical10.py 55 65 171
tests/test_acp_types.py 35 12 171
tests/test_tools_patch.py 91 214 171
gptme/commands/session.py 58 47 170
tests/test_server_v2_hooks.py 70 59 170
tests/test_util_terminal.py 52 34 168
tests/test_tools_elicit.py 50 25 167
tests/test_tree.py 59 37 167
gptme/config/user.py 51 46 166
gptme/server/acp_session_runtime.py 34 30 165
gptme/eval/suites/practical2.py 46 18 164
gptme/server/auth.py 57 80 160
tests/test_acp_protocol_logging.py 56 15 160
tests/test_acp_client.py 64 34 159
gptme/eval/suites/practical3.py 27 19 158
tests/test_acp_stdout.py 76 37 158
tests/test_uri.py 55 30 158
gptme/tools/subagent/__init__.py 31 134 157
gptme/tools/_browser_thread.py 27 12 156
gptme/util/__init__.py 34 29 155
tests/test_tools_time_awareness.py 52 34 155
gptme/eval/suites/practical15.py 65 92 154
tests/test_cost_tracker.py 21 24 154
tests/test_shell_allowlist_autoconfirm.py 38 38 154
tests/test_tools_tmux.py 69 63 154
gptme/llm/utils.py 54 73 153
gptme/hooks/cli_confirm.py 50 54 152
gptme/tools/autocompact/scoring.py 53 89 152
gptme/tools/read.py 32 25 152
gptme/eval/suites/practical9.py 69 76 151
gptme/llm/llm_openai_models_deprecated.py 5 13 151
gptme/tools/rag.py 62 74 151
gptme/util/tool_format.py 48 75 151
tests/test_util_cli_skills.py 59 41 151
tests/test_util_tree.py 44 33 151
gptme/eval/agents/swebench.py 26 22 150
gptme/eval/suites/behavioral/add_deprecation_warning.py 73 138 150
gptme/tools/restart.py 51 81 150
tests/test_server_api_v2_common.py 46 46 150
gptme/acp/__main__.py 58 70 149
gptme/server/client.py 63 79 149
gptme/util/cost_display.py 39 31 148
gptme/util/reduce.py 45 42 148
tests/test_util_install.py 34 31 148
gptme/util/clipboard.py 22 12 147
scripts/check_rst_formatting.py 41 52 147
tests/test_master_context.py 39 24 147
gptme/tools/form.py 38 55 145
tests/test_file_selector_integration.py 50 23 145
gptme/eval/agents/__init__.py 23 12 143
tests/test_gptme_provider.py 66 20 143
tests/test_util_tokens.py 72 35 143
gptme/hooks/token_awareness.py 44 50 142
gptme/init.py 33 32 142
gptme/cli/cmd_mcp.py 41 14 140
gptme/hooks/types.py 74 111 139
tests/test_dspy_integration.py 54 32 139
gptme/eval/suites/practical5.py 67 80 138
tests/test_tools_vision.py 36 31 138
tests/test_server_elicitation.py 47 17 137
tests/test_util_cli_models.py 15 11 137
tests/test_util_content.py 49 25 137
gptme/server/cli.py 26 13 136
gptme/tools/elicit.py 36 109 135
gptme/eval/swebench/utils.py 29 10 134
gptme/hooks/cost_awareness.py 45 56 133
gptme/server/api_v2_common.py 75 62 133
gptme/eval/suites/practical17.py 64 137 131
tests/test_agent_workspace_timeouts.py 41 22 129
gptme/hooks/cache_awareness.py 95 138 128
tests/test_acp_adapter.py 42 33 128
tests/test_cwe214_docker_env_leak.py 42 41 128
gptme/hooks/tests/test_markdown_validation.py 29 21 127
gptme/llm/llm_gptme.py 47 58 127
gptme/commands/base.py 54 58 126
gptme/config/cli_setup.py 22 38 126
gptme/eval/suites/practical21.py 76 184 126
tests/test_active_context.py 41 22 126
tests/test_tools_token_awareness.py 59 47 126
gptme/hooks/tests/test_cache_awareness.py 47 34 125
gptme/tools/complete.py 34 45 125
tests/test_util_context_dedup.py 61 43 125
tests/test_tools_python.py 56 19 124
gptme/hooks/form_autodetect.py 48 65 123
tests/test_prompt.py 36 36 123
tests/test_reduce.py 33 28 123
gptme/commands/export.py 31 21 122
gptme/eval/suites/behavioral/handle_specific_exception.py 15 8 122
gptme/eval/suites/practical11.py 53 26 122
gptme/eval/suites/practical12.py 56 49 122
gptme/hooks/server_confirm.py 51 58 122
tests/test_util_interrupt.py 48 38 121
tests/test_integration_phase4.py 22 19 119
gptme/eval/suites/practical20.py 77 190 118
tests/test_llm_openai_subscription.py 32 10 118
tests/test_util_clipboard_paste.py 27 14 117
gptme/tools/autocompact/hook.py 40 48 116
tests/test_agent_service_timeouts.py 19 18 116
tests/test_llm_validate.py 26 20 116
gptme/config/core.py 40 33 115
gptme/eval/suites/behavioral/add_type_hints.py 40 97 115
gptme/plugins/registry.py 40 32 115
scripts/auto_rename_logs.py 34 23 115
gptme/eval/suites/practical18.py 52 117 114
gptme/server/api_v2_agents.py 25 17 114
tests/test_misc_subprocess_timeouts.py 43 27 114
gptme/hooks/server_elicit.py 52 56 113
tests/test_lessons_status.py 67 96 113
tests/test_chats_rename.py 42 17 112
gptme/llm/models/types.py 47 54 111
gptme/util/export.py 26 29 111
tests/test_eval_swebench.py 39 32 111
gptme/hooks/confirm.py 53 88 109
gptme/hooks/tests/test_time_awareness.py 36 11 109
gptme/util/cost_tracker.py 43 62 109
tests/test_cost_awareness_delayed_warning.py 42 32 108
gptme/eval/suites/practical29.py 69 129 107
tests/test_server_v2_tool_confirmation.py 32 32 107
gptme/eval/suites/practical28.py 66 155 106
gptme/eval/suites/practical13.py 47 47 105
gptme/eval/suites/practical19.py 58 133 105
gptme/eval/suites/behavioral/implement_lru_cache.py 56 101 104
gptme/eval/suites/practical22.py 76 174 104
scripts/train/collect.py 35 52 104
gptme/dirs.py 42 31 103
gptme/eval/suites/behavioral/implement_event_emitter.py 48 94 103
gptme/lessons/matcher.py 35 47 103
gptme/tools/choice.py 32 38 103
tests/test_util_cost.py 21 19 103
gptme/eval/suites/practical23.py 75 190 102
gptme/eval/suites/practical30.py 68 110 102
tests/test_git_worktree.py 31 19 102
gptme/eval/suites/practical25.py 70 147 101
gptme/eval/suites/practical27.py 70 154 101
gptme/eval/suites/practical33.py 68 109 101
gptme/eval/suites/practical32.py 70 134 100
gptme/hooks/active_context.py 25 23 100
tests/test_command_completion.py 33 23 100
gptme/eval/suites/behavioral/refactor_for_testability.py 22 45 99
gptme/eval/suites/practical24.py 78 204 99
gptme/eval/suites/practical26.py 72 162 99
gptme/eval/suites/practical31.py 69 112 99
tests/test_tools_read.py 30 14 98
gptme/eval/suites/behavioral/implement_priority_queue.py 61 109 97
gptme/eval/suites/behavioral/optimize_n_squared.py 31 43 95
gptme/tools/subagent/types.py 36 47 95
tests/test_session.py 40 21 95
gptme/tools/screenshot.py 25 29 94
gptme/prompts/chat_history.py 34 27 91
tests/test_tools_choice.py 47 24 91
gptme/acp/types.py 25 13 90
tests/test_agent_memory.py 26 17 90
tests/test_browser_lynx.py 35 15 90
gptme/eval/tbench/run.py 16 12 89
gptme/util/ask_execute.py 25 40 89
tests/test_swebench_utils.py 27 2 89
gptme/util/tree.py 21 15 87
gptme/eval/suites/behavioral/circuit_breaker.py 53 118 86
gptme/tools/autocompact/decision.py 34 48 86
tests/test_browser_github_routing.py 27 0 86
gptme/eval/suites/behavioral/implement_memoization.py 50 112 84
gptme/hooks/time_awareness.py 29 31 84
tests/test_server_auth.py 40 19 84
gptme/commands/__init__.py 15 21 83
gptme/util/git_worktree.py 25 33 83
gptme/__version__.py 17 5 82
gptme/eval/suites/behavioral/validate_user_input.py 33 55 82
gptme/eval/suites/behavioral/add_docstrings.py 47 103 81
gptme/eval/suites/behavioral/add_feature_preserve_default.py 27 40 81
gptme/tools/autocommit.py 37 58 80
tests/test_prompt_skills_summary.py 44 44 80
gptme/eval/swe_extra/run_swe_extra.py 16 14 79
tests/test_onboard.py 17 17 79
gptme/hooks/agents_md_inject.py 27 47 78
gptme/lessons/auto_include.py 31 27 78
tests/test_util.py 42 85 78
gptme/eval/suites/behavioral/rate_limiting.py 52 118 77
tests/test_eval_timeouts.py 32 33 77
gptme/context/compress.py 63 131 76
tests/test_markdown_validation.py 43 34 75
tests/test_shell_issue729.py 50 52 75
tests/test_util_output_storage.py 18 10 75
gptme/eval/types.py 26 26 74
gptme/hooks/tests/test_cwd_awareness.py 13 12 74
tests/test_custom_providers.py 32 44 74
gptme/eval/suites/behavioral/retry_with_backoff.py 30 49 73
gptme/tools/vision.py 25 14 73
tests/test_shell_issue772.py 48 47 73
tests/test_chat_config.py 24 19 72
gptme/llm/llm_anthropic_models_deprecated.py 5 11 70
gptme/session.py 39 64 70
gptme/config/project.py 23 28 69
gptme/context/selector/llm_based.py 32 38 69
gptme/util/generate_name.py 5 6 69
tests/test_hooks_form_autodetect.py 22 34 68
gptme/prompts/context_cmd.py 11 9 67
tests/test_tools_form.py 22 19 67
gptme/eval/swe_extra/swe_bench_constants.py 9 9 66
gptme/util/master_context.py 28 38 66
gptme/eval/tbench/agent.py 20 24 65
gptme/eval/suites/behavioral/fix_mutable_default.py 31 57 64
gptme/config/__init__.py 6 15 63
gptme/eval/filestore.py 11 8 63
gptme/lessons/skills/python-repl/python_helpers.py 28 26 63
gptme/eval/suites/__init__.py 22 18 62
gptme/eval/suites/init_projects.py 21 1 62
gptme/util/_sound_cmd.py 22 17 62
gptme/eval/suites/behavioral/test_driven_error_handling.py 35 56 61
gptme/eval/suites/behavioral/add_logging.py 27 39 60
gptme/llm/models/__init__.py 3 12 60
gptme/tools/_browser_lynx.py 12 12 60
gptme/tools/_browser_perplexity.py 22 16 60
gptme/util/tokens.py 20 20 60
tests/test_shell_output_mixing_issue408.py 25 29 60
gptme/context/selector/rule_based.py 20 13 59
gptme/util/uri.py 29 42 59
tests/test_eval_practical20.py 27 8 59
tests/test_server_client.py 33 26 59
gptme/eval/suites/behavioral/merge_conflict_resolution.py 31 63 58
gptme/eval/suites/behavioral/noisy_worktree_fix.py 45 77 58
gptme/eval/suites/behavioral/scope_discipline_bugfix.py 37 52 58
gptme/prompts/skills.py 16 10 58
gptme/eval/suites/behavioral/fix_data_mutation.py 26 44 57
gptme/eval/suites/behavioral/fix_security_path_traversal.py 23 31 57
gptme/server/app.py 23 21 57
gptme/eval/dspy/signatures.py 19 21 56
tests/test_chat_history.py 14 12 56
gptme/context/selector/file_integration.py 13 10 55
gptme/eval/suites/behavioral/extract_function_refactor.py 30 52 55
gptme/tools/autocompact/handlers.py 19 9 55
gptme/eval/suites/behavioral/write_test_suite.py 24 33 54
gptme/hooks/cwd_changed.py 15 11 54
gptme/util/output_storage.py 26 36 54
gptme/tools/subagent/batch.py 26 47 53
gptme/util/context_dedup.py 41 93 53
gptme/util/terminal.py 28 23 53
tests/test_eval_practical17.py 33 3 53
tests/test_eval_practical18.py 23 4 53
tests/test_eval_practical19.py 23 6 53
gptme/hooks/markdown_validation.py 36 41 51
tests/test_tools_chats.py 16 13 51
tests/test_server_v2_sse.py 15 13 50
gptme/eval/suites/behavioral/remove_dead_code.py 40 63 49
gptme/eval/swebench/info.py 8 3 49
gptme/eval/suites/behavioral/multi_file_rename.py 27 42 48
gptme/eval/suites/behavioral/use_existing_helper.py 32 45 48
gptme/llm/provider_plugins.py 39 35 48
gptme/util/cost.py 12 9 47
gptme/eval/suites/behavioral/git_selective_commit.py 21 52 46
tests/test_dspy_gepa.py 18 9 46
tests/test_demo_capture.py 19 9 45
tests/test_util_generate_name.py 17 10 45
gptme/eval/suites/behavioral/debug_data_pipeline.py 30 61 44
tests/test_pdf_to_images.py 13 13 43
gptme/plugins/entrypoints.py 15 13 42
gptme/context/selector/file_config.py 10 8 41
gptme/eval/suites/behavioral/stage_new_files.py 12 18 41
tests/test_xml_format.py 19 68 41
gptme/util/file_storage.py 30 47 40
gptme/context/selector/hybrid.py 14 16 39
gptme/tools/subagent/hooks.py 19 25 39
gptme/util/keyword_matching.py 35 66 39
tests/test_shell_fd_leak.py 23 16 39
tests/test_utils.py 14 17 38
gptme/tools/autocompact/__init__.py 3 12 37
gptme/cli/wut.py 13 12 36
gptme/logmanager/__init__.py 3 9 36
tests/test_util_export.py 20 11 36
tests/test_message_command.py 13 12 35
gptme/eval/suites/behavioral/iterative_debug.py 28 39 34
tests/test_cli_confirm_hook.py 24 20 34
tests/test_tools_rag.py 15 8 34
gptme/hooks/test.py 12 5 33
tests/test_shell_for_loop_issue724.py 16 24 33
gptme/eval/suites/behavioral/_common.py 9 5 32
gptme/hooks/tests/test_auto_confirm.py 12 4 32
gptme/util/content.py 18 24 30
gptme/util/install.py 13 25 30
gptme/eval/swebench/__init__.py 1 0 28
gptme/hooks/cwd_awareness.py 11 17 28
tests/test_eval_practical16.py 11 0 28
tests/test_telemetry.py 20 15 28
gptme/util/useredit.py 11 13 26
tests/test_quota_skip.py 5 3 26
gptme/acp/adapter.py 19 22 25
gptme/constants.py 17 19 25
gptme/executor.py 18 26 24
gptme/hooks/auto_confirm.py 11 9 24
tests/test_tool_loading_duplicate.py 16 15 24
gptme/context/selector/base.py 14 23 23
gptme/util/interrupt.py 13 15 23
tests/test_setup_completions.py 9 6 22
gptme/acp/__init__.py 5 13 21
gptme/context/__init__.py 3 8 21
gptme/context/selector/config.py 8 8 21
gptme/agent/__init__.py 3 6 19
gptme/context/config.py 12 25 19
gptme/context/selector/__init__.py 6 13 19
tests/test_tools_shell_multiline.py 7 19 19
gptme/lessons/__init__.py 7 15 18
tests/test_browser_format.py 8 6 18
gptme/eval/suites/browser.py 5 0 17
gptme/plugins/plugin.py 25 39 17
gptme/cli/__init__.py 10 13 15
tests/test_screenshot.py 9 6 15
gptme/mcp/__init__.py 1 0 14
gptme/__init__.py 4 0 12
gptme/__main__.py 2 0 12
gptme/eval/tbench/__init__.py 13 22 8
gptme/eval/dspy/__init__.py 6 6 7
gptme/eval/cost.py 12 24 6
scripts/eval_trends.py 2 1 5
gptme/eval/__init__.py 2 2 4
scripts/eval_leaderboard.py 2 1 4
gptme/eval/__main__.py 1 0 3
gptme/eval/dspy/__main__.py 3 5 3
gptme/eval/swebench/__main__.py 1 0 3
gptme/server/__init__.py 2 3 3
gptme/server/__main__.py 1 0 3
gptme/tools/_browser_format.py 3 5 3
gptme/llm/constants.py 1 4 1
gptme/server/constants.py 1 3 1
---------------------------------------------------------------------------------------------------------------
SUM: 36186 36173 123078
---------------------------------------------------------------------------------------------------------------
make[2]: Leaving directory '/home/runner/work/gptme/gptme'
Code Metrics#
$ make metrics
make[2]: Entering directory '/home/runner/work/gptme/gptme'
=== Code Metrics Summary ===
Project Overview:
Files: 574
Total blocks: 10157
Average complexity: 3.6079551048537954
Most Complex Functions (D+):
gptme/server/openapi_docs.py
F 631:0 _convert_to_openapi_nullable - D
gptme/server/api_v2.py
F 636:0 api_conversation_edit_message - E
gptme/server/tasks_api.py
F 380:0 get_git_status - D
gptme/server/session_step.py
F 512:0 step - E
gptme/server/api_v2_sessions.py
F 244:0 api_conversation_step - E
F 481:0 api_conversation_tool_confirm - D
gptme/tools/mcp.py
gptme/tools/autocompact/engine.py
gptme/tools/subagent/execution.py
F 97:0 _create_subagent_thread - D
gptme/tools/subagent/api.py
F 32:0 subagent - D
gptme/tools/gh.py
F 549:0 execute_gh - E
F 99:0 _wait_for_checks - D
gptme/tools/tmux.py
F 405:0 execute_tmux - D
gptme/tools/shell.py
F 1345:0 _shorten_stdout - E
M 682:4 ShellSession._read_output_unix - E
M 523:4 ShellSession._read_output_windows - D
M 390:4 ShellSession._run_pipe - D
F 1202:0 execute_shell - D
gptme/tools/shell_background.py
M 56:4 BackgroundJob._read_output - D
gptme/tools/computer.py
F 492:0 computer - E
gptme/tools/chats.py
gptme/tools/__init__.py
F 132:0 init_tools - D
gptme/tools/lessons.py
F 244:0 auto_include_lessons_hook - D
gptme/chat.py
F 278:0 _process_message_conversation - D
gptme/context/selector/file_selector.py
gptme/context/selector/rule_based.py
M 27:4 RuleBasedSelector.select - D
gptme/config/cli_setup.py
gptme/config/core.py
M 61:4 Config.mcp - D
gptme/llm/llm_openai_subscription.py
F 582:0 stream - D
gptme/llm/llm_openai.py
F 206:0 init - E
F 1048:0 _transform_msgs_for_special_provider - D
F 716:0 stream - D
gptme/llm/llm_anthropic.py
F 956:0 _prepare_messages_for_api - D
gptme/llm/__init__.py
F 317:0 _reply_stream - E
gptme/llm/models/listing.py
F 273:0 list_models - D
gptme/llm/models/resolution.py
F 164:0 get_model - E
gptme/util/context.py
F 740:0 _resource_to_codeblock - E
F 458:0 include_paths - D
gptme/util/gh.py
F 978:0 get_github_run_logs - D
F 1161:0 search_github_issues - D
F 1267:0 search_github_prs - D
F 1369:0 merge_github_pr - D
gptme/util/prompt.py
M 296:4 GptmeCompleter.get_completions - D
gptme/util/tool_format.py
F 104:0 format_tools_list - D
gptme/eval/main.py
gptme/eval/dspy/hybrid_optimizer.py
C 239:0 TaskComplexity - D
M 283:4 TaskComplexity.analyze - D
gptme/eval/leaderboard.py
F 915:0 compute_rate_trends - D
F 679:0 aggregate_per_test - D
gptme/eval/run.py
F 241:0 execute - D
gptme/eval/suites/practical16.py
F 68:0 check_queue_all_producers_mentioned - D
gptme/eval/trends.py
F 157:0 compute_diff - D
gptme/plugins/__init__.py
F 154:0 _load_plugin - D
gptme/acp/agent.py
M 521:4 GptmeAgent.new_session - D
M 951:4 GptmeAgent.prompt - D
gptme/cli/main.py
gptme/cli/cmd_skills.py
F 17:0 skills_list - D
gptme/cli/cmd_hooks.py
F 265:0 run - D
gptme/cli/util.py
F 690:0 models_test - D
gptme/commands/llm.py
F 129:0 cmd_tools - D
gptme/commands/meta.py
F 138:0 cmd_plugin - E
gptme/telemetry.py
F 286:0 record_llm_request - E
gptme/agent/doctor.py
F 337:0 check_lessons - E
gptme/info.py
F 335:0 format_version_info - D
gptme/prompts/workspace.py
gptme/prompts/chat_history.py
F 20:0 prompt_chat_history - E
gptme/prompts/__init__.py
F 106:0 get_prompt - E
gptme/lessons/installer.py
F 239:0 install_skill - E
F 506:0 check_dependencies - D
gptme/lessons/index.py
M 96:4 LessonIndex._default_dirs - E
gptme/lessons/parser.py
F 265:0 parse_lesson - D
gptme/hooks/token_awareness.py
F 88:0 add_token_usage_warning - D
gptme/hooks/cli_confirm.py
F 162:0 _looks_like_diff - D
gptme/hooks/registry.py
M 112:4 HookRegistry.trigger - D
gptme/codeblock.py
tests/test_server_v2_auto_stepping.py
F 16:0 test_auto_stepping - E
tests/test_eval_behavioral_solutions.py
F 54:0 _apply_solution - E
tests/test_util_cli.py
F 146:0 test_tools_list - D
F 226:0 test_models_list - D
tests/test_config.py
F 533:0 test_project_config_loaded_from_toml - D
F 570:0 test_project_config_loaded_from_json - D
scripts/auto_rename_logs.py
F 32:0 auto_rename_logs - D
scripts/demo_capture.py
F 485:0 main - D
scripts/check_rst_formatting.py
F 26:0 check_file - E
Largest Files (>300 SLOC):
1737 tests/test_eval_behavioral.py
1182 gptme/tools/shell.py
1178 gptme/util/gh.py
1174 gptme/eval/leaderboard.py
1133 tests/test_llm_openai.py
1131 tests/test_init.py
1074 tests/test_acp_agent.py
1059 tests/test_util_gh.py
1023 tests/test_server_v2.py
1023 tests/test_eval_behavioral_solutions.py
991 gptme/server/api_v2.py
983 gptme/acp/agent.py
982 tests/test_tools_subagent.py
956 gptme/llm/llm_openai.py
947 gptme/eval/dspy/tasks.py
937 tests/test_tools_shell.py
889 tests/test_eval_leaderboard.py
878 tests/test_info.py
869 tests/test_codeblock.py
844 gptme/eval/main.py
822 tests/test_config.py
784 tests/test_util_gh_mocked.py
728 gptme/llm/llm_anthropic.py
715 gptme/eval/suites/basic.py
702 tests/test_tasks_api.py
697 tests/test_tools_browser.py
678 gptme/tools/browser.py
675 tests/test_tools_gh.py
672 gptme/cli/util.py
667 tests/test_agent.py
664 gptme/cli/doctor.py
661 gptme/server/session_step.py
641 gptme/hooks/workspace_agents.py
640 tests/test_hooks_registry.py
639 gptme/server/tasks_api.py
635 tests/test_acp_session_runtime.py
626 gptme/cli/main.py
612 tests/test_lessons.py
610 gptme/tools/mcp_adapter.py
609 gptme/server/api_v2_sessions.py
605 tests/test_server_workspace.py
591 gptme/tools/gh.py
585 gptme/cli/setup.py
580 tests/test_tools_lessons.py
580 tests/test_auto_compact.py
580 gptme/tools/base.py
578 tests/test_tools_precommit.py
576 tests/test_lessons_parser.py
573 tests/test_skill_installer.py
570 gptme/tools/computer.py
561 gptme/util/context.py
561 gptme/server/openapi_docs.py
551 tests/test_prompt_templates.py
545 gptme/llm/llm_openai_subscription.py
543 tests/test_llm_models_resolution.py
538 tests/test_llm_utils.py
536 tests/test_doctor.py
533 gptme/tools/_browser_playwright.py
522 gptme/eval/execenv.py
513 gptme/lessons/installer.py
505 tests/test_server_v2_sessions.py
489 gptme/logmanager/manager.py
476 tests/test_llm_auth.py
472 tests/test_tools_base.py
471 gptme/tools/tmux.py
466 tests/test_server_session_models.py
456 tests/test_tools_shell_background.py
451 scripts/demo_capture.py
445 scripts/analyze_compression.py
437 gptme/server/workspace_api.py
432 tests/test_tools_computer.py
430 gptme/util/prompt.py
422 tests/test_lessons_commands.py
421 tests/test_dirs.py
421 gptme/eval/dspy/prompt_optimizer.py
419 gptme/llm/__init__.py
419 gptme/agent/service.py
418 tests/context/test_task_analyzer.py
418 scripts/github_bot.py
414 gptme/eval/run.py
403 tests/test_hooks_cache_awareness.py
399 tests/test_tools_shell_validation.py
398 tests/test_tools_mcp.py
395 gptme/chat.py
395 gptme/agent/workspace.py
394 tests/test_lessons_index.py
392 gptme/llm/models/data.py
391 gptme/tools/chats.py
388 tests/test_server_path_traversal.py
387 gptme/agent/doctor.py
382 gptme/tools/subagent/api.py
381 gptme/hooks/registry.py
380 tests/test_util_cli_mcp.py
372 tests/test_lessons_matcher.py
371 tests/test_eval.py
369 gptme/hooks/tests/test_workspace_agents.py
369 gptme/agent/cli.py
364 gptme/eval/dspy/cli.py
363 gptme/cli/cmd_hooks.py
357 gptme/util/_telemetry.py
355 gptme/eval/dspy/experiments.py
354 tests/test_profiles.py
353 tests/test_llm_anthropic.py
351 tests/test_cli.py
351 gptme/tools/mcp.py
351 gptme/message.py
350 gptme/eval/dspy/metrics.py
347 tests/test_util_hooks.py
347 tests/test_commands.py
346 tests/test_tools_patch.py
346 tests/lessons/test_wildcard_matching.py
343 gptme/hooks/tests/test_elicitation.py
342 tests/test_workspace_api.py
342 tests/test_shell_background.py
342 gptme/telemetry.py
341 tests/test_unified_plugins.py
339 tests/test_message.py
336 tests/test_eval_trends.py
333 tests/test_util_cli.py
331 tests/test_provider_plugins.py
326 gptme/eval/suites/practical.py
322 tests/test_util_tool_format.py
321 gptme/tools/subagent/execution.py
319 tests/conftest.py
318 tests/test_agent_doctor.py
317 gptme/eval/suites/practical16.py
316 gptme/eval/trends.py
315 tests/test_mcp_discovery.py
313 tests/test_mcp_adapter.py
310 tests/test_tools_morph.py
309 gptme/tools/patch.py
309 gptme/hooks/tests/test_confirm.py
make[3]: Entering directory '/home/runner/work/gptme/gptme'
Most Duplicated Files:
npm warn exec The following package was not found and will be installed: jscpd@4.0.9
Clone found (python):
- gptme/util/_sound_sounddevice.py [103:5 - 115:67] (12 lines, 113 tokens)
gptme/util/_sound_sounddevice.py [62:5 - 74:27]
Clone found (python):
- gptme/tools/autocompact/engine.py [235:17 - 245:19] (10 lines, 92 tokens)
gptme/tools/autocompact/engine.py [185:13 - 195:16]
Clone found (python):
- gptme/tools/shell_background.py [89:9 - 97:2] (8 lines, 84 tokens)
gptme/tools/shell_background.py [71:4 - 79:16]
Clone found (python):
- gptme/tools/precommit.py [124:21 - 132:7] (8 lines, 71 tokens)
gptme/tools/precommit.py [113:7 - 122:51]
Clone found (python):
- gptme/tools/patch.py [330:5 - 344:4] (14 lines, 93 tokens)
gptme/tools/save.py [127:5 - 141:41]
Clone found (python):
- gptme/tools/gh.py [151:13 - 160:7] (9 lines, 80 tokens)
gptme/tools/gh.py [78:9 - 89:7]
Clone found (python):
- gptme/server/workspace_api.py [64:5 - 71:19] (7 lines, 94 tokens)
gptme/server/workspace_api.py [45:29 - 52:17]
Clone found (python):
- gptme/server/workspace_api.py [587:9 - 609:7] (22 lines, 230 tokens)
gptme/server/workspace_api.py [509:9 - 531:6]
Clone found (python):
- gptme/server/tasks_api.py [502:5 - 513:42] (11 lines, 79 tokens)
gptme/server/tasks_api.py [489:26 - 499:5]
Clone found (python):
- gptme/server/session_models.py [285:2 - 299:52] (14 lines, 118 tokens)
gptme/server/session_models.py [229:2 - 242:9]
Clone found (python):
- gptme/server/session_models.py [308:17 - 324:37] (16 lines, 104 tokens)
gptme/server/session_models.py [254:21 - 270:15]
Clone found (python):
- gptme/server/external_sessions.py [247:83 - 258:8] (11 lines, 99 tokens)
gptme/server/external_sessions.py [131:77 - 142:5]
Clone found (python):
- gptme/server/api_v2_sessions.py [642:5 - 651:4] (9 lines, 82 tokens)
gptme/server/api_v2_sessions.py [248:5 - 257:8]
Clone found (python):
- gptme/server/api_v2_sessions.py [810:5 - 824:3] (14 lines, 129 tokens)
gptme/server/api_v2_sessions.py [246:5 - 260:7]
Clone found (python):
- gptme/plugins/__init__.py [412:5 - 437:25] (25 lines, 183 tokens)
gptme/util/install.py [14:5 - 39:28]
Clone found (python):
- gptme/llm/models/listing.py [339:24 - 345:24] (6 lines, 75 tokens)
gptme/llm/models/listing.py [166:17 - 172:17]
Clone found (python):
- gptme/llm/validate.py [205:37 - 219:14] (14 lines, 99 tokens)
gptme/llm/validate.py [188:40 - 202:19]
Clone found (python):
- gptme/llm/validate.py [222:29 - 233:45] (11 lines, 93 tokens)
gptme/llm/validate.py [188:40 - 199:45]
Clone found (python):
- gptme/hooks/tests/test_time_awareness.py [130:24 - 136:3] (6 lines, 77 tokens)
gptme/hooks/tests/test_time_awareness.py [112:28 - 118:2]
Clone found (python):
- gptme/hooks/tests/test_time_awareness.py [144:23 - 150:2] (6 lines, 77 tokens)
gptme/hooks/tests/test_time_awareness.py [112:28 - 118:2]
Clone found (python):
- gptme/hooks/tests/test_server_confirm.py [254:4 - 266:3] (12 lines, 124 tokens)
gptme/hooks/tests/test_server_elicit.py [265:4 - 277:3]
Clone found (python):
- gptme/hooks/tests/test_agents_md_inject.py [129:9 - 140:61] (11 lines, 87 tokens)
gptme/hooks/tests/test_agents_md_inject.py [60:9 - 70:7]
Clone found (python):
- gptme/hooks/tests/test_agents_md_inject.py [186:2 - 201:3] (15 lines, 112 tokens)
gptme/hooks/tests/test_agents_md_inject.py [154:43 - 169:3]
Clone found (python):
- gptme/hooks/tests/test_agents_md_inject.py [234:24 - 250:7] (16 lines, 116 tokens)
gptme/hooks/tests/test_agents_md_inject.py [154:43 - 170:9]
Clone found (python):
- gptme/hooks/tests/test_agents_md_inject.py [258:11 - 273:4] (15 lines, 104 tokens)
gptme/hooks/tests/test_agents_md_inject.py [154:43 - 168:2]
Clone found (python):
- gptme/hooks/tests/test_agents_md_inject.py [284:17 - 300:10] (16 lines, 118 tokens)
gptme/hooks/tests/test_agents_md_inject.py [154:43 - 250:22]
Clone found (python):
- gptme/eval/suites/behavioral/implement_event_emitter.py [68:5 - 75:7] (7 lines, 106 tokens)
gptme/eval/suites/behavioral/implement_event_emitter.py [54:5 - 61:5]
Clone found (python):
- gptme/eval/suites/behavioral/implement_event_emitter.py [85:5 - 92:6] (7 lines, 106 tokens)
gptme/eval/suites/behavioral/implement_event_emitter.py [54:5 - 61:5]
Clone found (python):
- gptme/eval/suites/behavioral/circuit_breaker.py [3:1 - 19:33] (16 lines, 115 tokens)
gptme/eval/suites/behavioral/rate_limiting.py [3:1 - 19:28]
Clone found (python):
- gptme/eval/suites/behavioral/add_type_hints.py [42:5 - 50:3] (8 lines, 100 tokens)
gptme/eval/suites/behavioral/add_type_hints.py [20:5 - 36:4]
Clone found (python):
- gptme/eval/suites/behavioral/add_type_hints.py [83:5 - 90:9] (7 lines, 89 tokens)
gptme/eval/suites/behavioral/add_type_hints.py [20:5 - 27:12]
Clone found (python):
- gptme/eval/dspy/cli.py [316:31 - 331:49] (15 lines, 104 tokens)
gptme/eval/dspy/cli.py [78:1 - 93:7]
Clone found (python):
- gptme/eval/dspy/cli.py [423:12 - 439:46] (16 lines, 93 tokens)
gptme/eval/dspy/cli.py [160:9 - 176:41]
Clone found (python):
- gptme/eval/dspy/cli.py [450:13 - 456:15] (6 lines, 84 tokens)
gptme/eval/dspy/cli.py [187:13 - 192:17]
Clone found (python):
- gptme/eval/agents/swebench.py [109:13 - 118:4] (9 lines, 93 tokens)
gptme/eval/agents/swebench.py [85:9 - 92:3]
Clone found (python):
- gptme/eval/execenv.py [236:9 - 248:64] (12 lines, 139 tokens)
gptme/eval/filestore.py [59:12 - 71:6]
Clone found (python):
- gptme/eval/execenv.py [478:9 - 499:5] (21 lines, 109 tokens)
gptme/eval/execenv.py [179:9 - 200:3]
Clone found (python):
- gptme/eval/execenv.py [504:13 - 517:12] (13 lines, 93 tokens)
gptme/eval/execenv.py [206:13 - 219:4]
Clone found (python):
- gptme/eval/execenv.py [581:5 - 601:5] (20 lines, 118 tokens)
gptme/eval/execenv.py [356:5 - 376:5]
Clone found (python):
- gptme/eval/execenv.py [611:17 - 630:2] (19 lines, 143 tokens)
gptme/eval/execenv.py [391:17 - 410:59]
Clone found (python):
- gptme/eval/execenv.py [714:13 - 733:71] (19 lines, 144 tokens)
gptme/eval/execenv.py [206:13 - 523:65]
Clone found (python):
- gptme/context/adaptive_compressor.py [69:4 - 81:2] (12 lines, 86 tokens)
gptme/tools/autocompact/scoring.py [158:2 - 167:2]
Clone found (python):
- gptme/context/adaptive_compressor.py [203:2 - 212:2] (9 lines, 86 tokens)
gptme/tools/autocompact/scoring.py [263:2 - 272:2]
Clone found (python):
- gptme/commands/meta.py [210:9 - 219:7] (9 lines, 90 tokens)
gptme/commands/meta.py [161:9 - 170:6]
Clone found (python):
- gptme/cli/util.py [883:5 - 890:17] (7 lines, 79 tokens)
gptme/cli/util.py [850:9 - 857:10]
Clone found (python):
- gptme/cli/doctor.py [223:15 - 238:8] (15 lines, 97 tokens)
gptme/cli/doctor.py [201:15 - 216:6]
Clone found (python):
- gptme/acp/client.py [428:5 - 435:14] (7 lines, 139 tokens)
gptme/acp/client.py [239:9 - 246:5]
Clone found (python):
- scripts/generate_sounds.py [165:2 - 173:13] (8 lines, 81 tokens)
scripts/generate_sounds.py [91:2 - 99:11]
Clone found (python):
- scripts/analyze_compression.py [152:43 - 164:2] (12 lines, 97 tokens)
scripts/analyze_compression.py [55:71 - 67:3]
Clone found (python):
- scripts/analyze_compression.py [220:9 - 231:24] (11 lines, 97 tokens)
scripts/analyze_compression.py [116:9 - 127:20]
Clone found (python):
- gptme/telemetry.py [57:2 - 80:4] (23 lines, 106 tokens)
gptme/util/_telemetry.py [303:5 - 326:7]
Clone found (python):
- gptme/telemetry.py [445:5 - 456:11] (11 lines, 90 tokens)
gptme/telemetry.py [110:9 - 121:10]
┌────────────┬────────────────┬─────────────┬──────────────┬──────────────┬──────────────────┬───────────────────┐
│ Format │ Files analyzed │ Total lines │ Total tokens │ Clones found │ Duplicated lines │ Duplicated tokens │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ python │ 342 │ 92729 │ 570555 │ 52 │ 637 (0.69%) │ 5417 (0.95%) │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ css │ 1 │ 173 │ 1045 │ 0 │ 0 (0%) │ 0 (0%) │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ javascript │ 1 │ 616 │ 5619 │ 0 │ 0 (0%) │ 0 (0%) │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ markup │ 2 │ 318 │ 2696 │ 0 │ 0 (0%) │ 0 (0%) │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ markdown │ 7 │ 1234 │ 8782 │ 0 │ 0 (0%) │ 0 (0%) │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ bash │ 11 │ 641 │ 3359 │ 0 │ 0 (0%) │ 0 (0%) │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ url │ 1 │ 2 │ 16 │ 0 │ 0 (0%) │ 0 (0%) │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ Total: │ 365 │ 95713 │ 592072 │ 52 │ 637 (0.67%) │ 5417 (0.91%) │
└────────────┴────────────────┴─────────────┴──────────────┴──────────────┴──────────────────┴───────────────────┘
Found 52 clones.
time: 6.101s
make[3]: Leaving directory '/home/runner/work/gptme/gptme'
make[2]: Leaving directory '/home/runner/work/gptme/gptme'
The metrics above show:
Project Overview: Basic stats about the codebase size and complexity
Complex Functions: Functions rated D+ (high complexity, should be refactored)
Large Files: Files over 300 SLOC (should be split into smaller modules)
Duplicated Files: Using jscpd to find duplicated code
We should aim to:
Keep average complexity below 4.0
Have no E-rated functions (extremely complex)
Have few D-rated functions (very complex)
Keep files under 300 SLOC where possible