Paste raw Python traceback output and get a conservative debugging brief for ChatGPT, Codex, Claude Code, OpenCode, or another coding agent.
Python errors often include repeated startup logs, framework internals, site-packages frames, and wrapper messages. tokensift keeps the exception and user-code evidence first so the coding agent does not have to infer the root cause from log spam.
Before and after
Before: raw paste
$ python app/main.py --config configs/prod.yaml
INFO booting app
INFO booting app
INFO loading plugins
INFO loading plugins
Traceback (most recent call last):
File "/workspace/app/main.py", line 12, in <module>
from app.routes import create_router
File "/workspace/app/routes.py", line 8, in <module>
from pydantic_settings import BaseSettings
ModuleNotFoundError: No module named 'pydantic_settings'
During handling of the above exception, another exception occurred:
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
app failed: exit status 1
After: conservative debugging brief
Debug Python traceback.
Type:
- Python traceback
Keep:
- cmd: python app/main.py --config configs/prod.yaml
- frame: /workspace/app/main.py:12 -> from app.routes import create_router
- frame: /workspace/app/routes.py:8 -> from pydantic_settings import BaseSettings
- error: ModuleNotFoundError: No module named 'pydantic_settings'
- wrapper: app failed: exit status 1
Folded:
- duplicate startup INFO lines, framework wrapper frames, site-packages internals
Ask: root cause, smallest fix, verify command.
Preserved evidence
- Python command and config argument
- exception type and message
- user file paths and line numbers
- failing import statement
- wrapper exit detail as secondary evidence
Folded noise
- duplicate boot/plugin logs
- framework wrapper stack frames
- site-packages frames unrelated to the missing import
- generic process-exit wrapper noise
Read a Python traceback from the failure inward
Begin with the final concrete exception, not the last process wrapper. A line such as ModuleNotFoundError: No module named 'pydantic_settings' names the failure, while a later line such as process exited with code 1 only reports the consequence. TokenSift keeps wrapper failures as secondary detail and prioritizes the final exception that matches a Python error or exception shape.
Then walk upward through the non-dependency frames. The nearest user-code frame shows the operation that triggered the exception, and earlier user frames show how execution reached it. For an import failure, retain the import statement and the active Python environment. For a type, attribute, or value error, retain the expression at the nearest user frame and any expected-versus-actual detail present in the exception.
Exception chaining needs extra care. “During handling of the above exception” and “The above exception was the direct cause” can connect two distinct failures. A compact brief should not merge those exception messages into one claim. Review the output and restore the earlier exception when it changes the causal story.
Context that changes the diagnosis
- The exact command, module entry point, configuration argument, and working environment.
- The final exception type and message, including missing names, paths, keys, or argument values.
- The first few application frames outside
site-packages, virtual environments, and framework internals.
- Python and package versions when the error could come from an API or dependency mismatch.
- A small reproduction input when data shape or state controls the failing branch.
What TokenSift does with the traceback
The Python parser extracts quoted File frames, classifies common dependency paths, retains the last matching exception line, and keeps command and environment hints when present. It can fold repeated warnings and dependency frames while reporting how many were grouped. The behavior is deterministic: the same text and options produce the same brief.
The parser does not execute the code, import the project, inspect installed packages, or know whether a path belongs to your application when it uses an unusual layout. A dependency frame can contain the real defect, and a user frame can merely call a broken library. “User frame” is an evidence-selection heuristic, not a verdict about ownership.
Limits and review checklist
- Confirm that the primary error is the exception you would debug first, not only a shutdown wrapper.
- Restore an earlier chained exception when it explains why the final exception occurred.
- Keep generated-code or plugin frames when they are part of the code you can change.
- Redact credentials, customer data, private URLs, and unnecessary absolute paths.
- Ask for one verification command or minimal reproduction rather than a broad rewrite.
See the deterministic processing pipeline, the Python support matrix, and the guide to preparing failure logs for coding agents.
Privacy note: No LLM API call. No raw logs sent to external model providers, ad providers, or third-party analytics. Hosted submissions may be stored in a private first-party database for diagnostics and retained for up to 30 days by default, so review and redact before use.
Open tokensift and paste your own log.