Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Size tasks so each step is checkable card 5 of 6

Slice 3 fits on one screen

builds on: Long sessions: lost instructions and drift, You own every line the agent writes
This is the whole diff for slice 3 (HttpResponseForbidden is already imported). With one concern on screen, you can ask the real question: is `is_staff` the rule you meant, or should it be "may this user view report 7"? The test only proves a non-staff user gets a 403. Nothing checks that an allowed user still gets the CSV. **Later cost:** every staff member can export every report, and users allowed to view report 7 are refused. In the 1,900-line version, this check sat in file 14 of 23, and nobody asked.
// Python
--- a/reports/views.py
+++ b/reports/views.py
@@ -12,1 +12,3 @@
     report = get_report(report_id)
+    if not request.user.is_staff:
+        return HttpResponseForbidden()
--- a/reports/tests/test_export.py
+++ b/reports/tests/test_export.py
@@ -40,0 +41,4 @@
+def test_export_forbidden(client, user):
+    client.force_login(user)
+    r = client.get("/reports/7/export.csv")
+    assert r.status_code == 403
Terms on this card
Later cost
The concrete damage a shortcut does after merge: a hidden bug, corrupted data or a maintenance burden.
CSV
Comma-separated values: a plain-text table format, one row per line, with fields separated by commas.
403
HTTP status code 'Forbidden': the server understood the request but refuses it for this user.
is_staff
A Django user flag marking site staff. It says nothing about which specific reports that user may see.
HttpResponseForbidden
A Django response class that sends HTTP status 403 (Forbidden).
Learn this step by step on Bytewise
Lesson goal: Split work into small vertical slices, one concern per run, reviewed and committed between steps. Explain why large tasks produce drift, huge diffs and hidden shortcuts. · the whole lesson